Handwritten digitsยท1,000 training images

Learning digits

Step
0
Phase
Memorising

A small convolutional network learns to read handwritten digits from just 1,000 examples. It starts with deliberately oversized weights, so it memorises its training images within about 2,000 steps, by which point it reads about 78% of unseen digits. Then it stalls, until weight decay shrinks the weights enough to lift it to about 95%.

This is only a weak cousin of grokking. Most of what it learns about unseen digits arrives while it memorises, and only the last stretch comes late. For the real thing, where unseen accuracy stays near zero long after training hits 100% and then suddenly jumps, see the grokking playground.

01Accuracy
TrainUnseen
0%25%50%75%100%1101001,000
02Loss
TrainUnseen
1011e-11e-21e-31101001,000
03Weight norm
05101101001,000
04Telemetry
Train acc
-%
Unseen acc
-%
Weight norm
-
At memorising
-% unseen
Fitting the 1,000 training digits.
05Ask the network
It sees

Draw a digit, or click one in the strip below. The bars update live as it trains. It learned from only 1,000 examples, so unusual styles trip it up: draw 4s open at the top, as most MNIST 4s are.

06Unseen digits

Loading digits...

Test digits the network never trains on. Red frames are ones it reads wrong. Watch the red thin out after the plateau. Click one to see its probabilities.

07Control deck

Mini-batches of 100, AdamW. Training pauses at step 8,000. Try 1x starting weights and restart: it learns unseen digits straight away, with no plateau. The oversized start is what makes it memorise first.

Digits from the MNIST database by Yann LeCun, Corinna Cortes and Christopher J.C. Burges, used under CC BY-SA 3.0. Shrunk to 14x14 pixels. The oversized starting weights follow Liu and others, 'Omnigrok: grokking beyond algorithmic data', 2022.