Module contents
Lesson 14 of 23Advanced 105 min

Benchmark evaluation: validity, noise and community overfitting

Treat benchmarks as measurement instruments: construct validity, test-label errors and ranking effects, adaptive reuse and distribution shift, annotation artifacts and shortcuts, benchmark design, and item response theory for shorter evaluations.

After this lesson you can

  • Evaluate a benchmark's construct validity and state supported and unsupported conclusions.
  • Detect test-label error candidates with confident learning and measure their effect on model ranking.
  • Distinguish adaptive overfitting from distribution shift using evidence such as ImageNetV2.
  • Detect annotation artifacts using partial-input baselines.
  • Fit a two-parameter item-response model and select a subset estimating the full score.

Before you start

A benchmark is an instrument

A model can score extraordinarily well yet fail at the use motivating evaluation. The first question is not “how much did it rise?” but “what observation and population does that figure represent?” Benchmark construct validity is the extent to which interpreting a score as a measure of the intended concept is justified. Adding more examples does not itself establish it: the argument comes from design, assumptions, and relevant evidence.

In a vulnerability classifier, a dataset built from fix commits may associate labels with project, date, message, or patch style. High accuracy may measure recognition of those cues rather than defect detection in new code. Separate projects and time, remove metadata unavailable at deployment, test semantically equivalent changes, and compare partial-input controls. Each control addresses a different threat; none alone proves general capability. Raji and colleagues warn against treating a few benchmarks as universal progress measures.

Sampling error describes fluctuation for a defined target and population; it does not correct poor coverage, confounding, or faulty labels. Comparison across tasks helps reveal sensitivity to benchmark choice, but a collection of tasks is not automatically representative of the world. In the benchmark lottery, changing tasks or metrics can alter the conclusion; show disaggregated results too.

A new test and a hard-to-identify cause

Adaptive benchmark overfitting occurs when repeated decisions depend on the same test scores. Selecting the best of many noisy variants favors those lucky on that test. But a drop on a new set may also result from distribution change, label differences, or sampling. Recht and colleagues’ decomposition separates adaptive gap, distribution gap, and new-test noise: observing their sum does not itself identify each term.

ImageNetV2 collected new sets of 10,000 images following a process similar to the original. In their study, the typical top-1 drop was 11 to 14 points on ImageNet and model ordering was approximately retained; the authors argue distribution difficulty difference better explains the pattern than a simple hypothesis of growing overfitting. Their published line has slope approximately 1.1 in the main comparison. This supports an explanation, not full causal identification or a general law for every benchmark.

InteractiveImageNet versus MatchedFrequency
  • Published models
  • Descriptive linear fit

Gray line: equality. Hypothetical lines show possible patterns and do not alone identify the cause. Data are from table 14 of Recht and colleagues.

Models from table 1467
Slope of fit to rounded figures0.97
The 67 points come from table 14 of the paper with rounded figures. Enable two hypothetical patterns and compare them with published results: no curve alone identifies a cause.

The figure fits a line to the 67 rounded rows, including low-accuracy Fisher Vector models. That slope need not match 1.1 reported for the main figure’s model set. A constant drop and retained ranking are compatible with some distribution changes, but neither that pattern nor a growing loss is exclusive to one cause. Roelofs and colleagues studied more than one hundred Kaggle competitions and found little overall evidence of substantial overfitting. This does not guarantee every competition, domain, or query regime is immune.

When the observed label is wrong

Test-label errors affect both estimation and ranking. A prediction matching reality may be counted wrong if the label is wrong; a model reproducing that label may benefit. The effect depends on error locations, model disagreements, and metric. Bias direction cannot be inferred from a single noise rate.

InteractiveA ranking can reverse
A true
91.1 %
B true
75.5 %
A observed
83.1 %
B observed
83.5 %

Flips concentrate on disagreements: this construction shows a possibility, not the error frequency of a real benchmark.

80
A and B with true labels91.1 % / 75.5 %
A and B with observed labels83.1 % / 83.5 %
The simulation constructs 1000 items and concentrates flips on disagreements where A is correct and B wrong. Change altered-label count and compare ranking under true and observed labels.

