Skip to main content
QUICK REVIEW

[Paper Review] Overcoming catastrophic forgetting with hard attention to the task

Joan Serrà, Dídac Surís|RECERCAT (Consorci de Serveis Universitaris de Catalunya)|Jan 4, 2018
Domain Adaptation and Few-Shot Learning34 references225 citations
TL;DR

The paper introduces a task-based hard attention mechanism (HAT) that learns almost-binary attention masks per layer to preserve information from previous tasks while learning new ones, reducing forgetting significantly and enabling model compression.

ABSTRACT

Catastrophic forgetting occurs when a neural network loses the information learned in a previous task after training on subsequent tasks. This problem remains a hurdle for artificial intelligence systems with sequential learning capabilities. In this paper, we propose a task-based hard attention mechanism that preserves previous tasks' information without affecting the current task's learning. A hard attention mask is learned concurrently to every task, through stochastic gradient descent, and previous masks are exploited to condition such learning. We show that the proposed mechanism is effective for reducing catastrophic forgetting, cutting current rates by 45 to 80%. We also show that it is robust to different hyperparameter choices, and that it offers a number of monitoring capabilities. The approach features the possibility to control both the stability and compactness of the learned knowledge, which we believe makes it also attractive for online learning or network compression applications.

Motivation & Objective

  • Motivate and address catastrophic forgetting in sequential task learning.
  • Develop a lightweight, trainable hard attention mechanism conditioned on task identity.
  • Enable concurrent learning without retraining on old tasks by constraining gradient updates.
  • Promote model sparsity and provide monitoring/compression capabilities for practical deployments.

Proposed method

  • Introduce a layer-wise hard attention mask a_l^t derived from a differentiable task embedding e_l^t using a sigmoid gate with scaling s.
  • Compute cumulative attention a^≤t by taking the element-wise maximum over past tasks to preserve important units.
  • Modify gradients with a^≤t via a per-connection gating term that penalizes updates to units important for previous tasks.
  • Anneal the gating parameter s over training epochs to balance plasticity and stability, and perform embedding gradient compensation to maintain effective learning signals.
  • Add an attention-weighted L1 regularization term to encourage sparse usage of units across tasks (compressibility parameter c).
  • Compare HAT to baselines (EWC, SI, LWF, LFL, PathNet, PNN, IMM variants) on 8 diverse image datasets with a standardized architecture and evaluation protocol.
Figure 1: Schematic diagram of the proposed approach: forward (top) and backward (bottom) passes.
Figure 1: Schematic diagram of the proposed approach: forward (top) and backward (bottom) passes.

Experimental results

Research questions

  • RQ1How effectively does HAT reduce catastrophic forgetting compared to state-of-the-art baselines across sequences of multiple tasks?
  • RQ2Are the forgetting reductions robust to hyperparameter choices and task order?
  • RQ3Can HAT provide monitoring capabilities (capacity usage, weight reuse) and support model compression without sacrificing accuracy?
  • RQ4How does HAT perform in different evaluation setups (multi-task, incremental class, permuted datasets)?

Key findings

  • HAT consistently outperforms baselines for t≥2 tasks, achieving ρ≤2 of -0.02 and ρ≤8 of -0.06 in the main 8-task sequence (55%-75% forgetting reduction relative to baselines).
  • On average over 8 tasks, HAT reduces forgetting by 45% to 75% depending on setup, with lower variance than many baselines.
  • HAT enables monitoring of network capacity usage and weight reuse across tasks, and supports compression to 1%–21% of the original size while maintaining high accuracy.
  • In additional setups (incremental class, permuted MNIST, split MNIST), HAT achieves notable improvements over strong baselines (e.g., CIFAR incremental classes: ~55% forgetting reduction; permuted MNIST: ~52% reduction; split MNIST: ~80% reduction).
  • HAT’s two hyperparameters (stability s_max and compressibility c) show robust performance across wide ranges.
Figure 2: Illustration of the effect that annealing $s$ has on the gradients $q$ of $\textbf{e}^{t}$ .
Figure 2: Illustration of the effect that annealing $s$ has on the gradients $q$ of $\textbf{e}^{t}$ .

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.