4.3.12 · D3Pretraining & Fine-Tuning LLMs

Worked examples — Catastrophic forgetting

3,373 words15 min readBack to topic

This page runs the Catastrophic forgetting machinery through every kind of situation you can meet: both signs of a weight, the "zero importance" degenerate case, the limiting values of the knobs and , a real-world LLM word problem, and an exam-style twist. Before any numbers, we lay out the grid of cases so you can see nothing is skipped.

Before we start, one plain-words recap of every symbol that appears in the core formula below — nothing will be used before it is defined here:


The scenario matrix

The grid below has nine cells (C1–C9), one per distinct situation. We cover all nine with eight worked examples — Example 5 deliberately handles the two paired limits C5 and C6 together (they are the two ends of the same dial), so eight examples fill nine cells. Every cell is labelled on the example that hits it.

Cell What varies Question it answers Covered by
C1 Sign of drift: new task pulls weight up () Which way does the spring push back? Ex 1
C2 Sign of drift: new task pulls weight down () Same physics, opposite sign — symmetric? Ex 2
C3 Degenerate: (weight unimportant to old task) Does EWC block learning here? Ex 3
C4 Degenerate: huge (weight critical) Does the weight move at all? Ex 4
C5 Limiting knob: EWC reduces to plain fine-tuning (max forgetting) Ex 5
C6 Limiting knob: EWC reduces to a frozen weight (zero learning on it) Ex 5
C7 Limiting knob: (LR) too big vs small How step size alone changes forgetting Ex 6
C8 Real-world word problem LLM medical fine-tune: pick a mitigation and justify Ex 7
C9 Exam twist Two weights, different — where does spare capacity go? Ex 8

To turn "where does the weight end up" into arithmetic we need one small formula. We derive it once, then reuse it.

Why a weighted average? Two springs fighting over one bead always settle where their pulls cancel — that is exactly a weighted average of their anchor points, weighted by stiffness. The next figure draws exactly this tug-of-war.

Figure — Catastrophic forgetting

Example 1 — Cell C1 (new task pulls the weight UP)

Forecast: guess before computing — is the answer closer to or to ? ( times pulls home, pulls new. Home pulls 3× harder → expect closer to 2.)

  1. Identify the pulls. Home-pull weight ; new-pull weight . Why this step? The equilibrium is a weighted average; we need both weights first.
  2. Plug into the balance point. Why this step? This is the value where the two spring forces exactly cancel — the resting place (the navy dot in figure s01).
  3. Interpret the sign. , so the weight moved up toward the new task, but only a little of the way ( out of the possible). Why this step? Confirms the direction matches C1 (upward drift) and shows the spring resisted most of it.

Verify: slope at : . Why this check? A resting point is exactly where the total slope is flat — the two pulls cancel. Getting confirms is a genuine equilibrium, not just a value we hoped for. ✓


Example 2 — Cell C2 (new task pulls the weight DOWN)

Forecast: by symmetry with Example 1, home pulls 3× harder, so expect a small drop below 2, not a plunge to .

  1. Same weights. , . Why this step? Only the anchor flipped sign; the stiffnesses are unchanged.
  2. Balance point. Why this step? Same formula — the physics is sign-blind; it just averages positions.
  3. Interpret. : the weight drifted down, exactly unit, mirroring the up-case that drifted unit (). Why this step? Shows EWC is symmetric — it resists motion equally in both directions, because the penalty is a symmetric parabola.

Verify: slope at : . Why this check? Zero total slope means the downward new-task pull and the upward spring pull exactly cancel at — so is the true equilibrium, confirming the drift stopped there. ✓


Example 3 — Cell C3 (degenerate: , unimportant weight)

Forecast: is enormous, so it feels like the weight should be locked at 2. But ...

  1. Compute the home-pull. . Why this step? The spring stiffness is both factors matter. Zero importance kills the spring no matter how big is.
  2. Balance point. Why this step? With no old-task spring, the new task wins completely — the weight goes all the way to .
  3. Interpret. The new task learns freely in this weight. This is EWC's "spare capacity": unimportant weights stay fully trainable. Why this step? Directly refutes the myth that EWC "blocks learning".

Verify: slope at : . Why this check? With the spring gone, equilibrium must sit at the new-task minimum; a zero slope there confirms nothing resists the move to . ✓


Example 4 — Cell C4 (degenerate: huge, critical weight)

Forecast: home-pull , new-pull . Expect the weight glued near .

  1. Weights. , .
  2. Balance point. Why this step? The old spring is 1000× stiffer, so the resting place sits essentially on top of .
  3. Interpret. The weight barely budged (from to ). The old skill this weight encodes is protected. Why this step? This is the "critical weight" corner — high overrides the new task's wishes.

Verify: , which is within of . Why this check? An equilibrium pinned to home means the weight essentially did not move; confirming proves the old skill is protected. ✓


Example 5 — Cell C5 & C6 (limiting knobs and )

Forecast: → no springs → plain fine-tuning → full forgetting. → infinitely stiff → frozen at home.

  1. General expression in . Why this step? Keeping symbolic lets us take both limits from one formula.
  2. Limit (Cell C5). . Why this step? No EWC term ⇒ objective is only the new task ⇒ the weight lands on . This IS naive fine-tuning: maximum drift = maximum forgetting.
  3. Limit (Cell C6). Divide top and bottom by : . Why this step? Infinite spring stiffness ⇒ the weight is pinned to ⇒ same as freezing it (parameter isolation). But then the new task learns nothing on this weight.
  4. The trade-off. Between these extremes ( gave in Example 1) is the useful regime. Why this step? Shows is a dial from "forget everything" to "learn nothing".