This is a hypothetical mechanism in which B behaves as if it learned a wrong rule on selected items; no real model was trained or human labels corrected in the figure. Northcutt and colleagues identified candidates with confident learning and submitted them to human validation. Their study estimated at least 3.3% errors on average across ten datasets and at least 6% in ImageNet validation; these figures belong to their procedure and collection, not every benchmark. An algorithm-flagged candidate is not a proven incorrect label.

Confident learning starts from out-of-sample probabilities pijp_{ij} for candidate true class jj and observed label sis_i. A per-class threshold tjt_j can be estimated as the mean of pijp_{ij} among examples with si=js_i=j. Assign a candidate to the highest-probability class among those exceeding their threshold; examples exceeding none remain unassigned. Counts by observed label and candidate class are calibrated by row to recover each label’s observed proportion. This matrix is an estimate depending on model and assumptions, not verified ground truth. Inspect ambiguity, calibration errors, and annotator differences before correction.

Partial inputs and shortcuts

An annotation artifact is a regularity introduced by construction that correlates with the label without requiring the intended ability. In textual inference, a hypothesis-only baseline ignores the premise. Gururangan and colleagues obtained approximately 67% on SNLI and 53% on MultiNLI using hypothesis-only classification, and analyzed cues such as negation and vagueness. These are their published results, not our measurement.

InteractiveA hypothesis revealing the label
True / predictedEntailmentContradictionNeutral
Entailment85114
Contradiction08812
Neutral9487

In this simulated world negation appears with probability 0.85 in contradictions and 0.05 in other classes; the generic marker follows the same pattern for entailments. Training and test are separate balanced samples.

Hypothesis-only accuracy86.7 %
Balanced chance33.3 %
Enable or remove two markers in toy data generated with known probabilities. The baseline trains only on these markers and is evaluated on another balanced synthetic sample.

The toy experiment does not reproduce SNLI or use annotators. A strong partial-input baseline identifies a threat, not proof that every full-model decision uses the shortcut. A weak baseline does not exclude artifacts its model class cannot exploit. The lab uses another real problem, GLUE’s MRPC, and compares one sentence alone with the pair; its result can be negative.

Design to learn, not just rank

Benchmark design principles include an explicit construct, population and selection process, label definition, agreement and disagreement, sources, license, and limitations. A datasheet records these decisions. A private split makes direct adaptation of submissions harder, but an API with many queries can leak information about it. Limiting and auditing queries, retaining independent evaluation data, and renewing examples help, with costs and possible new biases.

A dynamic benchmark may incorporate adversarial cases and update, but the process changes the distribution and scores across versions cease to be directly comparable. Keep versions, rules, and dates. Dynabench studies dynamic collection; The Ladder limits information published about a leaderboard. Contamination and its detection require examining overlap with training data, not just hiding test labels.

Item response theory

Item response theory (IRT) treats each model’s correctness on each question as an observation. In the two-parameter logistic model (2PL), for latent ability θi\theta_i, difficulty bjb_j, and positive discrimination aja_j,

P(Yij=1∣θi,aj,bj)=σ(aj(θi−bj)).\Pr(Y_{ij}=1\mid\theta_i,a_j,b_j)=\sigma(a_j(\theta_i-b_j)).

At θi=bj\theta_i=b_j probability is 0.5; large aja_j makes the transition around bjb_j steeper. Fisher information for θ\theta on an item is aj2pj(1−pj)a_j^2p_j(1-p_j), maximal for that item near its difficulty. Selecting highest information at θ=0\theta=0 prioritizes items discriminating near that point, not necessarily best for every model or for estimating a score in another population.

Parameters lack an identifiable scale without a convention: shifting and rescaling ability and difficulty while compensating discrimination leaves probabilities unchanged. The lab centers and scales abilities and regularizes to contain separation; this defines a scale, not a real single trait. Conditional local independence given ability may fail for questions sharing a document, and models may have multidimensional profiles or respond differently to topics. MAE on held-out models tests a particular prediction task, not general IRT validity.

InteractiveFitted items and abbreviated evaluation
  • Not selected
  • Selected

The difficulty axis runs from −3 to 3; discrimination from 0 to 5. The map uses fitted parameters, not true values. The mean of ten random selections is a reference limited to this simulation and does not guarantee the information criterion wins.

Number of items
Selection
MAE versus observed full score0.0278
Mean of 10 random selections0.0267
Compare information-based selection with random selection for 50, 100, and 200 items. Points and errors come from the lab's 2PL simulation, evaluated on 30 held-out models.

