Skip to main content
#ai-benchmark#model-evaluation#statistics#metrics

AI Benchmark 02 β€” The mathematics of accuracy, F1, Elo and AUC

Compute confusion-matrix metrics, relative ratings and areas under curves, and distinguish their units.

Series map

AI Benchmark

8 of 40 chapters published Β· Six parts

Part I. Evaluation foundations 6/6
  1. 01 How do we measure AI intelligence?
  2. 02 Accuracy, Precision, Recall, F1, Elo, AUC
  3. 03 Pass@k, Pass^k, confidence intervals and repeated trials
  4. 04 Evaluation Harness, Scaffold, Verifier
  5. 05 Contamination, reward hacking and evaluation bias
  6. 06 Artificial Analysis Index and Vals Index
Part II. Knowledge, reasoning and mathematics 2/7
  1. 07 MMLU, MMLU-Pro, GPQA Diamond
  2. 08 GSM8K, MATH, AIME, MathArena Apex
  3. 09 Humanity's Last Exam and HLE-Diamond Β· Planned
  4. 10 ARC-AGI 1 & 2 and novel rule induction Β· Planned
  5. 11 CritPt, ProofBench, MysteryMechanism, RiemannBench Β· Planned
  6. 12 AA-Omniscience, SimpleQA and hallucination evaluation Β· Planned
  7. 13 IFEval, IFBench, ComplexConstraints Β· Planned
Part III. Coding and autonomous research 0/8
  1. 14 HumanEval, MBPP, LiveCodeBench, Codeforces Β· Planned
  2. 15 The SWE-bench family Β· Planned
  3. 16 DeepSWE, FrontierCode, FrontierSWE Β· Planned
  4. 17 Terminal-Bench 1–4 and execution environments Β· Planned
  5. 18 CursorBench, SWE-sweep, SWE Marathon Β· Planned
  6. 19 Vibe Code, ProgramBench, NL2Repo, Code Migration Β· Planned
  7. 20 PMPP-Hard and GPU kernel optimization Β· Planned
  8. 21 MLE-Bench, NanoGPT, PostTrainBench and scientific research Β· Planned
Part IV. Agents and professional work 0/8
  1. 22 BrowseComp, DeepSearchQA, WANDR Β· Planned
  2. 23 BFCL, MCP Atlas, Toolathlon Β· Planned
  3. 24 Ο„-bench, AgentBench, EnterpriseOps-Gym Β· Planned
  4. 25 WebArena, OSWorld, ScreenSpot Β· Planned
  5. 26 GDPval, AA-Briefcase, JobBench, Agents' Last Exam Β· Planned
  6. 27 Finance Agent, AA-AnalystAgent, Diligence, Tax Β· Planned
  7. 28 AutomationBench, Remote Labor Index, LifeVal Β· Planned
  8. 29 METR Time Horizon, Vending-Bench and long-horizon autonomy Β· Planned
Part V. Vision, memory and robotics 0/8
  1. 30 MMMU-Pro, MathVision, PerceptionBench Β· Planned
  2. 31 OmniDocBench, OCRBench, GDP.pdf, OfficeQA Β· Planned
  3. 32 Chartography, CharXiv, BabyVision, ZeroBench Β· Planned
  4. 33 ScreenSpot-Pro, GroundingME, SAGE Β· Planned
  5. 34 MuirBench, LVBench, Blender-VideoBench, Code2Video Β· Planned
  6. 35 LongBench, MRCR, GraphWalks, AA-LCR Β· Planned
  7. 36 LongMemEval, BEAM and long-term memory Β· Planned
  8. 37 BenchCAD, RoboDojo, VLA, Decision models Β· Planned
Part VI. Safety and practice 0/3
  1. 38 FORTRESS, StrongREJECT, HoneyBench, Misbehavior Β· Planned
  2. 39 AgentDojo, prompt injection, safety and risk evaluation Β· Planned
  3. 40 Build your own AI agent benchmark harness Β· Planned

Accuracy of 90%, F1 of 0.8, Elo of 1300 and AUC of 450 measure different quantities. This chapter calculates their denominators, units and directions and establishes when comparisons are meaningful. Numbers below are illustrative unless explicitly sourced.

#1. Start with a confusion matrix

Consider a harmful-request detector. Positive means an actually harmful request. Aggregate predictions for 100 tasks.

