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
- 31Benchmark metric as an estimatorMulti-method multi-dataset comparisonConfounders in ML experimentsClustered standard errors for evals
- 13Adaptive data analysis and the reusable holdoutSpurious correlations and shortcut learning
- 20Benchmark contaminationContamination detection
- 11Logistic regressionLogistic loss as Bernoulli likelihood
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.
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.
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 for candidate true class and observed label . A per-class threshold can be estimated as the mean of among examples with . 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.
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 , difficulty , and positive discrimination ,
At probability is 0.5; large makes the transition around steeper. Fisher information for on an item is , maximal for that item near its difficulty. Selecting highest information at 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.
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.
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)))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.
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 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.
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.
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 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.
for _ in range(2):
theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:])for _ in range(2):
theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:])for _ in range(2):
theta,loga,difficulty,diag=irt_step(theta,loga,difficulty,Y);history.append(diag)
print(history[-2:])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 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.
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
def confident_joint(pred_probs,labels):
pass