Selection uses information estimated from 80 calibration models and never uses held-out model answers to choose items. In this run MAE against observed full score for information is approximately 0.0348, 0.0278, and 0.0173 with 50, 100, and 200 items; for ten random subsets the mean is 0.0435, 0.0267, and 0.0160. Information selection wins at 50 but not every size: the simulation does not require a universal victory.

Lab: real textual audit

We use MRPC from GLUE, revision bcdcba79d07bc864c1c254ccfcedcce55bcc9a8c: 3668 training pairs and 408 validation pairs. To run offline without reproducing original sentences, the hidden cell contains 256-dimensional hashed binary word vectors per sentence and observed labels. Hashing can mix distinct words; this is a specific baseline, not an exhaustive corpus audit. Preparation starts from the two published splits, without new annotation.

The partial baseline sees only the first sentence. The second uses both, their absolute difference, and feature matches. Both are logistic regressions trained with stochastic descent; hyperparameters are the same. Validation does not participate in tuning. Majority class is a necessary control because MRPC is imbalanced.

[ ]Train the partial-input baselineBrowser
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import accuracy_score
train_a=mrpc['train_a']; train_b=mrpc['train_b']; y_train=mrpc['train_y']
dev_a=mrpc['dev_a']; dev_b=mrpc['dev_b']; y_dev=mrpc['dev_y']
partial=SGDClassifier(loss='log_loss',alpha=.001,max_iter=1000,tol=.001,random_state=31)
partial.fit(csr_matrix(train_a),y_train)
partial_probs=partial.predict_proba(csr_matrix(dev_a))
print('train/dev',len(y_train),len(y_dev),'mayoritaria',max(np.mean(y_dev==0),np.mean(y_dev==1)))
print('solo primera oración:',accuracy_score(y_dev,partial_probs.argmax(axis=1)))
[ ]Train the pair baselineBrowser
def pair_features(a,b):
    return csr_matrix(np.hstack([a,b,np.abs(a.astype(np.int8)-b.astype(np.int8)),a*b]).astype(float))
full=SGDClassifier(loss='log_loss',alpha=.001,max_iter=1000,tol=.001,random_state=31)
full.fit(pair_features(train_a,train_b),y_train)
full_probs=full.predict_proba(pair_features(dev_a,dev_b))
print('ambas oraciones:',accuracy_score(y_dev,full_probs.argmax(axis=1)))

In the Pyodide-verified run, the first sentence alone obtained 0.6814 and majority class 0.6838; the sparse pair baseline obtained 0.7132. This particular partial baseline does not beat the majority control on validation, so it does not demonstrate a shortcut here. Do not conclude MRPC lacks artifacts: other models or splits might find them. Hash collisions and a small validation set are additional limits; versions and numerical representation can change figures.

Joint matrix and candidates

The next function returns thresholds and a calibrated estimated joint-probability matrix. For each observed class it normalizes candidate counts to its frequency; if a row has no candidates, it stops analysis instead of inventing a distribution. It does not return corrected labels or prove an observation wrong. Probabilities come from the model trained without validation, but one weak or poorly calibrated model can yield misleading candidates.

[ ]Estimated joint matrixBrowser
def confident_joint(pred_probs,labels):
    p=np.asarray(pred_probs,float);s=np.asarray(labels,int)
    if p.ndim!=2 or s.shape!=(len(p),) or not np.isfinite(p).all() or np.any(p<0) or not np.allclose(p.sum(axis=1),1): raise ValueError('probabilidades inválidas')
    K=p.shape[1]
    if np.any(s<0) or np.any(s>=K) or any(np.sum(s==j)==0 for j in range(K)): raise ValueError('faltan clases observadas')
    thresholds=np.array([p[s==j,j].mean() for j in range(K)])
    candidates=np.where(p>=thresholds[None,:],p,-np.inf)
    assigned=np.any(np.isfinite(candidates),axis=1);winner=np.argmax(candidates,axis=1)
    counts=np.zeros((K,K),int)
    for i in np.flatnonzero(assigned): counts[s[i],winner[i]]+=1
    if np.any(counts.sum(axis=1)==0): raise ValueError('fila sin candidatos confiados')
    prior=np.bincount(s,minlength=K)/len(s)
    joint=counts/counts.sum(axis=1,keepdims=True)*prior[:,None]
    return thresholds,counts,joint