Figure — Catastrophic forgetting

Verify: at , (matches Example 1). Why this check? The interior value must join the two endpoints continuously; recovering Example 1's at confirms the swept formula and its limits are consistent. ✓ Endpoints: and .


Example 6 — Cell C7 (learning rate alone)

Forecast: small ⇒ tiny drift ⇒ little forgetting; ⇒ jumps straight to the new minimum ⇒ full forgetting in one step.

  1. Gradient at the start. . Why this step? Gradient descent needs the slope; here the slope points strongly toward .
  2. Step with . . Why this step? Small step ⇒ weight only nudged from home ⇒ old skill mostly intact.
  3. Step with . . Why this step? A step of size = curvature lands exactly on the minimum ⇒ maximal drift in a single update.
  4. Interpret. Same task, same start — only differs, and it alone controls how far we drift from . This is why "lower LR, fewer epochs" is a forgetting mitigation. Why this step? Connects the arithmetic to Learning Rate & Optimization.

Verify: ; . Why this check? Drift from home ( vs ) is the forgetting; confirming the two step sizes land at these values shows alone controls how far we leave . ✓


Example 7 — Cell C8 (real-world word problem: LLM medical fine-tune)

Forecast: which fix makes the base weights literally unable to move? That is the only one that can guarantee the score.

  1. Turn the requirement into a number. of points. The naive run's points is far below this, confirming the problem is real. Why this step? "Keep 90%" is vague; a concrete pass/fail threshold () lets us test each option instead of hand-waving.
  2. Score option (c) — lower LR, fewer epochs. From Example 6, a smaller over fewer epochs shrinks the drift from but does not zero it; the coding weights still move some, landing near, say, points. Below — not guaranteed. Why this step? Example 6 already proved only scales drift; it never pins the weight, so no guarantee is possible.
  3. Score option (a) — rehearsal. Mixing general data puts the general/coding loss back into the gradient, pulling the coding weights partway home to roughly points. Better, but the base weights still moved, and — still not a guarantee. Why this step? Rehearsal reduces forgetting (the general loss now defends itself) but cannot certify a floor, since the amount of protection depends on buffer size and mixing ratio.
  4. Score option (b) — LoRA. LoRA freezes every base weight and learns only in small added modules. This is the / Cell C6 corner: for the base coding weights, so they cannot move at all. Why this step? Frozen base weights the original coding pathway is byte-for-byte unchanged the score stays at its pretrained value by construction, not by luck.
  5. Pick (b). Original coding capability sits in frozen base weights, so it holds at , and . Requirement met with margin. ✓ Why this step? Only parameter isolation gives a guarantee; (a) and (c) give reductions that here fall short of the hard floor. Matches the mnemonic "FREEZE the base".

Verify: threshold ; LoRA preserves (pass), rehearsal's (no guarantee), low-LR's (no guarantee). Why this check? The word "guaranteed" demands the option whose preserved score provably clears ; only the frozen-weight case does, so the arithmetic confirms LoRA is the unique correct pick.


Example 8 — Cell C9 (exam twist: two weights, spare capacity)

Forecast: the network should route learning into the free weight (weight 2) and leave weight 1 near home.

  1. Weight 1 balance point. Home-pull , new-pull : Why this step? High importance ⇒ strong spring ⇒ weight 1 barely moves from home (the Cell C4 corner, now inside a two-weight problem).
  2. Weight 2 balance point. Home-pull , new-pull : Why this step? Zero importance ⇒ no spring ⇒ weight 2 goes all the way to its new minimum (the Cell C3 corner).
  3. Interpret — the exam punchline. New-task learning was absorbed almost entirely by weight 2 (, a full 5-unit move) while weight 1 stayed put (, a nudge). EWC did not block learning; it redirected it into the unimportant direction — this is "learning in the spare capacity". Why this step? Directly refutes the classic EWC misconception "the penalty freezes learning", the trap most exam questions set here.

Verify: weight 1: ; weight 2: . Why this check? The two equilibria together show the total 5-unit learning displacement landed almost entirely on the free weight 2 and almost none on the protected weight 1 — confirming EWC redirects rather than blocks learning. ✓


Recall One-line summary of the whole matrix

Every case is one weighted average : sign of drift = sign of (C1/C2); frees the weight (C3, C9-w2); huge pins it (C4, C9-w1); = forget-all, = freeze (C5/C6); alone scales drift (C7); real fixes pick where on this dial to sit (C8).

Where does new-task learning go when a weight has ?
Fully into that weight — the EWC spring vanishes, so it lands on (spare capacity).
What is as ?
It approaches — the weight is effectively frozen (equivalent to parameter isolation).
Why do Examples 1 and 2 drift the same distance?
The EWC penalty is symmetric, so it resists upward and downward motion equally.

Connections

  • Fine-Tuning LLMs — the setting for Example 7.
  • LoRA and Adapters — the / freeze corner (C6, C8).
  • Fisher Information — the that scales every spring here.
  • Laplace Approximation — where the quadratic penalty comes from.
  • Continual Learning — the sequential-task backdrop.
  • Multi-task Learning — the rehearsal ideal in C8.
  • Learning Rate & Optimization — the dial in Example 6.