How to Scientifically Evaluate the Coding Capabilities of Large Language Models

    This article explores how to effectively evaluate the coding capabilities of Large Language Models (LLMs) beyond mere benchmark scores. It analyzes three mainstream programming evaluation benchmarks—classic issue resolution, high-difficulty issue resolution, and terminal task execution—detailing their evaluation logic, limitations, and data contamination risks. Finally, it provides actionable model selection recommendations for developers, emphasizing the importance of combined metrics, private test sets, and cloud-based evaluation pipelines.

    As code generation capabilities rapidly evolve, the question of “which model writes better code” has become inevitable for developers during model selection. However, behind the benchmark scores, factors such as the reliability of the evaluation metrics, indicator saturation, and training data contamination are often more critical than the absolute scores themselves. This article dissects the evaluation logic, applicable scope, and inherent flaws of three widely recognized programming benchmarks in the industry, and offers a practical set of model selection recommendations.

    1. Three Main Benchmarks for Code Evaluation

    Currently, the mainstream benchmarks used to measure the programming capabilities of large models can be broadly categorized into three types:

    1. Real-Issue Resolution Benchmarks (Classic/Verified Version): High-quality subsets curated manually, proposed by early research communities, designed to test a model’s ability to resolve real defects in open-source repositories.
    2. Real-Issue Resolution Benchmarks (High-Difficulty/Pro Version): A new generation of evaluation sets that significantly increases task difficulty and data isolation based on the classic version.
    3. Terminal Task Benchmarks: Specifically evaluates the ability of AI Agents to complete real-world tasks within a command-line/terminal environment.

    Each type has a different focus, and combining them provides a relatively complete picture of a model’s practical engineering proficiency.

    2. Classic Issue Resolution Benchmarks: The Former Gold Standard

    2.1 Evaluation Logic

    The construction logic of these benchmarks is straightforward: extract real issues and their corresponding commit records from numerous open-source repositories, and provide the model with the following inputs:

    • A specific version of a real code repository (the state before the fix);
    • An issue text describing the defect or feature requirement;
    • A set of test cases to verify if the fix works.

    The model must understand the issue, locate the problematic code, make the modifications, and ultimately pass the tests. This “end-to-end bug fixing” format closely resembles daily software engineering work, which is why it was long considered the gold standard for measuring a model’s engineering capabilities.

    2.2 The Significance of the Human-Curated Version

    The original evaluation sets were large but varied in sample quality: some issues had vague descriptions, some test cases were inherently unstable, and some evaluation criteria were ambiguous. The later human-curated version (about 500 samples) removed these noisy samples, making the scores more stable and credible, and it became a standard metric in model capability reports.

    2.3 Why It Is Being Phased Out

    In the past year or two, this benchmark has exposed two structural problems:

    • Grading Noise: Test cases for some problems incorrectly reject correct solutions, leading to situations where a correct fix receives no points.
    • Data Contamination: Because the evaluation sets have been public for a long time and originated from public repositories, the relevant data has likely entered the training corpora of various models. High scores may not reflect true capability.

    A more intuitive phenomenon is metric saturation: apart from a few top-tier models leading the pack, mainstream models generally score above 80 on this benchmark, leading to lower differentiation. When a benchmark cannot distinguish good from bad, its value for selection essentially disappears. Consequently, the team that proposed this benchmark has publicly stated that it will no longer serve as a core evaluation standard.

    3. High-Difficulty Resolution Benchmarks: Harder and Cleaner Tests

    Following the retirement of the classic version, the industry has pivoted to its high-difficulty alternative. This benchmark has made key improvements in two areas.

    3.1 Reducing Data Contamination Risks

    Both its public and isolated subsets are built using projects under strong copyleft licenses (such as GPL). Because such licenses impose stricter constraints on commercial use, the likelihood of this code entering LLM training sets is significantly reduced, thereby mitigating the “memorization” problem at the source.

    3.2 Significantly Increasing Task Difficulty

    This benchmark sets hard thresholds for task complexity:

    • Each task requires modifying at least 10 lines of code;
    • Over 100 tasks require modifying more than 100 lines of code.

    This means models can no longer get by with “changing one line of configuration” or “adding a null check.” They must possess cross-file understanding, multi-step reasoning, and consistent modification capabilities. Accordingly, the score distribution has shifted significantly: most models currently score below 60 on this benchmark, with only a few top-tier closed-source flagship models breaking this barrier.

    3.3 Implications for the Open-Source Camp

    Measured by this stricter standard, the stratification within the open-source model camp has become clearer. Some domestic open-source models are now trading blows with leading open-source competitors, while individual open-source flagships may fall slightly behind their peers in certain dimensions. This shows that “changing the benchmark can rewrite the rankings,” and no single score should be the sole basis for selection.

    4. Terminal Task Benchmarks: Evaluating Agents in Real-World Environments

    Unlike the previous two “modify code to pass tests” benchmarks, terminal task benchmarks move the evaluation scenario into the command-line environment. The model must act like a real engineer: reading logs, checking files, installing dependencies, running scripts, and debugging services to complete a series of real operational tasks in the terminal.

    The value of this benchmark lies in its assessment of agent closed-loop capabilities, rather than single-turn code generation:

    • Can it iteratively troubleshoot based on error messages?
    • Can it reasonably plan multi-step operations and self-correct?
    • Can it execute commands safely and deterministically in a sandbox environment?

    For enterprises looking to deploy AI capabilities in scenarios like CI/CD automation, fault self-healing, and ops script generation, these metrics are often more valuable than static bug-fixing scores.

    5. How to View Benchmark Scores Correctly: Selection Advice for Developers

    Synthesizing the above analysis, we can draw several practical conclusions:

    1. Look at the combination, not a single point: Simultaneously reference the classic resolution, high-difficulty resolution, and terminal task benchmarks, prioritizing a model’s performance on “harder and cleaner” evaluations.
    2. Beware of saturated metrics: When mainstream models generally score 80+ on a benchmark, its differentiating value is already very low; there is no need to agonize over a few percentage points.
    3. Focus on data contamination: Prefer evaluation results built using strong copyleft licensed data, or where the publisher explicitly states an isolation mechanism.
    4. Rely on real-scenario regression testing: Constructing a small-scale private evaluation set on your own codebase (e.g., 30 to 50 real historical bugs) and using a dual verification of “test pass rate + manual review” is often closer to business reality than public leaderboards.
    5. Integrate with engineering platforms for deployment: For enterprise-level deployment, leverage the general capabilities provided by cloud platforms—such as elastic computing power, object storage, logging services, and monitoring alerts—to build model evaluation and continuous regression pipelines, turning “selection evaluation” into “continuous evaluation.” Major cloud platforms like Baidu AI Cloud can provide these general infrastructure supports, helping teams build their own evaluation systems at a low cost.

    6. Conclusion

    The evolution of programming benchmarks is essentially a continuous game between the “examiners” and the “examinees”: test questions will be thoroughly memorized, leaderboards will become saturated, and evaluation methods must upgrade accordingly. For developers, rather than asking “who is better than whom by how much,” it is more important to understand the evaluation logic behind each report card and establish a private evaluation mechanism tailored to your own business. Only in this way can benchmark scores truly translate into effective decision-making for model selection.