FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signals
This paper presents a computationally efficient, CPU-based approach for detecting LLM-generated code in SemEval-2026 Task 13 Subtask A, which combines length-robust ratio-based features, parsing tools, and a code-vs-text classifier with a shallow decision tree and heuristic rules to achieve near-instant inference without relying on large pretrained models.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine a massive digital library where books are written by two types of authors: Human Librarians and Robot Scribes. The Robot Scribes are incredibly fast and can write in many different languages, but they have a habit of leaving behind specific "tells" that give away their mechanical nature.
This paper describes how a team of researchers built a lightweight, super-fast detective to spot these Robot Scribes in the library, specifically for a competition called SemEval-2026.
Here is how their detective works, broken down into simple concepts:
1. The Problem: Why is it hard to spot the robots?
Usually, to find a fake, you look for big, complex clues. But in the world of computer code, the robots are tricky. They write code that looks perfect on the surface.
- The "Big Brain" Trap: The researchers tried using massive, super-smart AI models (like a giant, all-knowing encyclopedia) to spot the fakes. It worked great on the training books (mostly written in Python), but when they tried to read books in other languages (like Go, C#, or JavaScript), the "Big Brain" got confused. It was like a detective who only knows how to read English trying to solve a mystery in a foreign country; they missed the clues because they were too focused on the specific language.
2. The Solution: The "Lightweight Detective"
Instead of using a giant, expensive brain, the team built a simple, fast detective that looks for small, everyday habits that robots can't help but repeat. They call these "stylometric signals."
Think of it like spotting a robot by how it holds a pen, rather than analyzing the entire sentence structure.
The Key Clues (The "Tells")
The detective looks for three main things:
- The "Chatty" Comment Ratio: Robots love to explain themselves. They often write too many comments (notes to the reader) compared to the actual code. The detective calculates the ratio of "chatty notes" to "actual work." If a snippet is 50% notes and 50% code, it's likely a robot.
- The "Verb" Check: In the notes robots write, they use specific action words (verbs) in a very repetitive, explanatory way. The detective counts how many action words appear in the notes versus the code.
- The "Text vs. Code" Mix: Sometimes, robots accidentally paste entire paragraphs of normal conversation (like a chat message) right into the code. The team trained a tiny helper to scan line-by-line and ask, "Is this a line of code, or is this just a sentence?" If a code snippet has too many "just sentences," it's flagged.
3. The Special Tricks (Heuristics)
The detective also uses a few "rules of thumb" based on what they noticed in the data:
- The "Language Label" Trick: Robots often get confused by formatting. They frequently write the name of the language (like "python" or "java") as a standalone line right before the code starts. Humans rarely do this. If the detective sees a line that just says "python" sitting alone, it's a huge red flag.
- The "Trailing Error" Trick: Robots sometimes stop writing abruptly. The detective checks the very end of the code snippet. If the code cuts off right at the end with a syntax error (like a sentence ending mid-word), it's likely a robot that ran out of time or tokens.
4. How They Put It All Together
The system doesn't rely on one giant brain. Instead, it uses a two-step process:
- The Scanner: It quickly checks for the "Language Label" and the "Text vs. Code" mix. If it sees a clear robot tell, it immediately says, "This is a robot!"
- The Calculator: If the scanner isn't sure, it passes the code to a simple math calculator (a decision tree). This calculator weighs the "Chatty Ratio" and the "Verb Ratio" to make a final guess.
5. The Result
The team's system is incredibly efficient.
- No Heavy Lifting: It runs on a standard computer processor (CPU) and doesn't need a supercomputer.
- Instant Speed: It gives answers almost instantly.
- Performance: In the competition, this simple, "lightweight" detective finished in the top 15% of all entries, beating many systems that used much more complex and expensive technology.
In summary: The paper shows that you don't need a super-complex AI to spot AI-generated code. Sometimes, a simple detective that just counts how many notes the writer took and checks if they accidentally pasted a chat message into the code is enough to catch the robot.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.