thresholds,counts,joint=confident_joint(full_probs,y_dev)
print('umbrales',np.round(thresholds,4),'conteos observada × candidata',counts)
print('matriz calibrada',np.round(joint,4),'suma',joint.sum())
suspects=np.flatnonzero(np.argmax(full_probs,axis=1)!=y_dev)
print('desacuerdos del modelo con etiqueta observada:',len(suspects),'primeros índices:',suspects[:10])

An index is a clue to retrieve the pair from the original validation split and review it with documented criteria and independent annotators. There is no human review here and disagreements are not declared errors. Human validation should retain original label, proposal, reason, disagreements, and corrected version; then reevaluate the same models on both versions. If only errors favoring one method are selected, the new ranking will also be biased.

Repeated selection on one test

In this simulation all candidates have the same population accuracy 0.7 and produce independent correctness. The best of KK is selected on a public set of 100 items and evaluated on an independent private set of 10,000. Candidate count and scores are simulated, not a real competition. Complete candidate independence is a simplification that amplifies the range of possible outcomes.

[ ]Simulated adaptive selectionBrowser
rng=np.random.default_rng(1414)
R,n_public,n_private=200,100,10000
for K in (1,10,100,1000):
    public=rng.binomial(n_public,.7,size=(R,K))/n_public
    winner=np.argmax(public,axis=1)
    selected=public[np.arange(R),winner]
    private=rng.binomial(n_private,.7,size=R)/n_private
    print('envíos',K,'público',round(selected.mean(),4),'privado',round(private.mean(),4),'optimismo',round((selected-private).mean(),4))

A validity card for this lab should state: English news paraphrases, two sentences, binary corpus label, published splits, limited hash features, and validation accuracy. The permitted conclusion is accuracy of these baselines on that split; it is not general language understanding or an annotation-error rate. Review should add provenance, license, periods, and possible duplicates before applying results to other texts.

Lab: fit and shorten with IRT

We simulate 300 items and 110 models. The first 80 fit parameters; the other 30 remain held out. True values are known because this is a simulation. The evaluation goal is to reconstruct both observed score on 300 items and its generating expectation, not discover human ability. Fitting uses penalized alternating maximum likelihood: penalty and bounds avoid exploding solutions from separation. Centering and scaling ability after each iteration fixes an identification convention; it does not mean the resulting scale is the true one.

[ ]Generate responses and define 2PL alternationBrowser
import numpy as np
from scipy.special import expit
from scipy.optimize import minimize
rng=np.random.default_rng(1403); n,m,nt=80,300,30
true_theta=rng.normal(size=n+nt); true_a=np.exp(rng.normal(0,.35,m)); true_b=rng.normal(0,1,m)
true_prob=expit(true_a[None,:]*(true_theta[:,None]-true_b[None,:]))
responses=(rng.random(true_prob.shape)<true_prob).astype(float)
Y=responses[:n]; held=responses[n:]; held_prob=true_prob[n:]
theta=np.log((Y.mean(axis=1)+.01)/(1.01-Y.mean(axis=1)));theta=(theta-theta.mean())/theta.std()
loga=np.zeros(m);difficulty=np.zeros(m);history=[]

def irt_step(theta,loga,b,Y):
    n,m=Y.shape
    def item(z):
        la=z[:m];bb=z[m:];aa=np.exp(la);eta=aa[None,:]*(theta[:,None]-bb[None,:]);diff=expit(eta)-Y
        loss=np.logaddexp(0,eta).sum()-(Y*eta).sum()+.5*(np.sum(la**2)+np.sum(bb**2))
        return loss,np.r_[np.sum(diff*eta,axis=0)+la,np.sum(-diff*aa[None,:],axis=0)+bb]
    fit=minimize(item,np.r_[loga,b],jac=True,method='L-BFGS-B',bounds=[(-2,2)]*m+[(-4,4)]*m,options={'maxiter':100})
    la,bb=fit.x[:m],fit.x[m:];aa=np.exp(la)
    def ability(t):
        eta=aa[None,:]*(t[:,None]-bb[None,:]);diff=expit(eta)-Y
        return np.logaddexp(0,eta).sum()-(Y*eta).sum()+.5*np.sum(t*t),np.sum(diff*aa[None,:],axis=1)+t
    fit_t=minimize(ability,theta,jac=True,method='L-BFGS-B',bounds=[(-4,4)]*n,options={'maxiter':100})
    t=fit_t.x;mu,sd=t.mean(),t.std()
    if sd<1e-8: raise ValueError('habilidades degeneradas')
    return (t-mu)/sd,la+np.log(sd),(bb-mu)/sd,(float(fit.fun),bool(fit.success),bool(fit_t.success))

