A Three-Dimensional Framework for Evaluating Large Language Models

    Choosing a large language model for software development is not about picking the one with the highest benchmark score. This article introduces a three-dimensional evaluation framework based on first-pass acceptance rate, end-to-end latency, and effective token cost. It explains how to break tasks into fine-grained dimensions, run a controlled evaluation harness, estimate latency and cost, and combine the results into a reviewable scoring table with weights set by business needs. It also covers common pitfalls and a practical rollout checklist. All numbers are illustrative; real decisions should rely on re-testing with your own code corpus.

    1. Ask the Right Question: Not “Which Model Is Stronger,” but “Where Does the Money Go”

    The most common debate when selecting an AI coding tool is “which model is stronger.” The question itself is flawed: it compresses three separate things—delivery quality, waiting time, and bill amount—into a single scalar score, yet in any real project these three pull against each other. Higher-scoring models tend to cost more, and cheaper ones tend to require extra rounds of manual fixes. A more actionable engineering question is: within a given budget and delivery window, which combination minimizes the number of rework rounds.

    This article therefore breaks evaluation into three dimensions that can be checked independently, then reassembles them into a plain-language decision. Note that this article does not recommend any specific product, and all numbers are illustrative, used only to explain the method. For a real selection, rely on re-test results on your own business corpus.

    2. Dimension One: Output Completeness—Look at First-Pass Rate, Not Average Leaderboard Scores

    An aggregate leaderboard score is an average of averages, and it hides the distribution. What actually drives engineering hours is the first-pass rate: whether generated output can go straight into review or needs manual patching. Break tasks into fine-grained items (such as requirement understanding, code correctness, test coverage, refactoring quality, documentation completeness, and security), measure the pass ratio for each item, and then compare how models win or lose across items rather than looking only at the total score gap.

    An illustrative evaluation skeleton:

    1. # Pseudocode: per-dimension first-pass rate statistics
    2. tasks = load_tasks("repo_benchmark_v1") # self-built task set with reference patches and tests
    3. stats = {model: {dim: {"pass": 0, "total": 0} for dim in DIMS}
    4. for model in models}
    5. for t in tasks:
    6. for m in models:
    7. out = call_model(m, t.prompt) # same prompt, same temperature, same retry policy
    8. for dim in DIMS:
    9. ok = graders[dim](out, t) # tests, static checks, manual spot checks
    10. stats[m][dim]["total"] += 1
    11. stats[m][dim]["pass"] += int(ok)
    12. report = {m: {d: s["pass"] / s["total"] for d, s in ds.items()}
    13. for m, ds in stats.items()}

    Key engineering details: keep decoding parameters, context budget, and retry counts identical across models, otherwise you are testing configurations rather than models. Dimensions should carry weights, and security-related issues should be treated as an automatic veto, because the cost of a single data leak far exceeds several compile failures.

    3. Dimension Two: Latency—The Dividing Lines Are “How Much It Can Write at Once” and “How Long It Answers per Turn”

    Most teams interpret latency as “token output speed,” which is a misjudgment. End-to-end latency consists of four parts: queueing and time to first token, generation rate, output length, and number of round trips. The last two are usually determined by model behavior and have the largest impact.

    • Single-output limit: if the limit is on the order of a hundred thousand tokens, a two-hundred-thousand-token deliverable can be written in one pass; if the limit is only a fraction of that, the same work must be split into two segments, adding a round trip, another context rebuild, and another consistency risk.
    • Answer length per turn: some models tend to produce long explanations, consuming several times the median token count in a single turn. This both lengthens latency and directly inflates the bill.
    • Number of round trips: splitting a large task into small steps can improve correctness, but each additional round adds the cost of retransmitting duplicated context.

    A rough formula can support capacity planning:

    1. End-to-end latency ≈ time to first token + output tokens / generation rate + rounds × fixed overhead per round
    2. Cost per task ≈ input tokens × input price + output tokens × output price
    3. (cache-hit portion billed at the cache price)

    Conclusion: when your deliverables routinely reach over a hundred thousand tokens (whole-repo refactoring, long document generation, bulk unit test completion), the “one-pass completion” capability usually affects total latency more than differences in generation rate.

    4. Dimension Three: Cost—Look at Effective Tokens, Not Just List-Price Multiples

    List-price comparisons easily produce an intuition of “several times difference,” but the real bill depends on the effective token structure: how much of the input can be served by prefix caching, how much of the output is explanatory redundancy, and how much consumption failed retries amplify. Cached input is typically priced well below regular input, so a stable system prompt and repository context prefix are the most direct cost-reduction measures.

    Three actionable cost controls: first, place long, stable context at the front and reuse the cache; second, compress answer length per turn by requiring “patch first, explanation after”; third, set automatic validation gates for high-risk dimensions to prevent incorrect output from flowing downstream and causing secondary consumption.

    5. Combining the Three Dimensions into a Decision: A Reviewable Scoring Table

    1. Decision = argmax ( w1 * first-pass rate + w2 * latency compliance rate - w3 * cost per task )
    2. Constraints: security dimension is an automatic veto; single-output limit ≥ longest task deliverable

    Weights are set by the business: raise w2 for user-facing real-time features; raise w3 for overnight batch refactoring; raise w1 and the security constraint for core paths. The value of this table is that every input can be independently reviewed, turning arguments from “I think” into “what do the data say.”

    6. Common Pitfalls and Engineering Advice

    • Looking only at the aggregate score: ignores the per-dimension distribution, so a security weakness is masked by the average.
    • Comparing only generation rate: ignores the round-trip amplification caused by output limits and answer length.
    • Ignoring caching: retransmitting a reusable prefix every time multiplies the bill.
    • Evaluation set contamination: tasks overlapping with public benchmarks inflate conclusions; keep a private holdout set.

    7. Rollout Checklist

    1. Build a task set of 50–200 items that fit your own repository, with reference patches and automated tests;
    2. Fix decoding and context configuration, and log tokens and cache hits per round;
    3. Produce three tables: per-dimension pass rate, latency breakdown, and effective cost;
    4. Validate with a small-traffic canary, keep regression testing, and avoid freezing conclusions from a one-off run.

    If your team is doing a similar selection, you can also use general capabilities such as the model services, monitoring and alerting, and logging services offered by Baidu AI Cloud to solidify the evaluation pipeline, so that every model or configuration change has a comparable data baseline.