Foundations to Frontier
Tests
O. Research Skills › O2 Doing Research

Reproducing Papers

Reproducing a paper means obtaining its reported results again by following its description, ideally with its code and data. It is the most direct check of a result, and the usual first step in building on one. Reproductions fail mostly for mundane reasons: hyperparameters not reported, defaults that changed between library versions, details of the implementation never written down, and results reported from the best seed. The exercises simulate 1,000 papers whose methods have five hyperparameters of different sensitivity and measure how often a reproduction lands within one point of the reported number as fewer settings are reported: from about 80% with all five to 3% with none, and how much a small random search recovers. Practice problems cover how many seeds a verdict needs, best-seed reporting, which settings matter most, search budgets, and library versions.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Following the recipe

A paper is a recipe for a result. Reproducing it shows whether the recipe is complete and the result real. When a reproduction falls short, the cause is usually a missing ingredient: a learning rate or schedule not reported, a library default that has since changed, a preprocessing step left out of the text, or a reported number that was the best of several runs.

🎮 Research lab

1,000 simulated papers with five hyperparameters. Share of reproductions within 1 point of the reported accuracy, by how many settings the paper reports (library defaults for the rest):

all five
79.9%
three
45.0%
learning rate only
9.3%
none
3.1%

Even with every setting reported, one reproduction in five fails here: 30% of reimplementations differ in an unreported detail. Releasing code closes that gap.

Why engineers care

In Exercise 2, reproductions came within one point of the reported accuracy for 79.9% of papers that reported all five hyperparameters, 45.0% of those reporting three, and 3.1% of those reporting none; a random search of 20 runs raised the last two to 75.4% and 17.1%.

📝 Quick check (Level 0)
0/3 answered
  1. 1. The most common cause of failed reproductions is…
  2. 2. Reporting the best of several seeds makes faithful reproductions…
  3. 3. Releasing code mainly closes the gap from…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Reproducible: the same results from the same data and code (or the same description); replicable: consistent results from new data (US National Academies, 2019).
  • Sources of failure: unreported hyperparameters and schedules, preprocessing, data versions and splits, library versions and defaults, hardware nondeterminism, best-run reporting, and errors in the paper or the code.
  • Reproduction plan: read the paper three times (topic O1-2), list every setting, find code and data, contact the authors, run the original code first if it exists, then reimplement.
  • Verdict: compare means over several seeds with an interval (topic O2-5), not a single run against a single number.
  • Report: what was tried, what differed, what matched; reproductions are publishable (ML Reproducibility Challenge, ReScience).
📝 Quick check (Level 1)
0/3 answered
  1. 1. Consistent results from new data are called…
  2. 2. Before reimplementing, a reproducer should first…
  3. 3. A reproduction verdict should compare…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Simulating reproductions

Exercise 1.

  • Each paper’s method has five hyperparameters on a 0-to-1 scale with a best setting: learning rate, epochs, weight decay, batch size and warmup, losing 40, 20, 10, 5 and 2 points at distance 1; the best learning rate also shifts with batch size.
  • Library defaults sit at 0.5; runs vary with the seed (standard deviation 0.4).
  • A paper reports the mean of 3 seeds at its best setting.

Practice.

  • List every setting the result depends on, and check which the paper reports.
  • Run the original code first if it exists; pin library versions and record them.
  • Search the unreported settings with a modest budget, starting with the sensitive ones.
  • Use several seeds on each side before declaring success or failure.
  • Ask the authors, and report what you learn.
h = DEFAULT.copy(); h[:k] = paper.best[:k]       # reported settings
if search:
    cand = tile(h, 20); cand[:, k:] = random((20, 5 - k))
    h = cand[argmax(runs(paper, c, seeds=1) for c in cand)]
result = runs(paper, h, seeds=3).mean() - hidden_difference
success = abs(result - reported) <= 1.0
🐍 Exercise 1: what each setting is worth
Simulate 2,000 papers and measure the accuracy lost when each hyperparameter, or all five, is left at the library default.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Leaving the learning rate at its default cost on average…
  2. 2. With one seed per side in Practice 1, a reproduction with a 1.5-point bug passed as a match…
  3. 3. Reproductions with a newer library version in Practice 5 succeeded…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

What a default costs. If a paper’s best setting b of a hyperparameter is uniform on [0.1, 0.9] and the default is 0.5, the expected squared distance is the variance 0.8²/12 = 0.053, so a weight of w points costs about 0.053w on average: 2.1 points for the learning rate (w = 40), 0.1 for warmup (w = 2).