Each block performs two alternations; they are separated so each cell remains interactive in Pyodide. Transformed parameters preserve a(θ−b)a(\theta-b) during normalization. Displayed objective value is for the item step before the ability update, so read it as a diagnostic, not a global-optimum guarantee.

[ ]Alternations 1 and 2Browser
for _ in range(2):
    theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:])
[ ]Alternations 3 and 4Browser
for _ in range(2):
    theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:])
[ ]Alternations 5 and 6Browser
for _ in range(2):
    theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:])
[ ]Alternations 7 and 8Browser
for _ in range(2):
    theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:]);print('optimizadores convergieron:',all(a and b for _,a,b in history))

In our run all eight steps of both optimizers indicated numerical convergence. Nonconvexity, prior, and scale convention still limit interpretation. With completely easy or difficult models or items, diagnostics and estimates can degrade even if the optimizer terminates.

For each held-out model, infer ability using only selected items via Newton updates damped by a quadratic penalty. Then predict its mean over all items using estimated parameters. The information criterion is fixed at θ=0\theta=0 from calibration; ten random subsets per size are generated without replacement. Randomness in those ten selections does not measure uncertainty of the entire fitting process.

[ ]Select items and evaluate held-out modelsBrowser
def infer_theta(observed,a,b,indices):
    aa=a[indices];bb=b[indices];yy=observed[:,indices];t=np.zeros(len(observed))
    for _ in range(20):
        p=expit(aa[None,:]*(t[:,None]-bb[None,:]))
        gradient=np.sum((p-yy)*aa,axis=1)+t
        hessian=np.sum(p*(1-p)*aa*aa,axis=1)+1
        t=np.clip(t-gradient/hessian,-4,4)
    return t

estimated_a=np.exp(loga);estimated_b=difficulty
p0=expit(-estimated_a*estimated_b);information=estimated_a**2*p0*(1-p0)
order=np.argsort(-information);rng=np.random.default_rng(1404);rows=[]
for budget in (50,100,200):
    for mode in ('información','aleatorio'):
        for rep in range(1 if mode=='información' else 10):
            idx=order[:budget] if mode=='información' else rng.choice(m,budget,replace=False)
            t=infer_theta(held,estimated_a,estimated_b,idx)
            predicted=expit(estimated_a[None,:]*(t[:,None]-estimated_b[None,:])).mean(axis=1)
            observed_error=np.abs(predicted-held.mean(axis=1)).mean()
            expected_error=np.abs(predicted-held_prob.mean(axis=1)).mean()
            rows.append((budget,mode,observed_error,expected_error))
for budget in (50,100,200):
    for mode in ('información','aleatorio'):
        subset=[r for r in rows if r[0]==budget and r[1]==mode]
        print(budget,mode,'MAE observada',round(np.mean([r[2] for r in subset]),4),'MAE esperanza',round(np.mean([r[3] for r in subset]),4))

The observed mean of 300 items includes Bernoulli noise. Mean true probability is known only in this simulation and measures another quantity. Do not use held-out labels to select items or tune the strategy on this same set if an independent final test is desired. Clustered questions would require changing the independence assumption and validating the procedure at document level.

Exercises

Quiz
A vulnerability benchmark comes from fix commits. What control addresses a real validity threat?
Code
Implement confident_joint(pred_probs, labels): class thresholds, observed × candidate counts, and a row-calibrated matrix. If multiple classes exceed threshold, choose the highest probability; if none exceeds it, do not assign that example.
def confident_joint(pred_probs,labels):
  pass
Shift+Enter to run
Quiz
Thirty models drop on a new test but retain nearly the same ranking. What can be concluded?
Numeric
In IRT 2PL, a = 1.5, b = 0.5, and θ = 1. What is the probability of a correct answer?
Quiz
What is a reasonable strategy to reduce several benchmark risks?
Key idea
A score needs a defensible interpretation: audit labels, shortcuts, adaptive selection, and coverage, and check any benchmark-shortening summary on held-out data.