Evaluating LLM Code Capabilities: A One-Week Hands-On Methodology
This article presents a practical methodology for evaluating the coding capabilities of large language models over a sustained period rather than through a single benchmark run. It explains why short evaluation sets fall short, outlines three core dimensions—stability, long-horizon task completion, and the maturity of the post-training loop—and provides a task design and evaluation workflow with a repeatable verification script. Readers will learn how to build a machine-verifiable evaluation pipeline that reflects real engineering work.
1. Why Running a Few Benchmark Problems Is Not Enough
As model capabilities iterate at a rapid pace, many teams still select models by running a few dozen algorithm problems and checking the pass rate. The problem with this approach is that the problems overlap heavily with the training distribution, so results are easily inflated by memorization. In addition, real development work is not a single-turn question-and-answer exchange; it is a multi-turn loop that includes requirement understanding, code retrieval, cross-file modification, runtime debugging, and error rollback. A high score on an isolated problem cannot represent how usable a model is on long-chain tasks.
A more reasonable approach is to let the model work continuously on a real project for a period of time (typically no fewer than five working days) and observe its performance under fully unattended and semi-attended conditions. The evaluation target should not be limited to “whether the generated code snippet is correct,” but should be “whether the task is reliably driven to a deliverable state.”
2. Three Core Evaluation Dimensions
2.1 Stability: A Lower-Bound Metric That Matters More Than Peak Capability
Engineering adoption focuses on the lower bound rather than the upper bound. If the same task is executed repeatedly and the results swing widely between “fully passing” and “completely failing,” then even a decent average performance makes it hard to bring into a production workflow. It is recommended to repeat execution on a fixed task set and measure the distribution of success rates and failure modes, for example:
- Task success rate: the proportion that runs and passes validation;
- First-pass rate: the proportion completed without manual rework;
- Variance metric: consistency of results across multiple runs;
- Failure type distribution: compilation errors, missing dependencies, logic deviations, out-of-scope changes, and so on.
2.2 Long-Horizon Task Completion: Whether the Model Can Finish the Job
Real requirements are often “add a medium-complexity feature to an unfamiliar codebase.” During evaluation, observe whether the model exhibits the following behaviors: locating relevant modules before making changes, modifying with a minimal-change principle, proactively running tests, iteratively fixing issues based on errors, and clearly stating the blocking point when it cannot resolve something. Being able to summarize the task boundary in one sentence and provide verifiable completion criteria is an important sign of mature long-horizon capability.
2.3 Maturity of the Post-Training Pipeline: Whether Capability Improvement Is Sustainable
Good performance in a single run may be accidental; what really matters is whether a stable post-training loop has formed behind it: task environment construction, automatically determinable reward signals, failure sample feedback, and iterative regression validation. If this pipeline is complete, capability improvements in subsequent versions are usually predictable; otherwise, it is easy to see a pattern of “strong in this generation, fluctuating in the next.”
3. A Practical Evaluation Plan
Task Set Design Principles
- Realism: real issues or requirements from your own codebase;
- Verifiability: equipped with automated validation means, such as unit tests, static checks, and build artifact validation;
- Layering: divided into three tiers by change scope—single-file, cross-file, and cross-module;
- Isolation: tasks are offset in time from training data to reduce memorization interference.
Metrics and Workflow
It is recommended to fix the workflow as: task dispatch → autonomous model execution → automated validation → manual spot checks → result archiving. Illustrative code is as follows:
def evaluate(task, model_client, repeat=5):results = []for _ in range(repeat):patch = model_client.solve(task.prompt, repo=task.repo)ok, detail = task.verify(patch) # build + unit tests + static checksresults.append({"ok": ok, "detail": detail})success = sum(r["ok"] for r in results) / repeatreturn {"success_rate": success, "raw": results}
The key is that verify must be machine-verifiable; otherwise, the evaluation degrades into subjective personal impressions.
4. Common Pitfalls and Conclusion
Pitfalls include: looking only at leaderboard rankings, testing only once, testing only algorithm problems, and using generation speed as a substitute for completion quality. A more pragmatic conclusion is: when evaluating coding agents, treat “stability” and “long-horizon completion” as the primary metrics, and treat “whether the post-training loop is complete” as the basis for judging long-term potential. For enterprise users, the framework above can be combined with the general capabilities provided by Baidu AI Cloud—for example, using a container platform to host isolated execution environments, using object storage to archive evaluation artifacts, and using logging services and monitoring alerts to track success rate fluctuations—thereby turning a one-off evaluation into a continuously running quality system.
