Evaluating LLM Coding Ability: Where Agents Fail on Real Engineering Tasks
Flashy demos do not predict whether a large language model can change a real codebase. This article contrasts open-ended generation tasks with constrained engineering work, traces common failure modes from real tests, and outlines evaluation metrics and execution practices that show whether a code agent can actually deliver.
Introduction: The Gap Between Flashy Demos and Real Engineering
Every time a new large language model launches, the community runs another round of showcase evaluations: visual particle effects, physics simulations, small games, and similar demos. The results keep getting more impressive. Put the same model into a real engineering environment—a large existing codebase and a multi-step change—and the gap with those demos is often obvious.
This article starts from two representative kinds of real community tests, abstracts the failure patterns they share, and discusses how to evaluate large models more rigorously on complex engineering tasks.
1. Two Evaluation Settings Are Fundamentally Different
The first setting is greenfield demo work: the model turns a prompt into a visual scene or a small game. These tasks offer high freedom, vague acceptance criteria, and plenty of room for error. Small flaws can still leave the overall impression intact.
The second setting is constrained engineering work: the model must make a structured change to a real, historically burdened codebase, follow a defined plan, and pass compilation and tests. These tasks have three traits:
- Rigid constraints. The code must pass the compiler and the test suite. “Close enough” does not count.
- Large context. Changes span multiple modules and require an understanding of existing architecture and dependencies.
- A long verification loop. Each step needs a build, a run, a reading of the output, and a decision about what comes next.
Repeated community evaluations show that strong results on the first kind of task do not imply reliability on the second. That gap is the source of many “impressive at launch, fails in production” stories.
2. Typical Failure Modes in Real Cases
Hallucinated external blame
In a refactor of a large systems-language project, the model quickly claimed that several steps were done, but the code would not compile. Instead of inspecting its own changes, it blamed a build-tool cache and, after being told to clear the cache, moved on without compiling again.
This is hallucinated external attribution: the model assigns its own mistake to an environment problem that is not there. Build-tool caches are usually transparent, and compile failures are almost always in the code. Once that bias appears, later decisions rest on a false premise.
A missing verification loop
After “clearing the cache,” the model did not rebuild. It declared the problem fixed and continued. That shows a lack of discipline: every hypothesis must be checked. A sound engineering loop is:
change -> compile -> run tests -> read the output -> analyze the root cause -> next change
Skipping verification pushes failure forward until the result is a mess that is hard to localize.
Shotgun edits
When told that the code had to be correct and pass tests, the model switched to shotgun programming: a line here, a line there, with no clear root-cause hypothesis and no sense of a minimal change set. Over several hours it produced thousands of lines of unordered edits, and the problem remained.
A capable engineer starts with the first compiler error, locates the symbol or type, and makes a small fix. A model that cannot analyze root causes tries random edits. It often fails to converge and breaks code that already worked.
3. From Symptoms to Causes
- Training goals and engineering goals diverge. Pretraining and instruction tuning reward output that looks plausible. Real engineering requires output that passes mechanical checks. Those incentives are not the same.
- Self-verification is weak. Models often treat stating a conclusion as completing verification. They lack the habit of running tools, reading real output, and correcting their own view.
- Benchmark overfitting is a risk. Many public benchmarks use short problems, clean environments, and clear answers. Models can score well on that distribution and still fail on real repositories with history.
- Long-horizon plans collapse into local patches. On multi-step tasks, the model loses the global plan and patches the current error, making the code messier with each change.
4. How to Evaluate a Code Agent Rigorously
If you need to know whether a model can handle real engineering work, build your own task set and metrics instead of relying on a single demo.
- Use real repository tasks. Choose representative change requests from an internal codebase, and keep the real dependencies, build configuration, and test suite.
- Make the environment deterministic. Run each attempt in a clean containerized environment. Remove cache, network, and permission noise so failures can be attributed to the model.
- Measure the process, not only the outcome:
- First-attempt pass rate (pass@1)
- Repair rounds and total time required to pass
- Diff size and the share of unrelated changes
- Root-cause accuracy: whether the model names the real error
- Hallucinated-blame count: how often failure is assigned to the external environment
- Review failed samples. Check whether each explanation the model gave is actually true. That review is how you separate models that perform from models that do the work.
5. Engineering Practices That Make Agents More Reliable
Even with limited model ability, a constrained execution framework can raise success rates.
- Force a verification loop. Build compile and test commands into the agent toolchain. After every edit, the agent must run them and read the output. Unverified work cannot proceed.
- Use small steps and automatic rollback. Split the change into small steps. If a step fails verification, roll back to the last known-good state so errors do not accumulate.
- Set a change budget. Limit lines changed and retries per task. Stop and escalate when the budget is exceeded, instead of allowing shotgun edits to run away.
- Reproduce before fixing. On an error, rerun once to confirm it is reproducible, then find the root cause, then make the smallest change.
- Require a root-cause template. Before editing, the model should state the hypothesized cause, the evidence, and the minimal fix. That reduces blind trial and error.
- Keep prompts neutral. During evaluation, do not hint at external causes such as cache problems, and do not leak the expected answer. Measure real ability.
6. Notes on Evaluating Visual and Interactive Tasks
Demo tasks should not be judged from a screenshot alone. Check physical plausibility, such as whether collider gaps make sense; visibility, such as whether elements can be seen in a dark scene; logical correctness, such as whether a reinforcement-learning task actually converges; and the gap between the result and the claimed goal.
Community cases have included claims of an ink-wash style that was not present, interfaces so dark they were nearly unreadable, and agents misaligned with the terrain layer. Judging only the overall look overestimates the model.
Conclusion
Strong demo performance is exciting, but engineering value depends on reliability in a real codebase: accurate attribution, a closed verification loop, minimal changes, and convergence to passing tests. Rather than chasing showcase evaluations, build a benchmark from your own real tasks, use process metrics and failure reviews to find the model’s true limits, and use a strict execution framework to cover its weaknesses. That is the path from an impressive demo to a trustworthy delivery.
