Fine-tuning

New Tricks

Robo has already practised on thousands of drawn shapes. Now it must learn four new letters, T, L, X and V, from only a few examples. Does all that old practice help? Race three ways of learning and find out.

First, Robo goes to "shape school" right here in your browser. Watch the bar fill up!

Step 1: shape school starting…

Robo studies 4,000 random drawings of these 12 shapes. Its brain learns little "stroke spotters" along the way.

How to play: pick how many letter examples Robo gets, then press Race. All three learners see the same few examples and are tested on 400 new letters they have never seen.

Step 2: the race step 0

The examples every learner gets to study.

From scratch
-
Frozen + new head
-
Gentle fine-tune
-

Score on 400 new letters while practising

from scratch (random brain) frozen old brain + new last layer old brain, everything gently nudged

Step 3: does it help more with few examples?

Robo races all three learners with 5, 10, 20, 30, 40 and 50 examples (two different example sets each) and plots the final scores.

Challenges

Head start: with 10 examples or fewer, race until a learner that kept Robo's old brain beats "from scratch" by 15 points or more.
Big picture: press Try every amount and see the gap between old brain and new brain shrink as examples grow.
Catching up: with 40 examples or more, race 150+ steps. Is "from scratch" now within 12 points of the gentle fine-tune?
Robo reads your hand: draw a letter that the gentle fine-tune learner is at least 70% sure about.

What just happened?

How it works

  1. A computer draws 4,000 wobbly 12 × 12 pictures of 12 shapes: different sizes, tilts, places and pen widths, plus speckles.
  2. Robo's brain (144 dots in → 48 cells → 24 cells → 12 answers) practises on them in small batches for 900 steps.
  3. For the new letters we throw away the last layer and add a fresh one with 4 answers: T, L, X, V.
  4. Three copies race on the same few examples: a random brain, the old brain with only the new layer learning, and the old brain with everything learning slowly (the old layers 10 times slower).
  5. Every few steps, all three take the same test of 400 new letters, and the chart shows their scores.
For grown-ups: what's really going on

This is transfer learning. The base model is an MLP 144 → 48 → 24 → 12 (tanh hidden units, softmax output) pretrained with Adam (lr 0.003, batch 32, 900 steps ≈ 7 epochs) on 4,000 procedurally rendered glyphs of 12 source classes (typically ~95% held-out accuracy). The target task has 4 disjoint classes (T, L, X, V) built from similar strokes, with N labelled examples (round-robin balanced) and a fixed 400-example test set.

  • From scratch: same architecture, fresh random init, Adam lr 0.01, full batch.
  • Linear probe: the 24-d penultimate features are frozen; only a new softmax head Wh ∈ ℝ4×24 is trained. Few parameters, so low variance: often best at the smallest N.
  • Full fine-tune: all weights train from the pretrained init with a new head; body layers use a 10× smaller learning rate (discriminative learning rates) so the useful features are adjusted, not destroyed. It usually overtakes the probe as N grows.
  • The sweep shows sample efficiency: the pretrained init acts like a strong prior, and the advantage shrinks as N grows. Transfer only helps when source and target share structure; for unrelated targets, pretrained features can even hurt (negative transfer).
  • Modern practice is the same recipe at scale: ImageNet- or CLIP-pretrained backbones, or language models, adapted with a probe or fine-tune on a small labelled set.

Everything is seeded (mulberry32), so a given N gives the same race. Your drawing is cropped to its bounding box, centred and averaged down to 12 × 12 before going in. No downloads: all training happens live in this tab.