LLM Code Generation Evaluation: How Benchmark Dimensions Evolved and What to Do in Practice

    As coding benchmarks saturate, single scores explain less about real engineering capability. This article breaks coding ability into four observable layers, examines the principles and limitations of three mainstream evaluation paradigms (real bug fixing, high-difficulty long-horizon changes, and terminal task execution), and shows how to build a reproducible internal eval set with automated pass criteria, contamination isolation, and an audited, sandboxed execution environment.

    1. Why a Single Benchmark Score No Longer Explains Real Engineering Capability

    Over the past two years, “how many points a model scored on a coding benchmark” has become the default yardstick for LLM engineering capability. But once mainstream models pushed their scores into a high range, that yardstick lost explanatory power: the gaps between scores shrank, while the gaps felt in actual usage did not shrink at the same pace. To understand this divergence, you first have to decompose “coding ability” into observable sub-abilities.

    In an engineering context, code capability has at least four layers:

    1. Local code generation: completing a function or snippet given a surrounding context.
    2. Defect localization and repair: reading an issue description in an unfamiliar repository, finding the root cause, changing code, and passing tests.
    3. Long-horizon changes: completing one task that spans multiple files, modifies a large amount of code, and keeps the whole consistent.
    4. Environment interaction: installing dependencies, running scripts, reading logs, and iterating repeatedly based on errors in a real terminal.

    The core reason benchmarks distort reality is that evaluation methods can only cover part of these layers, and the more shallowly a dimension is covered, the more easily it saturates.

    2. Three Mainstream Evaluation Paradigms: Principles and Limitations

    2.1 Real Bug-Fix Evaluation

    This type of evaluation was first proposed by a cloud vendor in 2023 and was long used as an industry standard. Tasks come from real issues and their corresponding merged pull requests in open-source repositories. Each sample includes a repository snapshot, a problem description, the pre-fix code, and test cases used for judgment. The model must locate the problem on its own, modify the code, and ultimately make the tests pass.

    Its key improvement is “manual screening”: the raw dataset contains samples with vague descriptions, flaky tests, and ambiguous pass criteria. After manual review and cleaning, about five hundred high-quality samples were kept, making results more stable and credible.

    But this kind of evaluation has two structural flaws. The first is a fragile judgment mechanism: the test cases themselves may misjudge a correct solution, and a functionally correct implementation can be marked as failing because the assertions are written too narrowly. The second is data contamination: repositories and fix records are public, so the model may already have seen the answers during pretraining, which means the score cannot distinguish “can fix bugs” from “memorized the answer.” When a cloud vendor announced it would no longer use this as a core evaluation standard, it effectively admitted one fact: a saturated score no longer has discriminative power.

    2.2 High-Difficulty Long-Horizon Change Evaluation

    As an alternative, the industry released a harder version in the second half of 2025, published by an evaluation organization. It has two design points:

    • Lower contamination risk: the public subset and the held-out subset use a strong copyleft license, reducing the chance that the data is absorbed directly into training corpora.
    • Higher task complexity: each task is required to change at least ten lines of code, and over a hundred tasks require changing more than a hundred lines.

    The direct result of raising difficulty is that score stratification reappeared: most models score below sixty, and only a very few top models exceed sixty. This shows that the value of an evaluation lies not in absolute high or low scores, but in whether it can pull capability differences apart again. At this point, if a model scores slightly below two domestic models, you cannot directly infer that its “engineering capability is weaker,” because long-horizon changes test context length, instruction following, and self-correction at the same time, and a shortcoming in any one of them lowers the total score.

    2.3 Terminal Task Execution Evaluation

    The third type of evaluation focuses on an agent’s real execution ability in a command-line environment. The task format is “give a goal and let the model decide what commands to type,” covering environment probing, dependency installation, script writing, log reading, retrying after failures, and result verification.

    The difference from the previous two types is a longer feedback loop: bug-fix evaluation is judged by external tests, while terminal tasks require the model to construct its own verification. This type most easily exposes the problem of “looks like it can write code but can’t get work done,” and it is closest to real enterprise scenarios.

    3. How to Build Your Own Evaluation Standard

    Relying on public leaderboards for technology selection is risky. A more reliable approach is to build an internal evaluation set. A suggested structure:

    1. eval_set:
    2. - name: bugfix-small # single file, single root cause
    3. weight: 0.2
    4. pass_criteria: unit_test
    5. - name: bugfix-cross-repo # cross-module, requires reading multiple docs
    6. weight: 0.3
    7. pass_criteria: integration_test
    8. - name: large-refactor # changes over a hundred lines
    9. weight: 0.2
    10. pass_criteria: regression_suite
    11. - name: terminal-task # must install dependencies and verify by itself
    12. weight: 0.3
    13. pass_criteria: script_exit_code

    When constructing tasks, follow three principles: task descriptions must come from real tickets rather than being invented; judgment must be automatable, preferring tests or script exit codes over manual scoring; and you must keep an undisclosed held-out subset to detect contamination and overfitting.

    For metrics, record pass rate, average number of interaction turns, time per task, and the distribution of failure types at the same time. Failure types carry more information than pass rate: if failures concentrate on “changes that violate constraints” and “missing verification steps,” the problem is instruction following; if they concentrate on “locating the wrong file,” context retrieval capability is insufficient.

    4. Implementation Recommendations

    When plugging evaluation results into the development workflow, a gradual strategy works well: pilot on low-risk tasks first, such as unit test completion, log summarization, and script migration; then expand to scenarios requiring cross-file changes, requiring all output to go through tests and human review; and only then open terminal execution permissions within a controlled scope, combined with container isolation, least-privilege accounts, and operation auditing.

    At the infrastructure level, general-purpose capabilities are enough: use a container platform to provide isolated execution environments, object storage to save task snapshots and artifacts, logging and monitoring with alerting to trace call chains and anomalies, and a message queue to smooth out peaks and carry batch evaluation tasks.

    The conclusion is clear: the marginal information of leaderboard scores is decaying fast. What really determines deployment results is a reproducible internal evaluation system, task design with automated judgment, and an execution environment with auditing and isolation. Shifting attention from “who is a few points higher” to “can my scenario run end to end” is the right way to evaluate LLM coding capability.