Worked examples — Continual and lifelong learning
This is a worked-examples deep dive for 6.5.7 Continual and lifelong learning. The parent note built the ideas (EWC, replay, progressive nets, forgetting metrics). Here we drill them: we enumerate every case a continual-learning problem can throw at you, then solve one example per case, guessing first, computing carefully, and checking the answer.
Every symbol below was defined in the parent. If you forgot one:
Recall Quick symbol refresher
- ::: the vector of all network weights (one number per knob).
- ::: the loss (error) on task for weights — smaller is better.
- ::: Fisher information of weight — how much task performance reacts if you nudge weight . Big = important weight.
- ::: the total number of tasks in the stream. Task indices run .
- ::: accuracy on task measured after finishing training through task .
- ::: backward transfer; negative means we forgot task .
The scenario matrix
Think of a continual-learning problem as a machine with dials. Each dial has extreme settings, and each combination is a "cell" you must be able to handle. This table lists every cell class this topic contains. Each row maps one-to-one to exactly one example.
| # | Case class | The "extreme / sign" being tested | Example that hits it |
|---|---|---|---|
| C1 | Forgetting sign: negative | model got worse on old task → | Ex 1 |
| C2 | Forgetting sign: positive (backward transfer) | model got better on old task → | Ex 2 |
| C3 | Forgetting sign: zero (no change) | model untouched → | Ex 3 |
| C4 | Zero / degenerate input | an unimportant weight, | Ex 4 |
| C5 | Large limit | huge or → total rigidity | Ex 5 |
| C6 | EWC full numeric | compute the penalty term end-to-end | Ex 6 |
| C7 | Replay sampling probability | reservoir sampling, "every example equal" | Ex 7 |
| C8 | Replay budget split | buffer allocation across tasks | Ex 8 |
| C9 | Real-world word problem | self-driving / medical stream | Ex 9 |
| C10 | Architecture: parameter count growth | progressive nets, cost vs. zero forgetting | Ex 10 |
| C11 | Exam twist | which method fails, and why | Ex 11 |
The figures below carry the arguments; every example that needs geometry points at a specific coloured curve.
Figure 1 — EWC penalty bowls. The red narrow bowl is an important weight (large Fisher); the green wide bowl is a free weight (tiny Fisher). Referenced by Ex 4 and Ex 5.

