Bigger Isn't Always Better: A Comparative Evaluation of LLMs for Automated Code Review
This paper demonstrates that the smaller, more cost-effective Claude Haiku 4.5 outperforms the larger Claude Sonnet 4.6 in automated code review, while also revealing that synthetic benchmarks significantly overestimate model capabilities and that performance degrades sharply with larger diff sizes and performance-related bugs.
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 the editor-in-chief of a massive, chaotic newspaper. Every day, hundreds of reporters (developers) submit changes to the paper (code). Your job is to spot typos, logical errors, and security leaks before the paper goes to print.
In the past, you thought the only way to get this job done was to hire the most expensive, highly educated, and "biggest" editor possible. You assumed that a bigger brain meant better spotting of mistakes.
This paper is a report card that says: "Actually, that's not true. And the test we've been using to hire editors is completely broken."
Here is the breakdown of what the researchers found, using simple analogies:
1. The "Big Brain" Myth
The researchers tested five different "AI editors" (Large Language Models). Two of them were from the same company:
- Claude Sonnet 4.6: The "Big Brain." Expensive, powerful, and highly rated.
- Claude Haiku 4.5: The "Small Brain." Much cheaper, faster, and smaller.
The Surprise: The "Small Brain" (Haiku) consistently found more bugs and wrote better reviews than the "Big Brain" (Sonnet).
- The Analogy: It's like hiring a junior detective who spots 18% more clues than a senior detective, but costs you 3 times less money. The senior detective was so cautious and over-thinking that they missed things the junior detective caught immediately.
2. The "Fake Exam" Trap
This is the most critical finding. For years, companies tested these AI editors using Synthetic Bugs.
- The Analogy: Imagine testing a firefighter by having them put out a single, small candle in a quiet room. The AI editors did great! They got a 90% score.
- The Reality: The researchers then tested the same editors on Real Pull Requests. These are like a firefighter being asked to put out a burning skyscraper with smoke, wind, and confusing layouts.
- The Result: When the AI editors faced the "burning skyscraper" (real code), their performance didn't just drop a little; it collapsed.
- On the "candle" (synthetic bugs), they got an 85% score.
- On the "skyscraper" (real bugs), the best model got a 6.6% score.
- The Lesson: Testing AI on perfect, fake examples is like testing a driver on an empty track and assuming they can handle rush hour traffic. It gives a dangerously false sense of security.
3. The "Too Much Information" Problem
The researchers discovered that the main reason the AI failed on real code wasn't because the AI was "stupid," but because the "assignments" were too messy.
- The Analogy: If you ask a proofreader to check a single sentence, they are perfect. If you hand them a 500-page novel with 500 pages of random notes, coffee stains, and crossed-out paragraphs all at once, they get overwhelmed and miss everything.
- The Finding: The size of the code change (the "diff") was the biggest predictor of failure.
- Small changes (under 10 lines): The AI did well.
- Huge changes (over 150 lines): The AI's performance dropped by 15 times.
- The Solution: Don't feed the AI the whole novel at once. Break the code into small, manageable chapters first.
4. The "Blind Spot"
There was one type of bug the AI completely missed: Performance Issues (like code that runs too slowly).
- The Analogy: Imagine asking a mechanic to find a car part that is broken. They can see the broken part. But if you ask them to find a part that will cause the engine to overheat in 5 years, they can't see it because the car isn't running yet.
- The Reality: AI looks at the code on the screen. It cannot "run" the code to see how fast it is or how much memory it uses. For these specific problems, the AI is effectively blind.
5. The "Teamwork" Myth
The researchers wondered: "What if we hire two editors and combine their notes? Will that be better?"
- The Result: No.
- The Analogy: If two people are looking for a needle in a haystack, and they both miss the same spot, having two of them doesn't help. The AI models were all looking at the same blind spots. Adding more models just added more "noise" (false alarms) without finding new bugs.
The Bottom Line
If you are building a system to automatically review code:
- Don't buy the most expensive model. A smaller, cheaper model (like Haiku) actually did a better job in this study.
- Don't trust "fake" test results. If an AI looks perfect on a test with easy, made-up bugs, it will likely fail on real-world code.
- Break big problems into small ones. If the code change is huge, chop it up before showing it to the AI.
- Use a human (or a different tool) for speed issues. The AI cannot predict how slow the code will run.
The paper concludes that in the world of automated code review, bigger isn't better; it's just more expensive and sometimes more confused.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.