Paul's Python CoursePPC

Project 3 of 9, for Paul

Paper Reproduction

Paul's question about what big models really learn: double descent, from a 2019 paper, reproduced in NumPy at a size that runs in seconds. The pieces, the curve, one experiment of your own, and an honest account of what didn't match.

About 20 hours, in 11 steps.

Sign up free to open itLog in

Act 9 needs a free account, so your work is saved as you go. Act 1 is open to everyone.

The brief

  • PaulThis is a paper from 2019 saying the overfitting U from the Model Room is only half right, the first half.
  • PaulPast the point where a model fits every example, the test error comes down again, allegedly.
  • YahyaSo degree eleven was right all along?
  • PaulNo. Well, possibly not. We reproduce it before anybody says anything.
  • PaulMake it small enough to run twice, and then actually run it twice.

Belkin, Hsu, Ma and Mandal, "Reconciling modern machine-learning practice and the classical bias-variance trade-off", Proceedings of the National Academy of Sciences 116 (32), 2019.

The claim: as a model gets more parameters, its test error first follows the classical U, falling and then rising to a peak where the model can only just fit every training example. Past that point, if the fit with the smallest norm is chosen, the error falls again, often below the bottom of the U. They called it double descent.

Reproduce it at a size that runs in seconds:

  • data made from a known answer: ten random inputs per example, the answer tanh of their scaled sum, plus noise; 40 training examples and 400 test examples
  • random features, the paper's first model, but with ReLU in place of its sines and cosines: fixed random weights that are never trained, then the smallest-norm least-squares fit on top
  • widths from 1 to 2000 features, ten seeds each, and the median test error at each width
  1. The pieces: descent.py, checked.
  2. The curve: reproduce.py, checked, with your own tests in test_descent.py.
  3. The claim in your words, and what would count as reproducing it.
  4. The main figure.
  5. One thing the paper didn't try.
  6. The write-up, with an honest account of what didn't match.
What it prints
features  test error
       1       0.612
       2       0.603
       5       0.498
      10       0.435
      15       0.399
      20       0.572
      30       1.141
      35       1.476
      40      46.300
      45       2.147
      50       1.002
     ...
    2000       0.312

What you learn

What's in it

  1. The claim
  2. The smallest fit
  3. Make the pieces
  4. The same numbers, twice
  5. Make the curve
  6. Milestone 1: the claim, in your words
  7. Milestone 2: the main figure
  8. Milestone 3: one thing the paper didn't try
  9. Milestone 4: the write-up
  10. Ship it