How to Measure the Math Gap Between Open-Source and Closed-Source LLMs

    How large is the real math gap between top open-source and closed-source LLMs? This article breaks "math ability" into four measurable layers, explains why contamination control matters more than dataset size, introduces result scores, process scores and bootstrap confidence intervals, and offers practical attribution and engineering practices for rigorous evaluation.

    1. Define the Problem First: Math Ability Is Not a Single Number

    The question “how far behind are open-source models from top closed-source models in math?” is hard to answer because “math ability” is not one dimension. It can be broken down into at least four layers:

    1. Arithmetic and symbolic manipulation: multi-step numerical computation and algebraic transformations, testing precision and stability of intermediate steps.
    2. Theorems and proofs: formal or informal reasoning chains, testing logical closure and whether assumptions are used legitimately.
    3. Word problem modeling: translating natural-language scenarios into equations or constraint systems, testing the mapping from semantics to structure.
    4. Competition-level problems: requiring constructive approaches, testing search depth and backtracking.

    The gap does not move in sync across these layers. A common observation in engineering practice: the first tier of open-source models is roughly on par with the closed-source top tier on structured, enumerable, uniquely-answerable problems, while closed-source leaders still hold a stable advantage on problems requiring long construction chains and cross-step self-correction. Any conclusion like “the total score differs by a few points” must first state which of these four layers it covers.

    2. Benchmark Design: Contamination Control Matters More Than Volume

    The biggest risk with math benchmarks is training data leakage. If a model has seen the original problems, the score is meaningless. Three practical layers of defense:

    • Public benchmarks as a baseline: useful for horizontal comparison, but their ceiling has already been inflated.
    • Private holdout sets as the arbiter: build your own problem sets, never publish them, rotate them regularly, and rewrite human-generated problems with templates to avoid memorized phrasing.
    • Dynamic generation as stress testing: use parameterized problem generators that randomize values and conditions on each run, which is naturally contamination-resistant.

    Illustrative parameterized generation logic:

    1. import random
    2. def gen_linear_word_problem(seed: int) -> dict:
    3. rng = random.Random(seed)
    4. a, b, c = rng.randint(2, 15), rng.randint(2, 15), rng.randint(10, 60)
    5. # Guarantee integer solutions to avoid ambiguous answers
    6. x = (c - b) // a
    7. question = f"A warehouse has {a} rows of shelves with {b} boxes per row. After some boxes are removed, {c} boxes remain. How many boxes were removed?"
    8. return {"question": question, "answer": x, "seed": seed}

    The key requirement is that answers must be unique and automatically verifiable. Any problem requiring subjective human scoring should be grouped separately and never mixed into overall automatic scoring.

    3. Metrics: Result Scores, Process Scores, and Confidence Intervals

    3.1 Report Result and Process Scores Separately

    Reporting only final-answer accuracy rewards lucky guessing. A more rigorous approach reports three metrics together:

    • Final-answer accuracy (result score)
    • Step-level correctness (process score, via intermediate-value comparison or reference checking)
    • Self-correction rate: whether the model can fix an early error in subsequent reasoning

    When these diverge, the conclusions differ completely. For example, if result scores are close but process scores differ significantly, the open-source model is likely relying more on pattern matching than genuine reasoning.

    3.2 A 0.1-Point “Lead” Is Not a Lead

    This is the most important caveat when interpreting score data. At the scale of a few hundred problems, a 0.1 percentage point difference is far below sampling noise. The right approach is a paired significance test plus bootstrap confidence intervals:

    1. import random
    2. def paired_bootstrap(a: list[int], b: list[int], n: int = 10000) -> tuple[float, float]:
    3. """a and b are 0/1 score sequences on the same problem set; returns the 95% CI of the difference"""
    4. diffs = []
    5. m = len(a)
    6. for _ in range(n):
    7. idx = [random.randrange(m) for _ in range(m)]
    8. diffs.append(sum(a[i] - b[i] for i in idx) / m)
    9. diffs.sort()
    10. return diffs[int(0.025 * n)], diffs[int(0.975 * n)]

    If the interval crosses zero, the result should be called a tie. Similarly, for counts like “wins 27 of 34 categories,” check whether each per-category difference is significant—otherwise the win/loss tally is inflated by noise.

    3.3 Evaluation Metadata You Must Disclose

    • Sampling temperature and number of samples (single greedy pass vs. multi-sample voting)
    • Whether tool use is allowed (calculator, code execution)
    • Prompt templates and few-shot counts
    • Context length and truncation strategy

    The same model can vary by several points across configurations. Comparison tables without this information are not comparable.

    4. Attributing the Gap: Where Does It Come From?

    Breaking the gap down into actionable stages is what gives the analysis engineering value:

    Stage Impact on math ability Verifiable signal
    Math/code share in pretraining corpus Determines symbolic and formal foundations High baseline on structured problems, low on open-ended ones
    Post-training (reasoning-chain data, verifiable rewards) Determines long-chain stability Process and result scores improve together
    Inference-time compute (sampling and search) Determines the ceiling on hard problems Gap narrows after multi-sample voting
    Tools and execution environment Determines arithmetic precision Gap shrinks markedly when code execution is allowed

    One practical takeaway: once a code execution environment is available, the open-source vs. closed-source gap on arithmetic-heavy problems typically narrows significantly, with the remaining difference concentrated in meta-cognition—whether the model knows to call the tool in the first place. This explains why investing in tool orchestration is often more valuable than blindly switching to a larger model.

    5. Engineering Practice: Tiered Selection and Verifiers

    1. Tiered routing: send easy problems to small models and escalate hard ones to larger models, using confidence scores or first-round consistency as routing signals.
    2. Multi-path sampling + majority voting: math answers occupy a small space, so voting yields high returns and is the most cost-effective improvement.
    3. Independent verifiers: use a model from a different family than the solver, or a rule engine, to re-check answers—this significantly reduces “confidently wrong” outputs.
    4. Observability: persist every evaluation’s problem hash, configuration, raw outputs, and scoring rationale to a logging service and object storage so conclusions remain traceable.
    5. Continuous regression: hook the private holdout set into CI so any model or prompt change triggers regression testing and prevents silent degradation.

    6. Conclusion

    Back to the original question: the gap exists, but it cannot be summarized by a single total score. A rigorous answer reads like: “Under a benchmark covering N contamination-controlled tasks, with fixed sampling configurations and reported confidence intervals, the first tier of open-source models is statistically indistinguishable from the closed-source top tier on structured math tasks, while a measurable gap remains on long-chain construction tasks.” Any “comeback” narrative lacking contamination control, significance testing, and configuration disclosure should be treated as a lead—not a conclusion.