The examples
Ex 1 — Negative backward transfer (cell C1)
Forecast: guess — did task 1 get worse? By roughly how much?
- . Why this step? BWT compares final accuracy (after all tasks, and here the total number of tasks is ) to the accuracy right when the task was first mastered. The sign tells us: catastrophic forgetting happened.
- Average forgetting uses the peak accuracy, not the first: for task , take .
- Task 1: peak over is ; final is → forgetting .
- Task 2: peak over is ; final is → forgetting . Why max, not first? Because a task might briefly improve before it decays; forgetting is loss relative to the best we ever had.
- Average . With this is . Why ? We average over the old tasks (task itself cannot be forgotten yet), so the denominator is .
Verify: BWT is a single before/after difference, so it should be within : ✓. Average forgetting is a mean of non-negative numbers here, all : ✓.
Ex 2 — Positive backward transfer (cell C2)
Forecast: could learning task 2 make task 1 better?
- . Why this step? Same formula as before — nothing special. The novelty is the positive sign.
- Interpret: positive BWT = backward transfer. Task 2 taught a feature (say, better edge detectors) that also helped task 1. This is the dream of transfer flowing backward in time.
Verify: so the difference must be positive ✓, and so it's a plausible small gain, not a bug.
Ex 3 — Zero backward transfer, the "no change" edge case (cell C3)
Forecast: is BWT ever exactly ? Guess what design would guarantee it.
- . Why this step? Same subtraction — but the two numbers are identical, so we land on the boundary between forgetting () and backward transfer ().
- Interpret: exactly zero means task 1 was neither harmed nor helped by learning task 2. This is the degenerate middle case the sign axis must cover.
- Which family guarantees it? Architecture-based methods (e.g. progressive nets) freeze task 1's parameters, so task 1's forward pass is byte-for-byte unchanged → by construction (no better, no worse). Regularization and replay only approximate zero.
Verify: sits exactly on the boundary , neither nor ✓. Consistent with "frozen weights ⇒ identical predictions ⇒ identical accuracy" ✓.
Ex 4 — A degenerate (unimportant) weight (cell C4)
Forecast: big penalty or tiny? Guess before computing.
- EWC penalty for one weight is . Why this term? It is the quadratic Taylor bowl approximating the old loss — steepness set by .
- Plug in. Why this step? We substitute the given numbers and expand the squared distance explicitly so no intermediate is hidden:
- distance ,
- squared ,
- penalty . Wait — that's not tiny! But compare it against a truly important weight (Ex 5). Here is small, so per unit of movement the cost is small; it only got large because we moved a huge distance.
- Per-unit cost: per unit². Why divide out the distance? To separate "how stiff" (the factor) from "how far we moved" (the ). For an important weight with that same factor is — 400× stiffer. That's the point of Fisher: it lets free weights roam while pinning important ones.
Verify: the bowl is symmetric, so moving or costs the same: ✓. In Figure 1 this weight is the green wide bowl — its shallow slope near means cheap movement, matching the small per-unit factor.
Ex 5 — Limiting case: rigidity as (cell C5)
Forecast: closer to (old) or (new)? Guess the fraction.
- Total objective: . Set derivative to zero. Why this step? Two springs pull : the new-task spring (stiffness ) toward , the old-memory spring (stiffness ) toward . The minimum is the balance point. In Figure 1 the old-memory spring is the steep red bowl centred at ; the new-task spring is shallow.
- Take the derivative and set it to zero: .
Now unpack the algebra step by step (this is the WHY):
- Expand: .
- Collect the terms on the left, constants on the right: .
- Divide both sides by : Why is this a weighted average? Each spring "votes" for its own target ( or ) with weight equal to its stiffness ( or ). The result is the stiffness-weighted mean — the stiffer spring wins.
- Plug in: .
- Limit: as , the old-memory weight dominates the average, so exactly. The old memory spring is so stiff the new task barely moves it — total stability, zero plasticity. That is the extreme end of the stability–plasticity dilemma.
Verify: the result must lie between the two targets and (a convex combination): ✓. It sits far nearer because ✓.
Ex 6 — Full EWC penalty across all weights (cell C6)
Forecast: which of the three weights dominates the penalty?
- Compute each term with the shared factor .
Why per-term? The penalty is a sum of independent bowls — one per weight (diagonal Fisher) — so we can add them separately.
- : .
- : .
- : .
- Total .
- Notice moved the most (0.5) yet costs the least (31.25). EWC "forgives" big moves in unimportant directions — exactly what we want for plasticity.
Verify: total must equal sum of parts ✓; every term since it's a square times positive ✓.
Ex 7 — Reservoir sampling probability (cell C7)
Forecast: early examples get overwritten a lot — will #37's survival be much below ?
- The rule. When example arrives (with ), we keep it with probability ; if kept, it evicts a uniformly random current occupant. Why this rule at all? We want to end with a uniform random subset of size without knowing in advance — this is the only rule that keeps the buffer uniform at every step.
- Why the survival math cancels — the intuitive derivation. Example #37 enters the buffer immediately (since ). Now walk forward. When example arrives it is accepted with probability , and if accepted it kicks out a random one of the 500, so #37 dies with probability — i.e. #37 survives step 501 with probability . In general #37 survives step with probability .
- Multiply all survival steps from to : This is a telescoping product: every numerator cancels the previous denominator, leaving only the first numerator and last denominator: That is the "cancel perfectly" claim, now shown explicitly: being accepted early (advantage) is exactly balanced by facing more eviction rounds (disadvantage), and telescoping proves it equals for every index.
Verify: ✓. Because the product telescopes to regardless of the starting index, example #9000 also gets — uniform, as Figure 2 shows.
Figure 2 — reservoir vs. naive keep-first. The flat orange line at height is reservoir sampling: same survival probability for early and late examples. The dashed gray curve is a naive "keep the first 500" scheme whose survival collapses for later examples — the bias reservoir sampling fixes.

