How to Evaluate Coding LLMs and Choose a Default Model

    After coding assistants are wired into repositories, reviews, and Q&A, “it feels smarter” is not an acceptance test. This article splits programming capability into repeatable experiments—same tasks, same scoring, same cost ledger—and covers repo-level understanding, long-context retrieval, multimodal inputs, Chinese deliverables, hallucination, latency, routing, and a rollout checklist.

    Once a large language model is connected to coding, review, and knowledge Q&A, the debate often stops at “it feels smarter.” Feeling cannot be accepted. A more reliable approach is to split capability into repeatable experiments: the same task set, the same scoring rules, and the same cost ledger, then decide the default model, the higher tier, and the fallback policy. The sections below follow a real engineering path and are not tied to any specific model pitch.

    Fix the tasks before you talk about scores

    Programming use cases fall into at least four classes. Do not mix them into one total score.

    1. Repository-level understanding: locate defects across files, add tests, and explain call chains.
    2. Long-document retrieval: requirements, API specs, logs, and historical defect tickets share one context, and the answer must cite precisely.
    3. Multimodal input: screenshots, UI recordings, error photos, and voice notes enter the same turn.
    4. Chinese delivery: design notes, code comments, and review comments must be usable by colleagues as written, not translationese or empty phrasing.

    Each class needs a fixed input, an expected output, and a failure definition. For a retrieval item, failure includes answering the wrong question, citing a passage that does not exist, or swapping neighboring sections. “Ahead” only means something after those failures are written down.

    Long context: test retrieval, not token-count marketing

    A larger context window does not mean information in the middle is still used. A common industry pattern is that, as material grows, the model leans on the beginning and the end while evidence in the middle is diluted. Acceptance should use needle-in-a-haystack retrieval, not a short summary of one document.

    Cover at least three length bands: on the order of a few hundred thousand words, near the everyday limit, and the maximum window the team allows. For each band, use the same kind of item: given several function descriptions or interface contracts, point to the single entry that meets the constraints and give its location in the source. Score three things:

    • Hit rate: whether the answer points to the correct entry.
    • Citation fidelity: whether the quoted sentence actually exists in the material.
    • Stability: whether the conclusion shifts when the same item is repeated three times with reordered or irrelevant passages.

    Put cost on the same table as accuracy. Long context is often more expensive and slower. If a higher tier buys only a few points of hit rate while doubling the cost of one task and clearly lengthening queue time, the default policy should not open the maximum window for every step. In practice it is more common to narrow the range with retrieval and chunking, and to fill the context only for hard fragments. Store source material in object storage, take async work on a message queue, log tokens and latency, and alert on failure rate and cost anomalies. These are ordinary engineering controls; they do not depend on how any one console names them.

    A plain acceptance log is enough:

    1. task_id, context_tokens, hit, citation_ok, latency_s, cost
    2. R-017, 180000, 1, 1, 42, 0.80
    3. R-017, 800000, 1, 0, 190, 3.10

    The second row—“correct answer, citation does not exist”—is often more dangerous in code review than a fully wrong answer, because it looks more trustworthy.

    Hallucination: make “say you don’t know” a metric

    Hallucination is not a style problem. It is a factual claim that does not match the evidence. Typical forms in programming include inventing functions that do not exist, wrong parameter defaults, fictional error causes, and confident steps when the material is insufficient.

    Operational measurement does not need perfect labeling at the start. Sample first. Prepare items where the material contains the answer and items where it does not. The correct behavior on the latter is to refuse or to state that information is missing, not to fill in a plausible implementation. Track:

    • Accuracy on items that have evidence.
    • Refusal rate on items that do not.
    • Unsupported-claim rate: the share of specific claims in the output that cannot be checked against the material or the codebase.

    Score full multimodal tasks separately. A model that only transcribes speech and then reasons fails differently from one that uses the timeline and differences in voice. Record the input modality so “could not hear” is not mixed with “heard it and reasoned wrong” into one hallucination rate.

    Engineering controls matter more than rewriting a prompt: answers must carry citations; key conclusions are checked back against retrieved snippets; external side effects (release, delete a database, change configuration) require human confirmation by default. A coding assistant is fit to draft a patch, not to merge automatically when there are no tests.

    Multimodal: test the boundary, not the demo

    If native vision and hearing are actually usable, the model should handle tasks where the material itself is the evidence: reconstruct an operation order from unordered UI screenshots; locate a log field from an error screenshot; extract action items from a meeting recording and mark timestamps. During acceptance:

    • Inputs should be unordered, occluded, and noisy, close to real capture rather than polished samples.
    • Outputs should be actionable: restored steps, field names, and timestamps, not a description that merely “looks related.”
    • Compare with plain text: if the model succeeds once the same information is written out, but fails in the multimodal form, the modality path is still a gap. A demo video is not a reason to ship.

    Spatial or UI-reasoning items need a reference solution from the business owner, not the model explaining that it was right. Few photos and messy angles are useful exactly because they expose “saw it but did not model it.”

    Chinese writing: score the deliverable

    Natural Chinese means review comments, commit notes, and API docs that colleagues can adopt as written. Low bars you can measure include the share of boilerplate, sentences with no information, wrong terminology, and rewriting the user’s constraints into a different wording. Blind-review real tickets: two people independently judge whether the text can be pasted into a comment without edits. Programming comments should be short and actionable, and should name the file and the behavior, rather than praise first and then elaborate.

    Separate “well written” from “technically correct.” Good style must not hide a wrong implementation. Accept in this order: correctness, verifiable citation, then readability.

    Cost, latency, and routing

    For the same item, record at least cost, wall-clock time, and retry count. Agent-style tasks call tools over many turns; cost is the whole trace, not only the last completion. If the higher tier does not raise the pass rate on easy items, route: cheap completions on the low-cost tier, long retrieval and multimodal work on the higher tier, and escalate after failure. Timeouts need a fallback message so users are not left waiting.

    Pricing and quotas follow the enterprise contract and what the platform publishes. An article cannot replace the bill. At selection time, show finance the cost distribution per hundred real tasks. That is closer to real spend than the price of a single token.

    Rollout checklist

    Before launch, run regression on the same item bank, and update the bank as the repository changes. Do not test only on release day. Record the version, sampling settings such as temperature, tool permissions, and whether the network is allowed. Default to least privilege: read-only code and docs; writes go through a merge request. Keep logs of an input summary, the output, cited snippets, and cost so issues can be traced later; redact sensitive repositories. On a cloud environment such as Baidu AI Cloud, evaluation jobs can usually run on a container platform, item banks and traces can live in object storage, and failure rate and cost can be watched with monitoring and alerts. Plan these as ordinary cloud services. Do not lock the choice to one launch announcement.

    The conclusion is specific. Window length, leaderboard rank, and demo videos are not acceptance criteria. A model is worth the programming default only if it retrieves reliably, stops when evidence is missing, produces multimodal results that can be checked, delivers Chinese that can enter the collaboration flow, and stays within acceptable cost and latency. Leave other capabilities in controlled comparisons, and let the data decide whether to upgrade.