Supermasks in Superposition

Mitchell Wortsman, Vivek Ramanujan, Rosanne Liu, Aniruddha Kembhavi, Mohammad Rastegari, Jason Yosinski, Ali Farhadi

Introduction

The holy grail of continual learning is a model that can learn new tasks sequentially without catastrophic forgetting—the tendency for neural networks to overwrite knowledge of old tasks when trained on new ones. Most existing solutions either require knowing exactly which task is being performed at test time (Task ID), or they rely on complex replay buffers to "remind" the model of old data. Furthermore, many methods fail to scale; as the number of tasks grows, the model either runs out of capacity or the memory overhead becomes prohibitive.

Supermasks in Superposition (SupSup) addresses these challenges by rethinking the fundamental way a network learns. It enables a single neural network to learn thousands of tasks sequentially without forgetting by keeping the underlying weights fixed and random, only training task-specific binary masks. When task identity is unknown at test time, the model can infer it in a single gradient step by finding the mixture of masks that produces the most "confident" (low-entropy) output.

The SupSup Approach

The core philosophy of SupSup is that weights don't need to change to learn. This builds on the "Strong Lottery Ticket Hypothesis," which posits that a sufficiently large random network already contains subnetworks capable of solving complex tasks—you just have to find the right mask.

Training and Inference with Supermasks
  1. Supermasks: Instead of updating weights, the model starts with a fixed, randomly initialized "backbone" network. For each new task, it trains a binary mask (a "supermask") that decides which connections to keep and which to ignore. Since the underlying weights never change, the knowledge for Task A is never overwritten by Task B.
  2. Superposition for Inference: If the model doesn't know which task it is evaluating (e.g., is this a digit from MNIST or a bird from ImageNet?), it treats task identity as an optimization problem. It creates a weighted linear combination (superposition) of all learned masks.
  3. Entropy Minimization: The model performs a "One-Shot" gradient step to find the mixture weights that minimize the entropy of the output. Essentially, it looks for the mask combination that makes the model feel most "confident" about its prediction. Task inference doesn't require a separate "manager" network; the model’s own output confidence is a sufficient signal.
  4. HopSupSup: To prevent memory requirements from growing linearly with the number of tasks, these masks can be stored as "attractors" in a fixed-size Hopfield network, allowing for constant-sized storage regardless of the number of tasks.

Experimental Validation

The authors evaluated SupSup on several standard and high-scale benchmarks, standardizing the evaluation using a "GG/GN/NN" taxonomy to clarify whether Task ID is given during training (G) or inference (N):

  • SplitCIFAR100: CIFAR100 partitioned into 20 different 5-way classification tasks.
  • SplitImageNet: ImageNet partitioned into 100 different 10-way classification tasks.
  • PermutedMNIST: A massive scale test involving up to 2,500 tasks, where each task is a different random permutation of MNIST pixels.
  • RotatedMNIST: 36 tasks where digits are rotated by 10-degree increments.
  • SplitMNIST: A 5-task partition of the classic digit dataset.

Key Findings

  • Zero Forgetting: Because the underlying network weights are fixed, SupSup achieves 0% forgetting by design.
  • Scaling to Thousands of Tasks: On PermutedMNIST, SupSup successfully learned 2,500 tasks. Even without being told which task was which at test time, it could infer the correct mask and maintain high accuracy.
  • State-of-the-Art Performance: In the "Given/Given" (GG) scenario on SplitImageNet, SupSup achieved 89.58% accuracy, significantly outperforming previous baselines like BatchE (81.50%) while using less memory.
Accuracy vs Number of Tasks Learned
  • Inference Efficiency: Task inference is incredibly fast. A single gradient step is often enough to identify the correct mask among thousands of candidates.
  • Superfluous Neurons: Adding "extra" output neurons trained to stay quiet (outputting large negative values) makes task inference much more accurate by providing a cleaner entropy signal.

Limitations and Future Work

While SupSup represents a massive leap in continual learning, it has limitations. If a model is "overconfident" (poorly calibrated), it might pick the wrong mask; if the model thinks it's right when it's wrong, the entropy signal fails. Additionally, while SupSup excels at distinct tasks (like permutations), it may struggle with tasks that are nearly indiscernible or where data distributions overlap significantly.

Future directions include exploring self-supervision and more robust calibration techniques. These improvements could help the model better identify when it is "uncertain," further enhancing performance in the "NN" scenario where no task information is provided at all.

Summary updated

BibTeX
@inproceedings{wortsman2020supermasks,
  author = {Mitchell Wortsman and Vivek Ramanujan and Rosanne Liu and Aniruddha Kembhavi and Mohammad Rastegari and Jason Yosinski and Ali Farhadi},
  title = {{Supermasks in Superposition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=WfDjvUxbXZp},
}
Figure