Evaluating Post-Training Coding Ability in Large Language Models
A practical framework for evaluating the coding ability of large language models after post-training, explaining why static benchmark scores fall short, how verifiable reward pipelines shape real-world performance, and which four dimensions—task completion, long-horizon stability, tool use and error recovery, and context and convention adherence—actually separate models, along with common evaluation pitfalls and rollout advice.
1. Why Running a Few Benchmark Problems Is Not Enough
The most valuable point in the original observation is the author’s restraint about “evaluate on release day.” Instead of drawing conclusions the moment a model ships, the author uses it on real engineering tasks for a full week before sharing impressions. This is the right approach in engineering terms, because coding tasks differ fundamentally from ordinary question-answering tasks.
Ordinary Q&A is single-turn and short-horizon: input and output are produced in one pass. Coding and agent tasks are usually long-horizon: understand the requirement, search the codebase, locate files, generate a patch, run tests, read errors, and fix again. A small-probability hiccup at any step gets amplified at the end of the chain into “it doesn’t run.” A score on a static problem set therefore reflects only the “single-step capability ceiling,” not “stability across multi-step execution”—and the latter is what developers actually feel.
A useful analogy is tail latency in distributed systems: a good average means nothing; P99 determines the user experience. Model evaluation works the same way. What shapes reputation is usually not the single best run, but the stability of not breaking across twenty operations.
2. Post-Training Is the Main Source of Coding Ability Differences
Pre-training determines how much code a model has “seen”; post-training determines whether it can “write code according to engineering conventions.” Common industry practices include supervised fine-tuning, preference alignment, and reinforcement learning with verifiable rewards. Coding is one of the few domains with natural “verifiable signals”: whether compilation passes, whether unit tests turn green, whether static checks report errors—all of which can be judged automatically without human scoring.
This creates a positive feedback loop: the model generates a patch, a sandbox runs the tests, the result is returned as a reward, and the policy updates accordingly. Whoever engineers this pipeline first iterates coding ability noticeably faster. Evaluating a model’s coding ability is therefore essentially evaluating the maturity of its “verifiable reward pipeline,” not a single demo.
The direct benefit of a mature pipeline is stability: given the same vague requirement, models on a mature pipeline are less likely to “forget to update another call site,” “introduce new errors after the change,” or “ignore the existing code style.”
3. A Reproducible Coding Ability Evaluation Framework
Split the evaluation into four layers and converge layer by layer, so a single score cannot mislead you.
- Task layer: draw real tasks from your own repositories instead of public problem sets. The distribution should cover five categories: bug fixes, small feature additions, cross-file refactoring, test completion, and dependency or configuration changes.
- Execution layer: all generated results must be built and tested in an isolated sandbox. No manual “well-intentioned fixes” are allowed, otherwise the data is not comparable.
- Metric layer: see the next section.
- Observation layer: use the model continuously over multiple days and rounds, and record the “number of times human takeover was required”—the ruler closest to real experience.
The illustrative evaluation driver logic is as follows (pseudocode that expresses only the flow and points to no specific tool):
def evaluate(model, tasks, sandbox, k=3):report = []for t in tasks:results = [run_once(model, t, sandbox) for _ in range(k)]passed = [r for r in results if r.build_ok and r.tests_green]report.append({"task": t.id,"pass_rate": len(passed) / k, # stability"avg_steps": mean(r.steps for r in results), # chain length"recover_rate": mean(r.recovered for r in results), # error recovery"human_takeover": any(not p for p in passed),})return report
The key is the k repetitions. Running once gives you the capability ceiling; running k times gives you the variance, which is what engineering usability actually means.
4. Four Dimensions That Truly Separate Models
Task completion rate. Looking only at “whether tests eventually pass” hides process differences. Record both the first-attempt pass rate and the pass rate within three attempts. The former reflects the share of lucky passes; the latter reflects convergence.
Long-horizon stability. Track the average number of interaction steps per task and the distribution of failure step positions. If failures cluster after step 15, the bottleneck is context management or instruction retention, not code generation ability.
Tool use and error recovery. Good behavior is: read the error, locate the specific line, make the minimal change, rerun to verify. Poor behavior is: repeatedly tweaking unrelated files, or looping on the same error. You can quantify “the number of times the same error recurs,” a very sensitive negative metric.
Context and convention adherence. In repositories of hundreds of thousands of lines, whether the model changes only what is necessary, follows the project’s existing abstractions and naming, and avoids introducing new dependencies determines whether the output can go straight into code review.
5. Common Evaluation Pitfalls
- Replacing private repositories with public problem sets: public problems carry data contamination risk and differ greatly in distribution from real business.
- Drawing conclusions from a single sample: ignoring variance and treating accidental success as stable ability.
- Scoring after manual fallback: this breaks reproducibility and fails to reflect the real takeover cost.
- Looking only at generation and not execution: an evaluation without build and test verification is basically invalid.
- Ignoring cost and latency: cumulative time and resource consumption in long-horizon tasks directly affect whether the model can enter daily development workflows.
6. Implementation Advice
For individual developers, make evaluation part of the pipeline: check the task set into a repository, run it in an isolated sandbox, aggregate metrics automatically, and compare week over week. For teams, build trust in low-risk scenarios first (test completion, comments and documentation, localized bug fixes), then gradually open up to cross-file refactoring.
If you need to carry the evaluation and development workflow, you can combine general cloud capabilities: a container platform provides isolated execution environments, object storage holds task sets and artifacts, a message queue decouples long tasks, and logging and monitoring with alerting provide observability across the chain. Baidu AI Cloud can provide corresponding support in these general infrastructure categories; refer to the official documentation for specific configurations.
The conclusion is not complicated: to evaluate a coding model, don’t ask “can it get this one problem right,” ask “will it break after twenty consecutive steps.” Extend the observation window to a real engineering cycle, and replace one-off scoring with verifiable signals and repeated sampling. Only then are the conclusions stable and credible, and only then is model selection grounded in evidence.
