NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Discrete Key-Value Bottleneck

Frederik Träuble, Anirudh Goyal, Nasim Rahaman, Michael Curtis Mozer, Kenji Kawaguchi, Yoshua Bengio, Bernhard Schölkopf

TL;DR

The Discrete Key-Value Bottleneck is a novel architecture designed to prevent deep neural networks from "forgetting" old tasks when learning new ones. By routing information through a discrete set of fixed keys and learnable value codes, the model performs localized updates that integrate new knowledge without overwriting the old. This approach significantly outperforms existing baselines in challenging continual learning scenarios.

What Problem Does This Paper Address?

Deep learning models are notoriously bad at continual learning. When a model trained on one task is fine-tuned on a second, it often suffers from catastrophic forgetting—the weights that held the "knowledge" for the first task are overwritten to accommodate the second.

Most current solutions to this problem rely on "replay buffers" (storing and re-showing old data) or "task boundaries" (knowing exactly when the data distribution changes). However, in the real world, data streams are often non-stationary and lack clear labels indicating when a new "task" begins. The authors aim to create a model that can learn incrementally and locally, without needing to store old raw data or requiring explicit signals that the rules of the game have changed.

Methods

The authors propose a three-step "Encode, Process, Decode" paradigm to tackle this challenge:

Architecture of the Discrete Key-Value Bottleneck
  1. Encode: An input (like an image) is passed through a pre-trained, frozen encoder. This representation is then projected into multiple lower-dimensional "heads."
  2. Discrete Bottleneck (The Core Innovation):
    • Quantization: Each head is compared against a codebook of keys. These keys are fixed (frozen) after an initial setup phase. The model "snaps" each head to its nearest key.
  3. Retrieval: For every selected key, the model fetches a corresponding learnable value code.
  4. Decode: These retrieved value codes are aggregated (e.g., via average pooling) and passed to a simple decoder to produce the final prediction.

The "Secret Sauce": Because the keys are frozen and the mapping is discrete, the gradients from a new task only update the specific value codes that were "fetched" for that input. This localization ensures that knowledge associated with other keys (representing previous tasks or different data distributions) remains untouched.

Datasets

The researchers evaluated their method on several standard computer vision benchmarks, modified for "class-incremental" learning (where classes are introduced two at a time):

  • CIFAR-10: Split into 5 stages of 2 classes each.
  • CIFAR-100: Split into 50 stages of 2 classes each.
  • ImageNet-1K: A massive scale test split into 500 stages of 2 classes each.
  • Pre-training Backbones: They tested the bottleneck on a wide variety of frozen encoders, including ResNet50 (supervised), ViT-B/32 (CLIP), and self-supervised models like SwAV and DINO.

Key Insights and Ideas

  • Decoupling "Where" from "What": The keys define where in the feature space an input belongs, while the values define what the model should predict for that region. By freezing the keys, the model maintains a stable "map" of the world, only updating the "labels" (values) as it learns.
  • Hypothesis Class Complexity: Theoretically, the authors show that the discrete bottleneck reduces the complexity of the model's hypothesis class. This makes the model less prone to overfitting on the most recent data it has seen.
  • No Task Boundaries Needed: Because the update is local to the fetched keys, the model doesn't need a signal saying "Task A is over, Task B is starting." It naturally adapts to whatever part of the feature space is currently active.
  • Random Projections Work: Interestingly, projecting the encoder's output into heads using fixed, random Gaussian matrices is highly effective. This helps the model handle high-dimensional embeddings while maintaining theoretical guarantees against forgetting.

Key Results

Accuracy over time across various pre-trained backbones
  • Superior Accuracy: On the ConvMixer backbone (CIFAR-10), the proposed method achieved a final accuracy of 77.3%, significantly outperforming the previous state-of-the-art baseline (SDMLP) at 71%.
  • Stability: While standard linear probes and MLPs showed massive spikes in loss and drops in accuracy every time new classes were introduced, the Discrete Key-Value Bottleneck maintained a nearly constant loss measure and smooth accuracy growth.
  • Scalability: The method scaled remarkably well to ImageNet-1K. In a grueling 500-split incremental setting, it reached 49.0% accuracy, which is nearly identical to its performance in a standard (non-incremental) training setting. This suggests the bottleneck almost entirely eliminates catastrophic forgetting.

Limitations and Future Work

  • Reliance on Pre-training: The method's success depends heavily on the quality of the frozen encoder. If the pre-trained model hasn't learned features relevant to the new task, the bottleneck cannot "fix" that deficiency.
  • Key Initialization: While the authors use an Exponential Moving Average (EMA) approach to initialize keys, they acknowledge that in extreme cases where the target data is vastly different from the initialization data, the keys might not cover the manifold optimally.
  • Simple Decoders: The current work uses very simple, often non-parametric decoders. The authors suggest that exploring more complex, learnable decoders—or applying this bottleneck to Reinforcement Learning and Generative Modeling—could be fruitful next steps.

Summary updated

BibTeX
@inproceedings{trauble2023discrete,
  author = {Frederik Träuble and Anirudh Goyal and Nasim Rahaman and Michael Curtis Mozer and Kenji Kawaguchi and Yoshua Bengio and Bernhard Schölkopf},
  title = {{Discrete Key-Value Bottleneck}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=LDBIVZCnLl},
}
Figure