Evaluating LLM Coding Capabilities: Dimensions, Methods, and Model Selection Practices

    This article explains why a single overall score cannot capture a model's coding ability, breaks coding performance into six measurable dimensions, and compares three mainstream evaluation paradigms along with their limits. It also outlines how to build a small, trustworthy in-house benchmark with sandboxing, turn limits, and cost tracking, lists common weaknesses that evaluations must expose, and gives a practical selection and deployment workflow.

    1. Why a Single Overall Score Is Not Enough

    In engineering practice, the question “can this model write code?” can rarely be answered by one number. The same model may complete a single line of code fluently yet lose context during a cross-file refactor; it may score near-perfect on algorithm puzzles yet fail badly at dependency management, logging conventions, and exception handling in a real project. The reason is that coding is a bundle of composite abilities: syntax and semantic understanding, cross-file context reasoning, tool invocation and command execution, self-correction over long-horizon tasks, and adherence to an existing code style.

    Any responsible evaluation must therefore answer three questions first: which ability is being measured, which tasks are used to measure it, and how scoring avoids being polluted by “practicing to the test.” Only when these three points are clear are scores comparable.

    2. Breaking Down the Ability: Splitting “Coding” into Measurable Sub-items

    It helps to split coding ability into six dimensions, each mapped to a different task shape:

    1. Single-point generation: function-level completion, type signature inference, regex and SQL snippet writing.
    2. Cross-file understanding: locating the change points across multiple modules while keeping interfaces consistent.
    3. Terminal and tool use: constructing commands correctly, reading errors, and iterating on fixes.
    4. Long-context handling: retrieving key information from very large codebases or logs.
    5. Self-correction: adjusting the approach based on feedback after a failure instead of repeating the same mistake.
    6. Engineering convention compliance: whether naming, comments, error handling, and test coverage meet the bar.

    An illustrative scoring table can be organized like this:

    1. Dimension Weight Task sample Scoring method
    2. Single-point generation 0.15 Function completion/type infer. Unit test pass rate
    3. Cross-file understanding 0.20 Small change across modules Human + static checks
    4. Terminal and tool use 0.25 Automated repair of failed build End-to-end pass rate
    5. Long context 0.15 Locating anomalies in long logs Key-info recall rate
    6. Self-correction 0.15 Two rounds of feedback Convergence steps
    7. Engineering conventions 0.10 Code review Rule hit count

    Weights should shift with the scenario: an AI coding assistant cares more about tool use and self-correction, while code Q&A cares more about long context and cross-file understanding.

    3. Mainstream Evaluation Methods: Where Each of the Three Paradigms Fits

    The first type is the composite intelligence index. It aggregates knowledge, reasoning, math, code, and other task categories with weights. Its strengths are horizontal comparability and fast updates; its weakness is that it dilutes coding ability. A model ranked fourth overall may well score higher on the front-end generation sub-item than a closed-source model with a higher total score. Such leaderboards are suitable for initial screening, not for final decisions.

    The second type is terminal-style task benchmarks. They simulate a real workflow: given a repository and a failing goal, the model must explore on its own, run commands, read errors, modify code, and verify again. Compared with static problems, they better reflect whether the work can actually be finished. Looking at public progress, a relative improvement of more than 20% between generations of the same model on such benchmarks is common, which shows that tool use and iterative repair are trainable, optimizable directions.

    The third type is community blind tests and hands-on field testing. Blind tests (pairwise comparison, anonymous voting) capture subjective experience, such as whether a generated front-end interface looks good and whether the interaction makes sense; field testing covers real enterprise code styles, private dependencies, and internal conventions. Together, their value lies in exposing what leaderboards cannot measure.

    4. How to Design a Trustworthy In-house Test

    Do not copy public scores directly. Build a small benchmark of 30–50 tasks, following this flow:

    1. # Pseudocode: a reusable evaluation loop
    2. cases = load_cases("my_repo_tasks.jsonl") # each case has a repo snapshot, goal, and verify script
    3. for c in cases:
    4. for model in candidates:
    5. r = run_in_sandbox(model, c, max_turns=6, tools=["shell","file"])
    6. score = c.verify(r) # unit tests / static checks / human review
    7. record(model, c.id, score, turns=r.turns, tokens=r.tokens)
    8. report(aggregate()) # pass rate, average turns, cost

    Four constraints are critical. First, sandbox isolation, so the model cannot modify the real repository. Second, a cap on interaction turns, to observe convergence speed rather than unlimited retries. Third, record both pass rate and resource consumption, to avoid “high cost in exchange for a high score.” Fourth, keep human-reviewed samples, in case the verification scripts themselves have holes.

    5. Common Weaknesses That Evaluations Must Expose

    • Decay in effective utilization of long context: a nominal million-token window does not mean stable recall deep inside it, so key information should be planted at different positions for localization tests.
    • Plan drift on very long tasks: as turns increase, the model tends to drift from the original goal, which requires an explicit task list and stage-by-stage checks.
    • Ecosystem and toolchain fit: differences in commands, package managers, and build scripts significantly affect success rates, and this part is often ignored by leaderboards.
    • Conventions and maintainability: passing tests does not mean maintainable; duplicated code, missing error handling, and absent tests are frequent problems.
    • Reasoning tiers and cost: higher reasoning tiers bring gains but also higher latency and cost, so routing should be tiered by task.
    • Licensing and compliance: whether the weights are commercially usable and whether private deployment is allowed directly determine whether they can enter production.

    6. Selection and Implementation Recommendations

    Step one, use a composite index for initial screening and keep 3–5 candidates. Step two, use terminal-style benchmarks to assess “completeness.” Step three, use your own small benchmark for the final decision, with weights tilted toward the business. Step four, set up tiered routing: simple completion goes to a low-latency tier, complex refactoring goes to a high-reasoning tier. Step five, maintain a regression set and run it after every model or prompt change to prevent capability regression.

    On deployment shape, if private code is involved, prefer open-weight options that can be privately deployed under permissive licenses, paired with object storage for build artifacts, a container platform to host sandboxes, and logging services plus monitoring and alerting to trace call chains and failure rates. Baidu AI Cloud can provide general engineering capabilities in these areas, helping teams solidify the evaluation loop into their daily development workflow.

    The conclusion is straightforward: leaderboards are for ruling out clearly unsuitable options, and in-house testing is for confirming the genuinely suitable one. Splitting evaluation into dimensions, turning tasks into a closed loop, and folding cost into the metrics is what makes model selection reusable.