Search grows with the unknowns. A random trial lands within δ of the best setting in each of u unknown dimensions with probability (2δ)^u, so T trials find such a point with probability 1 − (1 − (2δ)^u)^T. Each extra unknown divides the chance per trial by 1/(2δ): 20 trials are plenty for two unknowns and too few for four.

Best-seed reporting. The best of 5 runs exceeds their mean by about 1.16σ: 0.46 points for σ = 0.4. A faithful reproduction that averages its runs starts that far behind.

How many seeds for a verdict. The difference between a reproduction and the paper, each averaging s seeds, has standard deviation σ√(2/s): 0.57 for s = 1 and 0.18 for s = 10. With one seed, a 1.5-point discrepancy falls within one point of zero about one time in five.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Expected squared distance between a uniform [0.1, 0.9] best setting and a default of 0.5 is…
  2. 2. The best of 5 runs exceeds their mean by about…
  3. 3. The standard deviation of a difference of two single runs with σ = 0.4 is about…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

How often does a reproduction recover a paper’s reported result, as a function of how many hyperparameters the paper reports and how the reproducer fills the gaps?

History.

  • J. Claerbout (1992) and J. Buckheit and D. Donoho (1995) argued that a computational paper is only an advertisement; the real scholarship is the code and data that produce its figures.
  • O. E. Gundersen and S. Kjensmo (2018) found that few AI papers shared their code or data; E. Raff (2019) independently reproduced 63.5% of 255 machine-learning papers and found that reported hyperparameters and paper readability predicted success.
  • The NeurIPS reproducibility program (J. Pineau and colleagues, from 2019) introduced a checklist and a code-submission policy; the ML Reproducibility Challenge publishes reproduction reports.
  • The US National Academies (2019) separated reproducibility (same data and code) from replicability (new data).

Exercise 2.

  • 1,000 simulated papers; each reports the mean of 3 seeds at its best setting.
  • The reproducer is given all five settings, three (learning rate, epochs, weight decay), the learning rate only, or none; the rest are set to library defaults or chosen by a random search of 20 single-seed runs. With probability 0.3 the reimplementation also differs in an unreported detail costing 0.5 to 2 points.
  • Success: the mean of 3 seeds within 1 point of the reported accuracy.

Seed 0:

settings reported defaults for the rest random search of 20 for the rest
all five 79.9% (shortfall 0.36) —
three 45.0% (1.31) 75.4% (0.60)
learning rate only 9.3% (2.91) 36.2% (1.43)
none 3.1% (5.24) 17.1% (2.19)

Seeds 1 and 2: all five 81.6% and 78.5%; three with defaults 43.1% and 43.7%, with search 74.2% and 73.7%; learning rate only with search 37.3% and 39.6%.

Findings.

  • Each unreported setting lowered the success rate, from about 80% with all five to 3% with none, in all seeds.
  • Reporting only the learning rate was worse than it looks: its best value depended on an unreported batch size.
  • A random search of 20 runs recovered much of the loss for two unknowns but little for five.
  • About one reproduction in five failed even with every setting, because of implementation details: releasing code is what closes that gap.
🐍 Exercise 2 (research): how often does a reproduction recover a paper's reported result, as a function of how many hyperparameters the paper reports and how the reproducer fills the gaps?
Simulate 1,000 papers and reproductions given different numbers of reported hyperparameters, filling the gaps with defaults or a random search.

Reproducing papers in practice

  • Start from the authors’ code when it exists (Papers with Code links many); pin its library versions in an environment file or container.
  • Make a table of every setting from the paper, appendix and code, and mark the ones you had to guess.
  • Compare distributions: several seeds on each side and an interval for the difference.
  • Publish your reproduction, with code, in the ML Reproducibility Challenge or ReScience C; contact the authors with discrepancies.
  • Make your own work reproducible: release code, configuration files, seeds, data splits and environment versions.

References

  1. J. B. Buckheit and D. L. Donoho (1995). “WaveLab and reproducible research.” Wavelets and Statistics, Springer.
  2. O. E. Gundersen and S. Kjensmo (2018). “State of the art: reproducibility in artificial intelligence.” AAAI.
  3. E. Raff (2019). “A step toward quantifying independently reproducible machine learning research.” NeurIPS.
  4. J. Pineau and colleagues (2021). “Improving reproducibility in machine learning research.” Journal of Machine Learning Research.
  5. National Academies of Sciences, Engineering, and Medicine (2019). Reproducibility and Replicability in Science. National Academies Press.