Actual / predictedHarmfulBenign
HarmfulTP = 30FN = 10
BenignFP = 5TN = 55
Accuracy=TP+TNTP+FP+TN+FN=85100=0.85\mathrm{Accuracy}=\frac{TP+TN}{TP+FP+TN+FN}=\frac{85}{100}=0.85
Precision=TPTP+FP=3035β‰ˆ0.8571\mathrm{Precision}=\frac{TP}{TP+FP}=\frac{30}{35}\approx0.8571
Recall=TPTP+FN=3040=0.75\mathrm{Recall}=\frac{TP}{TP+FN}=\frac{30}{40}=0.75

Precision asks what fraction of predicted positives are actually positive. Recall asks what fraction of actual positives were detected. In safety-sensitive tasks, FN and FP have asymmetric costs. A system that refuses everything may obtain 100% recall for harmful requests but also blocks benign requests.

#2. F1 and averaging

F1 is the harmonic mean of precision and recall.

F1=2PRP+R=2TP2TP+FP+FN=6075=0.8F_1=\frac{2PR}{P+R}=\frac{2TP}{2TP+FP+FN}=\frac{60}{75}=0.8

Specify what happens when a denominator is zero. Across classes or tasks, Macro F1 (mean of per-class F1), Micro F1 (aggregate TP, FP and FN first), and Weighted F1 (average weighted by support) differ.

For example, if a model answers 9 of 10 questions in domain A and 45 of 90 in domain B correctly, overall accuracy is 54%, whereas the equal-domain average is 70%. The appropriate aggregation depends on the target distribution. See the scikit-learn metric documentation for averaging and zero-denominator options.

#3. Elo β€” relative comparison, not accuracy

Suppose two models generate artifacts for the same task and a judge compares them. In the standard Elo model, A’s expected score (a tie is worth 0.5) is:

EA=11+10(RBβˆ’RA)/400E_A=\frac{1}{1+10^{(R_B-R_A)/400}}

If A is rated 1400 and B 1200, E_A is about 0.7597. With K=32, an A win gives the following updates.

RAβ€²=RA+K(SAβˆ’EA)β‰ˆ1407.69R_A'=R_A+K(S_A-E_A)\approx1407.69
RBβ€²=RBβˆ’K(SAβˆ’EA)β‰ˆ1192.31R_B'=R_B-K(S_A-E_A)\approx1192.31

This is a relative expected score within an evaluation pool, not accuracy on a particular exam. Opponents, judges, rating anchors, order bias and tie treatment matter. Consult the specific official rating methodology for GDPval-AA and AA-Briefcase. The update above is a pedagogical standard Elo example.

Before fitting Elo ratings to pairwise comparisons, swap the answer order and check whether the same answer still wins. Suppose a judge picks the first response when shown A, B and again when shown B, A. Each answer earns one win, yet these votes tell us little about a preference for its content. Recording agreement under order reversal and the tie rule alongside win rate makes this behavior visible. Stanford CS329Z lecture on judge bias

#4. AUC has multiple meanings

ROC-AUC is the area under the curve of TPR against FPR as the classification threshold varies. With ties accounted for, it relates to the probability that a random positive receives a higher score than a random negative. PR-AUC and Average Precision are related but not identical, and depend on class prevalence.

A time-performance AUC has different units. In a hypothetical experiment, scores at 0, 2, 4, 6, 8 and 10 hours are 0, 20, 35, 50, 60 and 70. Assuming linear interpolation, trapezoidal integration gives:

Aβ‰ˆβˆ‘j=15(tjβˆ’tjβˆ’1)sj+sjβˆ’12=400A\approx\sum_{j=1}^{5}(t_j-t_{j-1})\frac{s_j+s_{j-1}}{2}=400

The unit is score-hours. Do not read 400 as 400% accuracy. The PMPP-Hard AUC (0–10h) in the Inkling model card must be read with its time budget. Do not assume its integration and performance curve match this illustrative calculation without checking its protocol.

#5. Compute the metrics in Python

This code computes the confusion-matrix metrics and illustrative AUC without external libraries. For real data, additionally validate sampling, weights, zero denominators and time intervals.

tp, fp, fn, tn = 30, 5, 10, 55
accuracy = (tp + tn) / (tp + fp + fn + tn)
precision = tp / (tp + fp)
recall = tp / (tp + fn)
f1 = 2 * tp / (2 * tp + fp + fn)

t = [0, 2, 4, 6, 8, 10]
s = [0, 20, 35, 50, 60, 70]
auc = sum((b-a)*(x+y)/2
          for a, b, x, y in zip(t, t[1:], s, s[1:]))
print(accuracy, precision, recall, f1, auc)
# 0.85 0.857142857... 0.75 0.8 400.0

Exercise: on a 100-sample test with only one positive, predicting negative for everything gives 99% accuracy and zero recall. Decide which failures must not be overlooked before choosing a metric.

#References

Connect