Ex 8 — Replay budget split across tasks (cell C8)
Forecast: guess how many task-1 examples get evicted.
- Equal split over 3 tasks: per task. Why this step? Equal rehearsal time per task keeps forgetting balanced — no task starves, so no old task decays for lack of reminders.
- Task 1 currently has 400, target 200 → drop . Task 2 has 200, target 200 → keep all. Task 3 needs to fill 200 fresh slots. Why drop exactly this many? The buffer is a fixed 600 slots; to make room for task 3's 200 slots while leaving task 2 untouched, the over-represented task 1 must shed exactly the surplus .
- Check total: , which equals the buffer size — no overflow, no wasted slots. The 200 slots freed by task-1 eviction exactly refill task 3's 200 slots.
Verify: kept ✓; dropped from task 1 ✓; freed slots exactly refill task 3's ✓.
Ex 9 — Real-world word problem (cell C9)
Forecast: replay is blocked — which family survives the privacy constraint?
- Forgetting on A (a ). Why this step? Same before/after subtraction as Ex 1 — the metric doesn't care about the domain.
- Constraint check: raw replay (Catastrophic Forgetting fix #2) needs stored A scans → forbidden by privacy. So choose either:
- Regularization (EWC): stores only weights + Fisher, no patient data. Legal.
- Generative replay: a generator makes synthetic A-like images; no real scans stored. Also legal, and links to Knowledge Distillation when you distill old outputs.
- Recommendation: EWC or generative replay; raw experience replay is ruled out.
Verify: forgetting ✓; it is positive because , confirming a genuine drop ✓.
Ex 10 — Progressive nets: parameter growth (cell C10)
Forecast: does cost grow linearly or quadratically in ?
- Column adds base params plus lateral params (connects to all earlier columns). Why this step? Lateral connections exist for every earlier column — that is what reuses old frozen features with zero forgetting.
- Total .
- Plug in: . The lateral part grows quadratically — the price of guaranteed no-forgetting. This motivates Neural Architecture Search to prune.
Verify: ✓; total ✓.
Ex 11 — Exam twist: which method fails? (cell C11)
Forecast: which single method survives an unbounded task stream with a hard memory cap?
- Progressive nets: add a column per task → params grow (at least) linearly, laterals quadratically (Ex 10). With thousands of tasks and a memory cap this explodes → infeasible. Failure mode: unbounded parameter growth. Why? No mechanism ever frees old columns.
- Experience replay: fixed buffer spread over thousands of tasks → each task gets examples. Failure mode: rehearsal starves as grows; forgetting creeps back.
- EWC — does it survive? Yes, on memory. It stores only and the diagonal Fisher — a fixed-size vector, so its footprint is constant in (does not grow with the number of tasks). This is why EWC is the only one of the three that fits the hard memory cap for an unbounded stream.
- EWC's subtler failure mode. Feasible on memory does not mean flawless. Each new task adds another Fisher-weighted penalty term, and these penalties accumulate and stack. As more and more directions become "important", the summed rigidity keeps rising until the network hits the total-rigidity limit of Ex 5 ( weights pinned). At that point plasticity dies: the model can no longer learn new tasks even though it never forgot. So EWC's failure mode is creeping loss of plasticity, not memory blow-up.
- Verdict. Ranking (best → worst for this exact setting): EWC > Replay > Progressive nets.
- EWC: survives the memory cap; fails eventually by saturating rigidity (loses plasticity).
- Replay: fails gradually as per-task rehearsal .
- Progressive nets: fails immediately via parameter explosion. Escaping EWC's rigidity trap is exactly what Online Learning and Meta-Learning approaches target.
Verify: the claim: with , , per-task share example — effectively nothing ✓. EWC memory is independent of ✓.
Recall Self-test
BWT sign that means forgetting? ::: negative. BWT exactly zero means, and which family guarantees it? ::: no change on the old task; architecture-based (frozen weights). A weight with under EWC is... ::: free to move (unimportant), tiny penalty. As , EWC keeps the weight at... ::: its old value (pure stability). Reservoir sampling gives each of examples buffer probability... ::: , because the survival product telescopes regardless of arrival time. Progressive-net lateral connections grow how in ? ::: quadratically, . Which family survives an unbounded task stream with fixed memory, and how does it eventually fail? ::: EWC (constant memory); it saturates rigidity and loses plasticity.
See also: Regularization Techniques (the penalty machinery behind EWC) and Neuroscience - Memory Consolidation (biology's own replay-and-consolidate strategy).