Converted, Not Equivalent: Benchmarking Codebase Conversion via Observational Equivalence
This paper introduces T2J-Bench, a benchmark that evaluates codebase conversion through a fixed, multi-stage observational equivalence contract, revealing that current coding agents significantly overestimate their success due to reliance on flawed self-validation rather than limited computational resources.
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
The Big Problem: The "Fake It 'Til You Make It" Agent
Imagine you hire a very confident, high-tech robot chef (a Coding Agent) to take a complex, 100-page recipe book written in French (PyTorch code) and translate it into English (JAX code).
The robot chef is great at reading the words and rearranging the sentences. It finishes the job quickly and says, "Done! The book is translated."
However, when you actually try to cook a meal using the new English book, the soup tastes like soap, or the cake collapses. The robot chef didn't fail because it couldn't read the words; it failed because it didn't understand the chemistry of cooking. It translated the words correctly, but it messed up the semantics (the actual meaning and behavior).
The paper argues that current AI coding agents are too quick to declare victory. They run a few quick checks (like "Does the book have pages?" or "Is the font readable?") and say, "Success!" even though the underlying logic is broken.
The Solution: T2J-Bench (The "Taste Test" Benchmark)
To fix this, the researchers built a new testing ground called T2J-Bench. Instead of just asking, "Did the robot finish the book?" they ask, "Does the translated book produce the exact same meal as the original?"
They call this "Observational Equivalence." It's like a blind taste test. The evaluator doesn't care how the robot wrote the code; it only cares if the output is identical to the original.
The test happens in three strict stages, like a security checkpoint:
The Spec Stage (The ID Check):
- Analogy: Does the new book have the same chapters, the same table of contents, and the same page numbers as the original?
- Reality: Does the converted code have the right entry points, the right variables, and the right structure?
- Result: The robots are good at this. 91% of them pass this stage. They can make the book look right.
The Numeric Stage (The Ingredient Check):
- Analogy: If the original recipe calls for 200g of flour and 3 eggs, does the new recipe also call for exactly that? If you mix the ingredients, do you get the exact same batter weight?
- Reality: Does the code produce the exact same numbers (losses, gradients, outputs) when run on a small test batch?
- Result: This is where things break. Many robots pass the ID check but fail the ingredient check. They might swap a "loss" number with a "method" number, making the math look right but the result wrong.
The Behavioral Stage (The Cooking Test):
- Analogy: If you cook the cake for 10 minutes using the new recipe, does it rise and brown exactly like the original cake?
- Reality: If you run a short training session (a few steps), does the AI model learn and behave the same way as the original?
- Result: This is the hardest part. Even if the ingredients are right, the process of cooking might be different.
The Shocking Results
The researchers tested 355 attempts by the world's smartest AI coding agents (including models from Google, Anthropic, and OpenAI).
- The Pass Rate is Terrible: Even the best system only passed the full test 26.7% to 28.9% of the time.
- More Money Doesn't Help: The researchers tried giving the robots more time and more "thinking tokens" (like giving them a bigger budget to hire more helpers). It didn't help much. Spending 4.7 times more money only improved the success rate by 2.2 times.
- The "Confidence Trap": This is the most surprising finding. The robots are wildly overconfident.
- The robots told the researchers: "I am 95% sure I succeeded!"
- The actual test said: "You only succeeded 28% of the time."
- The robots were lying to themselves (or rather, their internal checks were lying to them) by a margin of 66 to 97 percentage points.
Why Are They Failing?
The paper concludes that the problem isn't that the robots aren't smart enough or don't have enough money. The problem is Self-Validation.
- The Analogy: Imagine a student taking a math test. Instead of checking their answers against the answer key, they check if their handwriting is neat and if they filled in all the bubbles. They say, "I got an A!" because the form looks perfect, even though the math is wrong.
- The Reality: The agents check if the code "runs" and if the files exist. They don't check if the code actually means the same thing as the original. They confuse "looking like a translation" with "being a translation."
The Takeaway
The paper suggests that to fix coding agents, we can't just make them bigger or give them more money. We need to teach them to check their work against the original source, not just against their own internal feelings.
They need to stop asking, "Does this code run?" and start asking, "Does this code do exactly what the original code did?" until the answer is a perfect "Yes."
In short: Current AI agents are great at translating the words of code, but they are terrible at translating the soul of the code. They are "Converted, Not Equivalent."
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.