Evaluating the Gap Between Open-weight and Closed-source LLMs: A Practical Guide

    Debates over whether open-weight models are falling behind closed-source frontier models are often driven by release cadence rather than measured capability. This article explains why a single benchmark score can mislead, covering construct validity, data contamination, sampling variance, pass@1 versus pass^k, and scaffold sensitivity, and why terminal-agent coding benchmarks are especially hard to interpret. It then lays out how to build a reproducible evaluation pipeline with layered task sets, evaluation-as-configuration, and anti-cheating audits, discusses the compliance boundaries of the distillation debate, and shows how to move from leaderboard scores to cost-quality curves and routing for model selection.

    1. Perceived Gap Is Not the Same as Capability Gap

    Public discussion in the model industry has shown an interesting pattern lately: the release cadence of closed-source frontier models has clearly accelerated, with several organizations taking turns topping general leaderboards within a few months; meanwhile, new releases from the open-weight camp have been comparatively sparse, and their visibility has declined accordingly. As a result, “Are open-weight models falling behind again?” has become a high-frequency question, even spawning inferences like “progress in open-weight models depends on distillation, and external anti-distillation measures will pull away the ladder.”

    The problem is that “release interval” and “capability curve” are quantities on two different dimensions. The former is influenced by engineering schedules, compute allocation, safety evaluation cycles, and compliance review cadence; the latter is what can actually be measured. Mapping release density directly onto capability level substitutes an easily available weak signal for the hard-to-obtain ground truth. To answer “Is the gap widening or narrowing?”, the only reliable approach is to return to measurement itself: first clarify what is being measured, then confirm it is measured accurately, and finally check whether the results can be reproduced.

    2. First Align the Concepts: Open-weight, Closed-source Frontier, and “Distillation”

    Open-weight is not the same as open-source. Downloadable weights mean you can do local inference, fine-tuning, quantization, and private deployment, but this does not necessarily include training code, data composition, and the full data processing pipeline. If evaluation fails to distinguish “weights available” from “training process reproducible,” it easily puts objects of different natures on the same ruler.

    Distillation is a mature model compression and transfer technique and is not itself a technical controversy. Sequence-level knowledge distillation, logits distillation, and instruction fine-tuning based on synthetic data are all standard engineering methods long used in the industry; the goal is to transfer the discriminative and generative capabilities of large models onto smaller, cheaper ones. What really needs to be distinguished are three things: whether the synthetic data generation process is compliant; whether output data with explicit usage restrictions was used; and whether there is an auditable record of the training data source. Technical methods and compliance issues must be discussed separately, otherwise the discussion degrades into a contest of positions.

    The gap needs to be expressed as “comparable scores on a distribution.” A common claim is that “the score gap between top open-weight models and closed-source models has narrowed from double digits to single digits.” Such a conclusion is meaningful only when the following conditions hold: the same task set, the same prompt template, the same tool set, an equal sampling budget, and multiple samples with confidence intervals reported. Missing any one of these, the score gap is just measurement noise.

    3. Why a Single Score Can Mislead

    3.1 Construct validity: does the score measure capability, or capability plus luck plus scaffolding

    Any benchmark is a limited proxy for the abstract construct of “capability.” A function-level completion benchmark measures local correctness in short contexts, which correlates only weakly with the ability to “locate a problem in a real repository, modify code, and get tests passing.” Using one proxy metric to answer a different question is the most common starting point of evaluation failure.

    3.2 Data contamination: overlap between training corpus and test set

    Contamination systematically inflates scores, and the magnitude of inflation correlates positively with model size and training rounds. Feasible observation methods include: n-gram overlap rate, near-duplicate detection at the field level, and “rewrite testing”—rephrase the problem statement, variable names, and boundary conditions, then retest; if the score drops significantly, it means the original score contained a considerable proportion of memorization rather than generalization.

    1. import re
    2. def ngram_set(text: str, n: int = 13) -> set:
    3. toks = re.findall(r"\w+", text.lower())
    4. return {tuple(toks[i:i + n]) for i in range(max(0, len(toks) - n + 1))}
    5. def contamination_rate(probe_docs, reference_corpus, n: int = 13) -> float:
    6. """Return the overlap ratio between evaluation samples and the public corpus, as an observable proxy metric for the degree of contamination."""
    7. ref = set()
    8. for doc in reference_corpus:
    9. ref |= ngram_set(doc, n)
    10. hit = sum(1 for d in probe_docs if ngram_set(d, n) & ref)
    11. return hit / max(1, len(probe_docs))

    3.3 Variance: temperature=0 does not mean determinism

    Batch processing order, floating-point accumulation order, and concurrent scheduling can all cause so-called deterministic sampling to produce different outputs. Differences in single-round evaluations often fall within the confidence interval yet get interpreted as real differences. The correct approach is to sample multiple times independently per task and report interval estimates rather than point estimates.

    1. import math
    2. from functools import reduce
    3. def wilson_ci(k: int, n: int, z: float = 1.96):
    4. p, d = k / n, 1 + z * z / n
    5. c = (p + z * z / (2 * n)) / d
    6. h = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / d
    7. return round(c - h, 4), round(c + h, 4)
    8. def pass_at_k(n: int, c: int, k: int) -> float:
    9. """c is the number of passes among n independent samples; return the probability that the task is solved by at least one sample."""
    10. if n - c < k:
    11. return 1.0
    12. return 1.0 - reduce(lambda a, i: a * (1 - k / i), range(n - c + 1, n + 1), 1.0)
    13. n, c = 10, 6 # Sample values, used only to demonstrate the calculation method
    14. print(wilson_ci(c, n)) # (0.3127, 0.8319): the interval is very wide when the sample size is insufficient
    15. print(round(pass_at_k(n, c, 4), 4)) # 0.9952

    An interval as wide as 0.31–0.83 means that any claim of “who is a few points higher than whom” does not hold at this sample size.

    3.4 pass@1 versus pass^k: correct once versus consistently correct

    pass@1 measures “can it be solved given several attempts,” while pass^k measures the reliability of “all k attempts succeed.” Agents in production usually cannot retry until they succeed, so pass^k is closer to the real experience. A model with higher pass@1 but larger variance may actually bring higher rework costs in an automated pipeline.

    3.5 Scaffold sensitivity: the same model’s score can differ substantially

    The same model, under different tool sets, prompt templates, context-trimming strategies, and retry and self-check logic, can see score differences that are often larger than the gap between models. Any cross-model comparison must run a scaffold ablation, otherwise what is being compared is actually two agent engineering setups.

    4. Why Terminal-agent Coding Benchmarks Are Hard

    The typical setup of an interactive terminal coding benchmark is: given a repository and a natural language goal inside an isolated container, the agent must complete the task through multiple steps such as shell commands, file reads and writes, dependency installation, and test execution, with success ultimately determined by hidden judge tests.

    The difficulty concentrates in four areas:

    • Multi-step and long-range dependencies: Errors accumulate along the trajectory; a misjudgment at step 3 may not surface until step 15, requiring the model to maintain state and self-correct.
    • Environment as a variable: Image versions, dependency locks, cache warming, and network policies all affect results. Without pinning image digests and isolating the network, the scores obtained cannot be reproduced over time.
    • Reward can be gamed (reward hacking): The model may modify tests, skip checks, hardcode return values, or change configuration to “pass” rather than actually solving the problem.
    • Cost and capability must be looked at together: A score improvement bought with several times more tokens and tool calls may not be worthwhile from an engineering standpoint.

    Therefore, the correct way to read such benchmarks is not “high or low score” but the quadruple of “score + pass-rate variance + step/token cost + cheating rate.”

    5. How to Build a Trustworthy Evaluation Pipeline

    Layered task-set design

    • Smoke set: A few dozen items, minute-scale, for immediate regression on each change;
    • Regression set: Hundreds of items covering high-frequency real scenarios, with stable metrics and controllable noise;
    • Hard-case set: Long-range tasks and easily-gamed tasks, used to distinguish the reliability of top models;
    • Online replay set: De-identified samples drawn from real requests, used to calibrate the correlation between offline scores and business metrics.

    Evaluation as configuration: write reproducibility into the config

    1. scaffolds:
    2. - id: no-tools-baseline
    3. max_steps: 1
    4. tools: []
    5. - id: agentic-min
    6. max_steps: 20
    7. tools: [shell, read_file, write_file, run_tests]
    8. - id: agentic-full
    9. max_steps: 40
    10. tools: [shell, read_file, write_file, run_tests, search]
    11. sampling:
    12. attempts_per_task: 5
    13. temperature: 0.0
    14. seed: 42
    15. harness:
    16. container_image_digest: "sha256:<pinned to digest>"
    17. network: none
    18. timeout_seconds: 900
    19. persist_artifacts: [trace, diff, logs] # When results cannot be reproduced, the trace is the only clue

    Anti-cheating audit

    1. def audit_patch(diff: str) -> list[str]:
    2. """Run basic anti-cheating checks on the submitted patch; any hit marks it as an invalid pass."""
    3. low = diff.lower()
    4. flags = []
    5. if any(p in low for p in ("test_", "pytest", "unittest")):
    6. flags.append("modified test files")
    7. if any(p in low for p in ("xfail", "skipif", "# type: ignore", "pragma: no cover")):
    8. flags.append("introduced skip or suppression markers")
    9. if "return true" in low and diff.count("\n+") <= 2:
    10. flags.append("suspected hardcoded return value")
    11. return flags

    Companion rules: run the judge tests only after applying the patch; for tasks that “pass both before and after the patch” and “fail both before and after,” remove them or count them separately, to avoid non-discriminative samples contaminating the pass rate.

    Hosting approach

    Evaluation itself is a typical batch workload: containerized orchestration, fixed image versions, results and traces archived to object storage, failure and latency metrics feeding into monitoring and alerting, and centralized log search for retrospective analysis. On Baidu AI Cloud, such a pipeline can use the container platform to run concurrent evaluation tasks, object storage to save traces and artifacts, and log services plus monitoring alerts for a quality dashboard—standard usage of general-purpose cloud infrastructure.

    6. Compliance Boundaries of the “Distillation” Debate

    For enterprises, the practical significance lies not in taking a position but in auditability. Actionable measures are: review the output usage terms of model vendors to clarify whether use for training is allowed; maintain a ledger of training data sources, distinguishing public corpus, self-built data, and synthetic data; label synthetic data with its generation chain; and preserve data lineage in contracts and technical documentation. These measures both reduce compliance risk and make the question “whether capability comes from a sustainable training process” verifiable, rather than leaving it at mutual accusation.

    7. From Scores Back to Model Selection

    Leaderboard rankings answer “who is stronger,” but engineering decisions need “on my task distribution, how much accuracy can a unit of cost buy.” A three-step approach is recommended:

    1. Retest with your own data: Sample 200 real requests, build your own small-scale evaluation set, and cross-check its correlation with public scores;
    2. Draw the cost-quality curve: Horizontal axis is token and latency cost per task, vertical axis is pass^k; find the inflection point of marginal returns;
    3. Do routing and cascading: Use a lightweight model to handle high-confidence requests, escalate low-confidence or high-risk requests to a stronger model, and set guardrail metrics to prevent cascades from amplifying errors.

    8. Conclusion

    The question “who leads, closed-source or open-weight” has an answer only after the measurement methodology is strictly constrained; before that, discussing leaderboard score differences is of limited value. Real engineering capability lies in three more mundane things: making evaluation reproducible, calculating cost clearly, and retaining compliance records. When all three are in place, model selection returns from a matter of belief to an engineering problem—one that can be verified and continuously improved.