TL;DR
Kirkpatrick and colleagues asked whether a deep network can learn tasks one after another without forgetting the earlier ones. Their method, elastic weight consolidation (EWC), adds a penalty to the training loss that holds each weight near its value after the old task, with a strength set by how important that weight was for the old task. The paper shows this on classification tasks built from MNIST digits and on a sequence of Atari 2600 games.
Builds on: Catastrophic Forgetting, Continual Learning, Fisher Information, Bayes' Rule, L2 Regularization · Leads to: Continual Learning methods that protect weights, and later comparisons with Experience Replay
Why it mattered
Before this paper, the common view was that catastrophic forgetting was an unavoidable feature of networks that store knowledge in shared weights. The paper showed that a penalty based on importance could let a network keep several tasks. It also tested the idea beyond supervised classification, on a Deep Q-Network trained on a sequence of Atari games, which is a harder setting than classifying digits.
Its ideas are a standard starting point for Continual Learning, which studies this problem as a field of its own. The paper also linked forgetting to the way biological synapses consolidate memories, and the authors describe the method as having parallels with that idea.
The problem
A network trained on task A and then on task B changes the weights that A needed, because the loss for B does not contain A. The paper describes this as the abrupt loss of old knowledge as new information is added, and says it happens specifically when the network is trained sequentially, since the weights important for A are changed to meet B's objective (Catastrophic Forgetting).
The two obvious fixes both fail in different ways. A fixed penalty on every weight, the L2 penalty the paper tests, keeps the old task's performance but leaves too little freedom to learn task B. Training on all tasks together avoids forgetting, but needs every old dataset at once, which is not possible when data arrives in sequence. The paper argues that replaying stored data is impractical for large numbers of tasks, because the memory needed would grow with the number of tasks.
How it works
-
Train task A to the end. The network reaches weights that solve A. Nothing special is done yet.
-
Estimate how important each weight was. The paper approximates the posterior distribution of the weights after task A as a Gaussian centred at , whose precision is the diagonal of the Fisher information matrix . A large means weight strongly affects A's output, so changing it would hurt A.
-
Start task B with a penalty added. The loss for B is the usual loss plus a quadratic term that pulls each weight back towards its old value, scaled by its importance. The penalty is zero when the weights are where task A left them.
-
Train on B. Gradient descent moves the weights to reduce the combined loss. Weights with small are free to move, and weights with large stay close to their old values.
-
Repeat for each new task. When a third task arrives, the penalties from A and B are summed, so the network tries to stay close to what it learned for both.
-
Evaluate on all tasks. The paper measures performance on the test sets of every earlier task after each new task, which is how forgetting is seen in the results.
flowchart LR A[Train on task A] --> B[Compute Fisher importance of each weight] B --> C[Train on task B with penalty on important weights] C --> D[Important weights stay near old values] C --> E[Unimportant weights adapt freely] D --> F[Evaluate on A and B] E --> F
The math
The paper starts from Bayes' rule on the parameters and the data. Taking logarithms, with the full dataset,
The log probability of the data given the parameters is the negative of the loss, . Split the data into two independent parts, for task A and for task B. Applying Bayes' rule again gives
The left side describes the parameters given the whole dataset, while the right side depends on the loss for B only through . So all information about task A must sit in the posterior . That posterior is intractable, so the paper approximates it as a Gaussian with mean and diagonal precision given by the diagonal of the Fisher information , following the Laplace approximation.
Step 2 in symbols: the penalty
With this approximation the loss used when training on B is
where is the loss for task B only, sets how important the old task is compared with the new one, and labels each parameter. The penalty is a sum of squared shifts, each weighted by . When several old tasks are present, their penalties can be combined into one, because the sum of quadratic penalties is itself a quadratic penalty.
Step 3 in symbols: the importance
The paper keeps only the diagonal of , so each weight has one importance value . For the Atari experiments the Fisher matrix is recomputed at each task switch, using 100 samples, and the penalty for each game is anchored at the parameter values at that point.
Results
Supervised tasks on permuted MNIST. Each task was MNIST with a fixed random permutation of the input pixels, so every task has the same difficulty as MNIST but needs a different solution. Plain SGD forgets task A quickly when B is trained. The L2 penalty protects A better but leaves B poorly learned. EWC keeps high performance on old tasks while still learning new ones, as the paper's Figure 2A shows. Across many tasks, SGD with dropout is limited and does not scale, while EWC allows a large number of tasks to be learned in sequence with only modest growth in error. The paper says earlier methods had achieved reasonable results on up to two random permutations.
Atari 2600 games with a DQN. Each experiment used ten games drawn at random from a pool of 19 games that the standalone DQN plays at human level, and the agent was trained on each game for an extended period. The score is the total human-normalised score across the ten games, clipped per game, so the maximum is 10 and 0 is a random agent. Plain gradient descent, as in the original DQN, learns only one game and its total score stays below one. With EWC, the agent learns to play several games, which is the paper's main Atari claim. The authors note that EWC does not reach the score of ten separate DQNs, and they link this to the approximation of parameter uncertainty by the Fisher information.
Limits. The paper reports results as curves in figures, so the reader should read the figures rather than rely on a single number. The Atari setup adds several modifications to the agent, including a task-recognition module and game-specific biases, so the EWC effect is not measured in isolation. The penalty strength was chosen by hyperparameter search on each setting, and the Atari scaling factor was 400.
Reading guide
- Section 1, Introduction: the problem of catastrophic forgetting and why replay is impractical for many tasks. Read with Catastrophic Forgetting and Continual Learning.
- Section 2, Elastic weight consolidation: the Bayesian argument, the Laplace approximation and the penalty. Needs Bayes' Rule, Maximum a Posteriori (MAP) Estimation, Gaussian (Normal) Distribution and Fisher Information. The penalty itself is a weighted L2 penalty.
- Section 2.1, supervised learning: the permuted MNIST results. Needs Stochastic Gradient Descent and Dropout for the comparison.
- Section 2.2, reinforcement learning: the Atari results. Needs Reinforcement Learning and Deep Q-Network; the replay buffer mentioned there is the same idea as Experience Replay.
- Section 3, Discussion: the link to synaptic consolidation and to earlier work using penalties. Needs Transfer Learning for the contrast with reuse of old knowledge.
- Section 4, Appendix: the hyperparameters for MNIST and Atari, and the Fisher overlap experiment. Read when reproducing results.
Check yourself
QuestionWhat does EWC add to the loss for a new task, and why?Show answer
It adds a quadratic penalty, the sum of , that pulls each weight back towards its value after the old task. The weights are scaled by the Fisher importance , so the weights that the old task depended on are held in place while the others can adapt to the new task.
QuestionIn the Atari experiments, the total score is out of 10 across ten games. A score of 10 means what, and a score of 0 means what?Show answer
A score of 10 means the agent is at least at human level on all ten games, since each game's score is clipped at 1. A score of 0 means the agent is as good as a random agent.
QuestionWhy does the paper use the diagonal of the Fisher information rather than the full matrix?Show answer
The diagonal gives one importance value per weight, which is cheap to store and compute, while the full matrix would have one entry for every pair of weights. The paper's analysis uses the diagonal as the precision of a Gaussian approximation over the parameters, so each weight is treated on its own.
QuestionA team wants to add a new language to a deployed model without keeping any old training data. Using the paper's logic, what would they need and what risk remains?Show answer
They would need to estimate the importance of each weight for the old languages, usually from the Fisher information computed on the old model, and add the penalty while training on the new language. The risk is that the estimate is an approximation, and the penalty trades off how well the new language is learned against how well the old ones are kept, so both must be checked on held-out data for each language.