Benchmark design and contamination
Build comparisons whose workload, quality threshold, measurement boundary, and exposure history support the intended claim.
On this page
The question for today
What you’ll understand
- Choose benchmark boundaries and workload weights explicitly.
- Calculate time to a common quality target.
- Explain why contamination detection is evidence with uncertainty.
A benchmark is an executable argument about what matters. A throughput test assumes that producing more outputs measures progress; a training benchmark must also establish that the outputs meet a quality target. The same optimized system can look excellent on short sequences and poor on long ones. Before comparing scores, specify the task, workload distribution, resource boundary, and acceptable quality. Then ask whether the measurement remains meaningful after researchers repeatedly tune against the public test.
Keep the task fixed while changing the implementation
Define what counts as useful work. For training, time to an agreed validation quality can be more informative than raw steps per second, because an altered optimizer may need more steps. For inference, specify input and output lengths, concurrency or arrival process, latency objectives, and quality constraints. Closed-loop clients that wait for completion change offered load when the server slows. An open-loop arrival process asks a different question and needs explicit handling of queues and dropped requests.
Separate cold-start, compilation, warm-up, and steady-state measurements, then report the combination relevant to deployment. A kernel benchmark excluding transfers is legitimate for studying a kernel, but it cannot establish an end-to-end service gain. Use a strong baseline configured with comparable tuning effort. Record software versions and allowed algorithmic changes so a faster result does not quietly substitute a smaller model, looser tolerance, easier dataset, or lower quality threshold.
Measure a workload mixture without hiding regressions
A single average conceals which workload changed. Publish per-workload results and the weighting rule before combining them. If fractions of total requests are known and each request has one service time, an arithmetic mean estimates expected service time for that mixture. A geometric mean of normalized speedups answers a different comparison question and does not by itself predict fleet capacity. Tail latency requires distributions, not an average of workload means.
Include adversarially inconvenient but representative cases: long contexts, skewed access patterns, sparse batches, and recovery after a failure. Avoid selecting only the workloads where the proposal wins. Distinguish a benchmark intended to isolate a mechanism from one intended to represent production traffic. The former can deliberately simplify conditions, while the latter needs evidence that its workload mixture resembles real demand. Both should state excluded regimes and the consequences of those exclusions.
Treat exposure as part of evaluation history
Contamination occurs when evaluation information influences the system in a way that invalidates the intended independence claim. Exact duplicate examples in training are one route; near duplicates, answer explanations, benchmark-specific instruction tuning, and repeated manual prompt selection are others. Record dataset versions, collection dates, deduplication criteria, and tuning access. A hidden holdout or newly collected temporal test can reduce exposure, but temporal change may also alter task difficulty.
Membership or contamination detectors provide imperfect evidence. A likelihood-based detector can confuse familiar writing style or easy text with training membership, while failing to detect paraphrased exposure. Validate detector sensitivity and false positives on suitable controls rather than treating its score as proof about one example. Report both audited benchmark performance and uncertainty about exposure. If a test has become a development target, build fresh evaluation evidence instead of claiming that secrecy can be restored by renaming the split.
Work it through
Compare training speed at matched quality
Baseline setup takes 120 s and reaches target quality in 1,000 steps at 0.8 s/step. A proposal has 200 s setup and 0.6 s/step but needs 1,300 steps. Which reaches the target first?
Baseline time is 120 + 1,000 × 0.8 = 920 seconds.
Proposal time is 200 + 1,300 × 0.6 = 980 seconds.
The isolated step speedup is 0.8/0.6 ≈ 1.33, yet target-time speedup is 920/980 ≈ 0.939.
The proposal takes 60 seconds longer in this declared boundary. Repeat matched-quality runs and report variability before generalizing the comparison.
The baseline reaches the target sooner despite the proposal's faster steps; algorithmic progress and execution speed must both be measured.
The living notebook
Explore the model
Interactive lab · queue
See how offered load changes backlog
Use arrival λ and service μ in the fluid model max(0, 4 + (λ−μ)t). The separate M/M/1 residence estimate assumes Poisson arrivals and exponential single-server service with λ<μ. This is a load illustration, not a benchmark driver, tail-latency simulator, or contamination detector.
- Fluid backlog
- 4
- Net rate · λ − μ
- −1 /s
- M/M/1 mean residence
- 1 s
Fluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA throughput number without offered load and queue behavior is an incomplete service comparison.
Pause & reason
Check your understanding
Your turn
Try it yourself
A request mixture contains 80% short requests averaging 100 ms and 20% long requests averaging 600 ms. A change gives 80 ms and 900 ms respectively. Compute both mixture means and explain what remains unknown.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Weight each conditional mean by its request fraction; do not average class speedups.
Compare with the solution
The baseline mean is 0.8 × 100 + 0.2 × 600 = 200 ms. The changed mean is 0.8 × 80 + 0.2 × 900 = 244 ms, a 22% increase. These numbers do not determine p99 latency, capacity under a different arrival process, or whether workload proportions remain stable.
Keep the idea
Take it with you
- Compare useful work at a common quality threshold and declared boundary.
- Publish workload slices before an aggregate score hides regressions.
- Audit exposure history and calibrate detectors rather than claiming certainty.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.