Don't Forget!
Robo learned Job A: colour the dots on the left. Now it practises Job B on the right, where the colours go the other way. Will it still remember Job A afterwards?
Robo is learning Job A right now…
How to play: press Learn Job B and watch the Job A line on the chart. Then change the helpers on the right, press Rewind and try again.
What Robo thinks -
bluered● Job A dots (left) · ■ Job B dots (right) · ringed = saved in the notebook
Job A (old job)
-
Job B (new job)
-
Scores on new test dots
Job AJob Bfaint lines = your previous try
Challenges
Oops: with no helpers, learn Job B and watch Job A drop below 50%.
Notebook power: use replay to keep Job A above 85% while Job B gets above 90%.
Rubber bands: with replay at 0%, use EWC to keep Job A above 85%. What happens to Job B?
Is freezing enough? Freeze the first layer (no other helpers) and learn Job B.
What just happened?
- Robo has one brain for both jobs. Practising only Job B nudges every knob towards Job B, and nothing says "keep Job A working". So Job A falls apart: catastrophic forgetting.
- Replay mixes a few old dots into practice. Now every nudge has to keep both jobs happy, and Robo learns a map that does both.
- EWC ties the most important knobs with rubber bands. Strong bands save Job A, but if they are too strong Robo cannot learn Job B. It is a balancing act.
- Freezing just the first layer does not help much here: the later layers still flip the colours.
- A smaller learning speed only slows the forgetting. Practise long enough and it still happens.
How it works
- Job A: 160 dots on the left, blue above a wavy line. Job B: 160 dots on the right, blue below the line.
- Robo's brain (2 → 24 → 24 → 2) practises Job A for 400 small batches.
- Robo copies 30 Job A dots into a notebook and remembers which knobs mattered most.
- Then it practises Job B in batches of 32 dots, with the helpers you chose.
- Every few steps it is tested on 400 fresh dots from each job.
For grown-ups: what's really going on
Catastrophic forgetting (McCloskey & Cohen, 1989): sequential gradient descent on task B moves shared weights with no constraint from task A's loss. The model is an MLP 2 → 24 → 24 → 2 (tanh, softmax), Adam, batch 32; task A is trained for 400 steps at lr 0.01, then task B begins from those weights (Adam state reset).
- Experience replay / rehearsal: a buffer of 30 task-A examples; a fraction p of each batch is drawn from it.
- EWC (Kirkpatrick et al., 2017): add
(λ/2)·Σi Fi(θi − θ*A,i)². Here F is the diagonal empirical Fisher (mean squared per-example gradient of log p(y|x) over task-A data), normalised to mean 1; slider λ ∈ {0, 1, 3, 10, 30, 100}. The penalty gradient is added before the Adam update. - Freezing the first layer keeps low-level features but leaves the head free to overwrite task A. Lower learning rates just delay the drift.
- The same tension appears when fine-tuning large models (losing general skills after narrow fine-tuning). Common fixes: mixing in pretraining data, regularising towards the base (KL or L2), and parameter-efficient methods like LoRA.