← Latest papers
🤖 AI

AgentLens: Revealing The Lucky Pass Problem in SWE-Agent Evaluation

This paper introduces AgentLens, a framework that reveals the prevalence of "Lucky Pass" phenomena in SWE-agent evaluations by demonstrating that relying solely on binary test outcomes masks significant differences in solution quality, and proposes a process-level assessment method using task-level Prefix Tree Acceptor references to more accurately rank model performance.

Original authors: Priyam Sahoo, Gaurav Mittal, Xiaomin Li, Shengjie Ma, Benjamin Steenhoek, Pingping Lin, Yu Hu

Published 2026-05-14
📖 5 min read🧠 Deep dive

Original authors: Priyam Sahoo, Gaurav Mittal, Xiaomin Li, Shengjie Ma, Benjamin Steenhoek, Pingping Lin, Yu Hu

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 hiring a mechanic to fix your car. The current way we test AI software engineers (called "SWE agents") is very simple: you hand them a broken car, they come back with a fixed one, and you check if it starts. If it starts, you give them a gold star. If it doesn't, they get a red X.

This is the "Pass/Fail" system. The problem, according to this paper, is that this system treats two very different mechanics exactly the same:

  1. The Master Mechanic: Diagnoses the problem quickly, orders the right part, fixes it efficiently, and double-checks the work.
  2. The Lucky Gambler: Tries 50 random parts, swaps them out blindly, breaks a few other things along the way, gets frustrated, and eventually—by sheer luck—happens to put the right part in. The car starts.

Under the old system, both get a gold star. But the paper argues this is a mistake. The "Lucky Gambler" is actually a bad hire because their process is chaotic, wasteful, and unpredictable.

The Problem: The "Lucky Pass"

The researchers looked at over 2,600 attempts by AI agents to fix real software bugs. They found that 10.7% of the "successful" fixes were actually "Lucky Passes."

These agents didn't solve the problem logically. Instead, they:

  • Blindly Retried: Like a kid banging on a piano until a song sounds right.
  • Forgot to Check: Fixed the code but never ran the tests to see if it actually worked.
  • Wasted Time: Explored the wrong files or went in circles before stumbling on the answer.

The Solution: AGENTLENS (The "Process Camera")

To fix this, the team built a new tool called AGENTLENS. Think of it as a high-definition camera that doesn't just look at the finished car; it records the entire repair process in slow motion.

AGENTLENS does two main things:

1. The "Map of Good Solutions" (PTA)
Instead of comparing an AI's work to just one "perfect" example, AGENTLENS builds a Prefix Tree Acceptor (PTA).

  • Analogy: Imagine a tree where the trunk is the start of the job. The branches represent different valid ways to fix the car. Some branches go through the engine room; others go through the trunk.
  • If an AI takes a path that exists on the tree, it's doing something smart. If it wanders off the tree into the woods, it's wasting time.

2. The "Intent Translator"
The tool watches what the AI is doing and labels every step with a "thought":

  • Exploration: "I'm looking for the problem."
  • Implementation: "I'm fixing the part."
  • Verification: "I'm checking if it works."
  • Orchestration: "I'm organizing my thoughts."

If an AI runs a test before it even writes the code, the tool flags it as confused. If it fixes the code but never runs a test, it flags it as risky.

What They Found

When they applied this new "Process Camera" to the data, the results were surprising:

  • Not All Winners Are Equal: They broke the successful fixes into three groups:
    • Ideal (20%): Clean, logical, and efficient.
    • Solid (69%): Good, but maybe a little messy.
    • Lucky (10.7%): The "Gambler" group. They got the right answer, but through chaos.
  • The Rankings Changed: When they ranked the AI models based on how they solved problems (not just if they solved them), the leaderboard flipped.
    • One model (GPT-4o) jumped from 8th place to 3rd place because, when it did succeed, it did so very cleanly.
    • Another model (Opus 4.6) dropped from 1st to 6th. It had a high success rate, but many of those wins were "Lucky Passes" filled with wasted effort.
  • The Cost of Luck: The "Lucky" agents were incredibly expensive. Some wasted up to 40 times more computing power (tokens) than the efficient agents just to get the same result. It's like using a sledgehammer to crack a nut because you don't know how to use a nutcracker.

The Five Types of "Lucky"

The paper also categorized exactly how these agents got lucky:

  1. The Overconfident: Fixed it but didn't check if it worked.
  2. The Brute-Forcer: Kept trying random things until one worked.
  3. The Half-Hearted: Fixed only part of the problem, but the tests weren't strict enough to catch the rest.
  4. The Wanderer: Got lost exploring and never really focused.
  5. The Creative Genius: Found a totally different, valid way to fix it that the "Map" didn't expect (this is the only "good" type of lucky).

The Bottom Line

The paper concludes that we can't just ask AI, "Did you fix it?" We have to ask, "Did you fix it the right way?"

By using AGENTLENS, we can stop rewarding AI models for being lucky or wasteful. Instead, we can train them to be like the Master Mechanic: efficient, logical, and reliable. The researchers have released their tools and data so others can start using this "Process Camera" to evaluate AI engineers better.

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 →