← Latest papers
💻 computer science

AgentSZZ: Teaching the LLM Agent to Play Detective with Bug-Inducing Commits

AgentSZZ is an LLM-driven agent framework that outperforms existing SZZ algorithms by utilizing a ReAct-style loop, domain-specific tools, and a structured compression module to effectively trace bug-inducing commits, particularly in challenging scenarios like cross-file and ghost cases where traditional methods fail.

Original authors: Yunbo Lyu, Jieke Shi, Hong Jin Kang, Ratnadira Widyasari, Junda He, Yuqing Niu, Chengran Yang, Junkai Chen, Zhou Yang, Julia Lawall, David Lo

Published 2026-04-07
📖 4 min read☕ Coffee break read

Original authors: Yunbo Lyu, Jieke Shi, Hong Jin Kang, Ratnadira Widyasari, Junda He, Yuqing Niu, Chengran Yang, Junkai Chen, Zhou Yang, Julia Lawall, David Lo

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 you are a detective trying to solve a crime. In the world of software, the "crime" is a bug (a mistake in the code) that causes a program to crash or behave strangely. The "suspect" is a specific piece of code written by a developer in the past that introduced the bug.

For years, software detectives have used a standard tool called SZZ (named after its creators) to find these suspects. Think of SZZ as a magnifying glass that looks at a "fix" (the patch that corrected the bug) and asks: "Who touched this specific line of code last before it was broken?"

The Problem: The Magnifying Glass Has Blind Spots

The old method works well for simple crimes, but it fails in two tricky situations:

  1. The "Ghost" Crime: Sometimes, the fix doesn't actually change any lines of code; it just changes how the code is organized. The magnifying glass sees nothing and gives up.
  2. The "Cross-City" Crime: Sometimes, the bug was introduced in a completely different file (like a different room in a house), but the fix is in the kitchen. The old magnifying glass only looks in the kitchen and misses the real culprit in the bedroom.

Because of these blind spots, the old method misses about half of the actual culprits. It's like a detective who only checks the front door and assumes the thief didn't come through the back window.

The Solution: AgentSZZ (The Detective with a Toolkit)

The authors of this paper created AgentSZZ. Instead of just using a magnifying glass, they built a smart, autonomous detective agent powered by a Large Language Model (LLM).

Here is how AgentSZZ works, using a creative analogy:

1. The Detective vs. The Robot

  • Old Method (SZZ): Like a robot following a strict, pre-written script. It looks at the fix, checks the immediate history, and stops. If the script says "stop," it stops, even if it hasn't found the truth.
  • AgentSZZ: Like a human detective. It doesn't just look; it investigates. It asks questions, follows clues, changes its mind, and digs deeper. It uses a "ReAct" loop: Observe (look at the code), Reason (think about what this means), and Act (run a new search).

2. The Specialized Toolkit

Instead of just one tool, AgentSZZ has a Swiss Army Knife of five specialized tools designed specifically for finding bugs:

  • The Time Machine (git blame): "Who touched this line last?"
  • The Document Viewer (git show): "What exactly did this person change? Was it a real fix or just a cosmetic change (like renaming a variable)?"
  • The Search Engine (git grep): "Where else in the entire building does this specific code appear?"
  • The History Tracker (git log): "When did this function first appear?"
  • The Function Tracker: "How has this specific function evolved over time?"

3. The "Compression" Trick

Imagine a detective writing a 50-page report on every clue they find. It would take forever to read. AgentSZZ has a smart secretary (the compression module). This secretary reads the raw data, throws away the boring stuff (like "Signed-off-by" tags or empty lines), and gives the detective a concise, 3-page summary. This saves time and money (computing power) without losing the important clues.

The Results: A Major Breakthrough

The researchers tested this new detective on three massive datasets (Linux kernel, GitHub projects, and Apache projects).

  • The Score: AgentSZZ found 27% more bugs than the previous best method.
  • The "Impossible" Cases:
    • For Cross-File crimes (bugs in a different file), AgentSZZ was 300% better at finding the culprit. It successfully followed the trail across the whole building.
    • For Ghost crimes (where no lines were changed), it improved by 60%.
  • Efficiency: Even though it's smarter, it's not slower. By using its tools efficiently and compressing the data, it actually uses fewer "steps" (turns) to solve the case than the older, dumber methods.

Why This Matters

Think of software development as a giant, ever-growing city. Bugs are like potholes.

  • Old SZZ was a street sweeper that only cleaned the main road. If the pothole was in an alley or a side street, it missed it.
  • AgentSZZ is a detective who can walk into any alley, ask the neighbors (search the code), check old blueprints (history), and figure out exactly who dug the hole, even if they did it years ago in a different neighborhood.

By teaching the AI to "play detective" rather than just "follow a script," the authors have made software debugging significantly more accurate, helping developers fix problems faster and build more secure software.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →