Evaluation & Contamination

Evaluation & Contamination

Evaluating frontier language models is fundamentally harder than evaluating classical supervised classifiers. Because an autoregressive language model is trained on trillions of web tokens and outputs open-ended sequences, static accuracy metrics break down under three failure modes: tokenizer dependence in likelihood metrics, combinatorial variance in multi-sample generation, and benchmark contamination where test problems leak into the pre-training corpus.

Rigorous model evaluation requires combining information-theoretic likelihood normalization, unbiased combinatorial estimators (), pairwise Bradley-Terry human/judge rankings, and log-probability outlier auditing () to separate genuine out-of-distribution generalization from verbatim memorization.

Evaluation Metric / EstimatorScaling / DomainRole in Frontier LLM Benchmarking
Autoregressive Perplexity: Exponentiated cross-entropy loss ; depends on tokenizer fertility (normalize as Bits-Per-Byte ).
Unbiased Pass@k Estimator (Chen et al. 2021): Minimum-variance unbiased probability that at least 1 of independent code/math rollouts passes all unit tests.
Bradley-Terry Elo Rating: Maximum-likelihood pairwise win-rate scaling in live human and LLM-as-a-Judge arenas (Chatbot Arena).
Outlier Contamination Detector (Shi et al. 2024): Detects test-set leakage via anomalously high log-probabilities on rare bottom- tokens.

Benchmark Decontamination & Min-K% Outlier Token Probability Audit

Evaluation BenchmarkGSM8K / HumanEval / MMLUSequence X = (x1, ..., xT)13-gram & Min-K% AuditUnseen Holdout Set (True Generalization)Min-20% Log-Prob: -4.82 nats (Low)Rare entity tokens exhibit high surprisalLeaked Pre-Training Split (Memorization)Min-20% Log-Prob: -0.64 nats (Anomalous)Outlier tokens memorized verbatim (>10% inflation)Dynamic CalibrationLiveCodeBench / ArenaPost-cutoff problemsΔScore = -14.2% drop
Figure 1 (Decontamination & Outlier Audit): When an evaluation benchmark leaks into the web pre-training corpus, rare low-frequency tokens inside the prompt exhibit near-zero surprisal (), inflating static benchmark scores while failing on temporally isolated post-cutoff problems.

1. Likelihood Evaluation & Bits-Per-Byte Normalization

At the pre-training layer, an autoregressive model is evaluated by its cross-entropy loss over a held-out sequence of tokens. Exponentiating the average negative log-likelihood (measured in natural base ) yields Perplexity ():

Perplexity represents the effective branching factor of the model at each step: a perplexity of indicates that the model is as uncertain on average as if it were choosing uniformly among equiprobable tokens.

The Tokenizer Fertility Trap

Perplexity is normalized by the token count , which makes incomparable across models that use different vocabularies . Suppose Model A uses a BPE vocabulary that segments a document of UTF-8 bytes into tokens, whereas Model B uses a vocabulary (e.g., LLaMA-3) that compresses the exact same document into tokens. Even if both models assign the exact same total log-probability to the document:

Model B appears to have worse perplexity purely because each of its tokens spans more characters. To compare models across tokenizers, we normalize total negative log-likelihood by the raw UTF-8 byte length and convert from natural logs to base- bits, yielding Bits-Per-Byte ():

For both models above, , restoring invariance to vocabulary size.


2. Functional Synthesis & Unbiased Pass@k Estimation

For reasoning, mathematics, and code synthesis (e.g., HumanEval, SWE-bench), likelihood does not measure whether generated code compiles and passes unit tests. Instead, we evaluate functional correctness across independent stochastic rollouts sampled at temperature : a problem is solved under if at least one of the generated candidates passes all unit tests.

Naively drawing exactly samples per problem and checking if any succeed produces high variance. Conversely, if we generate total candidate rollouts (e.g., or ) and observe that candidates pass the test suite, estimating via the plug-in empirical success rate is upwardly biased for finite .

Following Chen et al. (2021), the unique minimum-variance unbiased estimator (MVUE) for draws samples without replacement from the generated rollouts and computes the exact hypergeometric complement—one minus the probability that all selected rollouts belong to the failing candidates:

Whenever , by the pigeonhole principle every subset of size contains at least one passing solution, so and .

Unbiased Pass@k Combinatorial Scaling & Contamination Mirage Simulator

Adjust passing rollouts (out of ) and test-set leakage to compare the exact hypergeometric curve against contaminated leaderboard scores.

Passing Rollouts (c / 20): 4
Leakage (αleak): 20%
0%25%50%75%100%k=1k=2k=5k=10k=15Number of Sampled Code Rollouts (k)True Unbiased Pass@k (Clean)Reported Score (w/ Leakage)Estimator Audit (n = 20)True Clean Pass@1:20.0%True Clean Pass@5:71.8%True Clean Pass@10:95.4%Reported Pass@1:36.0%Artificial Inflation:+16.0%Severe Benchmark Mirage
MVUE Hypergeometric
Rollouts c: Leakage α:

3. Worked Numerical Walkthrough: Pass@k vs. Plug-In Bias

Suppose we evaluate a code synthesis model on a benchmark task by generating independent rollouts at temperature , and exactly rollouts pass the unit tests.

Step 1: Comparing Unbiased Pass@5 to Naive Plug-In

The empirical single-sample pass rate is . The naive plug-in approximation assumes sampling with replacement:

Now evaluate the exact unbiased hypergeometric estimator using the product identity to avoid factorial overflow:

Here, the naive plug-in estimator misestimates the finite-sample combinatorial probability by percentage points.

Step 2: Modeling Contamination Inflation

Suppose a competing model has weaker true generalization ( out of , so true ), but of the benchmark problems were inadvertently included in its web pre-training corpus and memorized verbatim (). Its reported aggregate across the full benchmark is:

Despite having lower true capability ( vs. ), the contaminated model outranks the clean model by on the static leaderboard—a classic benchmark mirage.


4. Pairwise Arena Ranking & LLM-as-a-Judge Biases

For open-ended instruction following, summarization, and dialogue where no deterministic unit test exists, evaluation relies on pairwise preference comparisons collected from blind human annotators (Chatbot Arena) or frontier judge models (LLM-as-a-Judge).

Bradley-Terry Maximum Likelihood Scaling

Given models with latent skill parameters , the Bradley-Terry model parameterizes the probability that Model beats Model via the logistic link function. In standard Elo scaling (base , scale factor ), rating satisfies:

Unlike classical sequential Elo updates—which depend on match ordering—modern leaderboards (Chiang et al., 2024) fit all ratings simultaneously by maximizing the regularized pairwise log-likelihood over the empirical win matrix (number of times beat ), yielding exact bootstrap confidence intervals:

A rating difference of Elo points corresponds to an expected win rate of .

Systematic Judge Biases & Debiasing Protocols

When replacing human raters with an LLM judge (e.g., MT-Bench, AlpacaEval), three statistical biases distort win rates unless explicitly controlled:

Judge Bias ModeEmpirical ManifestationMathematical / Experimental Mitigation
Position BiasJudges systematically favor the first response over by Evaluate both permutations and ; count a win only if consistent across both orders
Length / Verbosity BiasLonger, markdown-formatted responses win even when factually redundantLength-Controlled AlpacaEval (Dubois et al., 2024): fit a generalized linear model (GLM) with response length as a covariate and predict win rate at zero length delta
Self-Preference BiasModels assign higher scores to outputs matching their own low-perplexity styleUse an ensemble of heterogeneous judge families and reference-guided grading rubrics

5. Benchmark Contamination & Min-K% Detection

Because pre-training corpora scrape billions of GitHub repositories, ArXiv papers, and web forums, static benchmarks (GSM8K, MMLU, HumanEval) inevitably leak into training sets. Decontamination requires both pre-training corpus filtering and post-hoc black-box detection.

  1. N-Gram & Embedding Decontamination (Corpus Filtering): During corpus curation (LLaMA-3, GPT-4), any training document sharing a -gram (or -gram for short prompts) with any evaluation test example is stripped or masked. However, -gram matching fails against paraphrased contamination, translated benchmarks, or synthetic rewrites of test questions.
  2. Min-K% Prob (Post-Hoc Memorization Audit): Shi et al. (2024) observe that if a model has memorized a test example , even its rarest, highest-surprisal tokens will receive anomalously high log-probabilities compared to an unseen text of similar domain. Let denote the token log-probabilities, and let be the subset containing the tokens with the lowest log-probabilities (typically ). The detection score is:

If (where threshold is calibrated on guaranteed post-cutoff text), the example is flagged as contaminated. Moving beyond static datasets, dynamic temporal benchmarks such as LiveCodeBench continuously harvest new Competitive Programming problems published after each model’s training cutoff date, providing a contamination-free verification signal.


Key Papers & References