How to Evaluate Coding and Agent Capabilities in Large Language Models
A practical framework for evaluating coding agents beyond benchmark scores, covering correctness, stability, long-horizon task completion, maintainability, total cost, verifiable rewards, and the infrastructure required for reliable production use.
1. Why a Few Benchmark Problems Are Not Enough
When a new model is released, the most common response is to run it against a set of public problems and label it “strong” or “weak.” The problem is not necessarily the problems themselves. It is that this approach compresses a high-variance, long-horizon, context-dependent process into a series of isolated question-and-answer interactions.
Real-world coding work typically follows a chain:
Understand the requirement → locate the relevant code → propose a change → generate a patch → run validation → iterate based on errors.
Each step has its own probability of failure, so the overall success rate is the product of the conditional probabilities across the entire chain. Whether a model passes an isolated task reveals very little about this cumulative effect.
For this reason, the basic unit of evaluation should not be a single model call. It should be a complete task completed in a real repository.
2. A Practical Five-Dimensional Evaluation Framework
Evaluation should be divided into five independent dimensions so that each can be measured and attributed separately:
- Correctness: Does the patch actually solve the problem, rather than merely making tests pass through evasive tactics such as deleting assertions or commenting out test cases?
- Stability: How much do results vary when the same task is repeated? This is the first constraint on whether an agent can be used in production.
- Long-horizon completion: Can the agent preserve the original objective during tasks that require multiple tool calls and changes across several files?
- Maintainability: Does the generated code follow the project’s conventions for style, naming, and layering? Does it introduce unnecessary abstractions?
- Total cost: What is the combined cost of token usage, execution time, and human rework, rather than the model’s unit price alone?
The second dimension is often overlooked, but it is one of the most important. A model with a slightly lower average pass rate but very low variance may be more useful in engineering than a model that occasionally produces exceptional results but frequently fails unpredictably.
The latter makes the entire automation pipeline difficult to operate and can increase the cost of human fallback.
3. Why Stability Matters More Than the Average Score
In an automated pipeline, the output distribution determines the complexity of the surrounding system. If a task succeeds seven times out of ten, the pipeline needs built-in retries, state rollback, and failure isolation. If success and failure follow a long-tail distribution with no clear explanation, debugging costs can quickly consume the benefits of automation.
In practice, repeated sampling and pass-rate distributions are more informative than a single result:
# Example: measure stability through repeated sampling rather than a single resultdef evaluate(task, model, n=10):results = []for _ in range(n):patch = model.generate(task.prompt)ok = sandbox.run_tests(task.repo, patch) # Run in an isolated environmentresults.append(ok)pass_rate = sum(results) / n# Focus on variance and worst-case behavior, not only the meanreturn {"pass_rate": pass_rate, "worst_case": min(results)}
Acceptance thresholds should be derived from the business’s tolerance for failure. If one round of human review costs C, adoption is worthwhile only when the cost of failures, calculated as the failure rate multiplied by C, is lower than the labor savings generated by automation.
4. The Post-Training Loop: The Real Source of Capability Growth
The rapid improvement in coding capabilities over the past year has come less from parameter scale alone and more from the maturity of post-training methods. At the center of this progress is verifiable reward.
Code and mathematics have a property that is relatively uncommon in other domains: answers can often be evaluated automatically. Whether code compiles, whether unit tests pass, and whether static checks report errors are all natural, inexpensive, and relatively difficult for a model to manipulate.
This creates a feedback loop:
- The model generates a candidate solution.
- The solution runs in an isolated sandbox.
- Execution results are used as reward signals.
- Reinforcement learning updates the model’s strategy.
- Failed examples receive targeted improvement.
Once this loop is established, data generation shifts from manual annotation toward environment-generated feedback, which can significantly accelerate iteration. Without reliable execution feedback and sandbox infrastructure, teams often remain limited to imitation learning, and capability growth quickly reaches a ceiling.
For users, the practical takeaway is that a model’s long-term potential should be judged by whether it improves consistently on private repositories, not only by its position on public leaderboards.
5. A Methodology for More Than One Week of Real-World Use
Short-term evaluations rarely reveal the problems that emerge during sustained use. A useful evaluation process can follow this schedule:
- Days 1–2: Establish a baseline. Select 10–20 real historical bugs and feature requests from your own codebase to create a private evaluation set. These tasks already have known solutions and reflect your technology stack.
- Days 3–4: Observe the long tail. Record the type of every failure, such as misunderstanding the requirement, losing context, violating project conventions, or hallucinating an interface. Failure categories often provide more insight than failure counts alone.
- Days 5–7: Quantify stability and cost. Repeatedly sample the baseline tasks and measure pass-rate distributions, average interaction rounds, and human rework time.
An illustrative task record might look like this:
{"task_id": "issue-1024","attempts": 10,"pass_rate": 0.8,"failure_types": {"context_loss": 1, "spec_violation": 1},"avg_turns": 6,"human_rework_minutes": 4}
6. Infrastructure Required for Production Use
Model capability is only half of the equation. The other half is the infrastructure built around it:
- Isolated execution environments: Use containers or similar infrastructure to provide a clean, disposable sandbox for each generation. This prevents changes from contaminating the main branch or dependency cache.
- Logging and observability: Record prompts, tool calls, and execution output in full. Logs, monitoring, and alerts are essential for quickly identifying the cause of failures.
- Artifact storage: Store large artifacts such as patches and test reports in object storage, indexed by task ID for review and regression analysis.
- Message-queue decoupling: Run long-horizon tasks asynchronously to prevent synchronous calls from blocking the main workflow while gaining retry capabilities by design.
7. Common Mistakes
- Replacing private scenario validation with public leaderboard rankings, while ignoring differences in technology stacks and coding conventions.
- Looking at a single successful example while ignoring variance and worst-case behavior.
- Treating “tests passed” as equivalent to “the requirement was satisfied,” without checking for evasive patches.
- Selecting a model based on unit price instead of total cost.
8. Conclusion
Evaluating a coding agent ultimately means evaluating whether it can reliably complete long-horizon tasks within your codebase, engineering conventions, and cost constraints.
A credible evaluation should move beyond “run a few problems” and use a combination of:
- A repeated-sampling private evaluation set
- Failure-type attribution
- Total-cost analysis
The long-term capability ceiling depends on whether the team can build a post-training loop centered on verifiable rewards. That feedback loop is the structural reason coding and agent capabilities can continue to improve.
