Catastrophic forgetting
WHY does this happen? (First principles)
A neural network stores everything it knows in one shared set of weights . There is no separate "memory slot" per task — knowledge is distributed and overlapping.
When you fine-tune on a new dataset , you minimize a loss that only mentions the new data:
Gradient descent takes steps:
Nothing in this update references the old task's loss . So the optimizer happily moves out of the region that was good for the old task, as long as it improves the new task. The old skill is collateral damage.
WHAT does it look like?
Imagine two loss landscapes over the same weight vector :
- — a valley whose bottom is the "good at task A" region.
- — a different valley for task B.
Their minima are usually in different places. Pure fine-tuning slides into the new valley, climbing out of the old one.

HOW do we derive a fix? (EWC from scratch)
Goal: train on the new task without leaving the old task's good region. We want that is good on new and stays near the old optimum , but only "stiff" along directions that mattered for the old task.
Step 1 — Bayesian view. After learning the old task we have a posterior . When new data arrives, Bayes says:
Why this step? The old data's influence is fully captured by the posterior — we don't need to keep the old data around, just remember what it told us about .
Step 2 — Approximate the old posterior as a Gaussian (Laplace approximation) centered at with precision given by the Fisher information :
Why this step? Near a minimum any smooth loss looks quadratic; the curvature (2nd derivative) tells us how important each weight was. large ⇒ weight mattered a lot ⇒ don't move it.
Step 3 — Combine into a trainable loss (Elastic Weight Consolidation):
Other mitigation strategies (80/20)
The 20% you must know:
| Method | Core idea | WHY it works |
|---|---|---|
| Rehearsal / Replay | Mix a slice of old data (or generated pseudo-data) into training | The old loss is now in the objective, so gradients defend it |
| EWC / regularization | Penalize moving important weights | Restricts to stay near old optimum along key directions |
| Parameter isolation (LoRA/adapters) | Freeze base weights; add small new trainable modules | Old weights literally can't change ⇒ can't be forgotten |
| Lower LR + fewer epochs | Take smaller steps away from | Less drift out of the old valley |
Steel-manned mistakes
Recall Feynman: explain to a 12-year-old
Imagine your brain is a lump of clay and every skill you learn presses a shape into it. If you learn to ride a bike, then press really hard learning to swim in the same spot, you might squish the bike-shape flat and forget it! Catastrophic forgetting is exactly that — the computer uses one lump of "clay weights" for everything, so pushing hard on a new thing can erase an old thing. To fix it, we either (a) keep practicing the old thing a little (rehearsal), or (b) put little "keep me!" springs on the parts of the clay that hold important old shapes (EWC), or (c) learn the new skill in a fresh piece of clay stuck on the side (adapters/LoRA).
Connections
- Fine-Tuning LLMs — where forgetting bites hardest.
- LoRA and Adapters — parameter-isolation fix.
- Fisher Information — the "importance" in EWC.
- Laplace Approximation — how the Gaussian posterior arises.
- Continual Learning — the broader problem setting.
- Multi-task Learning — the "train everything jointly" ideal EWC/rehearsal approximate.
- Learning Rate & Optimization — smaller LR reduces drift.
Flashcards
What is catastrophic forgetting?
Why does fine-tuning on new data cause forgetting?
Write the EWC loss.
What does the Fisher information represent in EWC?
Why doesn't EWC block all learning?
Name three families of mitigation.
Why does LoRA avoid forgetting by design?
Steel-man: why do more epochs make forgetting worse?
Where does the EWC quadratic penalty come from mathematically?
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, ek neural network ka saara "knowledge" ek hi shared weight vector me stored hota hai — koi alag alag dabba har task ke liye nahi hota. Jab tum ek naye task pe fine-tune karte ho, to loss sirf naye data ko dekhta hai. Gradient descent bas naye task ko achha karne ke liye weights ghuma deta hai, aur purane task ka to naam bhi loss me nahi hai — isliye purani skill "collateral damage" ban jaati hai. Yahi hai catastrophic forgetting: naya seekhte hi purana achanak bhool jaana.
Socho do valleys (ghaati) hain same ke upar — ek old task ke liye, ek new task ke liye, aur dono ke minimum alag jagah pe. Naive fine-tuning ko new valley me sarka deta hai, matlab old valley se bahar nikaal deta hai. Isliye medical data pe LLM fine-tune karo aur woh coding aur maths bhool jaaye — bilkul aam baat hai.
Fix kaise? Teen simple ideas: (1) Rehearsal — thoda purana data mix kardo taaki old loss wapas gradient me aa jaaye. (2) EWC — important weights pe "spring" laga do; Fisher information batata hai konsa weight purane task ke liye zaroori tha, usko hilne mat do. (3) LoRA/adapters — base weights ko freeze karke sirf chhote naye modules train karo, to purana knowledge chhua hi nahi jaata. Yaad rakhne ka mantra: "REPLAY the FIsher, FREEZE the base."
Ek important trap: log sochte hain "zyada epochs = zyada achha." Single task ke liye theek, par sequential learning me zyada epochs ko se aur door dhakelte hain, matlab forgetting badh jaati hai. Isliye LLM fine-tuning me chhota learning rate aur kam epochs rakhna smart move hai.