Skip to main content
QUICK REVIEW

[Paper Review] Discrete Key-Value Bottleneck

Frederik Träuble, Anirudh Goyal|arXiv (Cornell University)|Jul 22, 2022
Domain Adaptation and Few-Shot LearningComputer Science5 citations
TL;DR

This paper proposes a discrete key-value bottleneck mechanism that enables continual learning by freezing pre-trained encoders and selectively updating only a sparse set of learnable value codes during inference. By using discrete key-value pairs to store and retrieve task-specific knowledge, the model reduces catastrophic forgetting across class-incremental learning benchmarks without task boundaries, outperforming existing methods on diverse pre-trained models.

ABSTRACT

Deep neural networks perform well on classification tasks where data streams are i.i.d. and labeled data is abundant. Challenges emerge with non-stationary training data streams such as continual learning. One powerful approach that has addressed this challenge involves pre-training of large encoders on volumes of readily available data, followed by task-specific tuning. Given a new task, however, updating the weights of these encoders is challenging as a large number of weights needs to be fine-tuned, and as a result, they forget information about the previous tasks. In the present work, we propose a model architecture to address this issue, building upon a discrete bottleneck containing pairs of separate and learnable key-value codes. Our paradigm will be to encode; process the representation via a discrete bottleneck; and decode. Here, the input is fed to the pre-trained encoder, the output of the encoder is used to select the nearest keys, and the corresponding values are fed to the decoder to solve the current task. The model can only fetch and re-use a sparse number of these key-value pairs during inference, enabling localized and context-dependent model updates. We theoretically investigate the ability of the discrete key-value bottleneck to minimize the effect of learning under distribution shifts and show that it reduces the complexity of the hypothesis class. We empirically verify the proposed method under challenging class-incremental learning scenarios and show that the proposed model - without any task boundaries - reduces catastrophic forgetting across a wide variety of pre-trained models, outperforming relevant baselines on this task.

Motivation & Objective

  • To address catastrophic forgetting in continual learning scenarios where training data distributions shift over time.
  • To enable efficient, localized model updates without fine-tuning the pre-trained encoder weights.
  • To reduce hypothesis class complexity and improve generalization under covariate shift via a discrete bottleneck.
  • To design a model that reuses knowledge from pre-trained encoders while adapting to new tasks through sparse, context-dependent value code updates.
  • To empirically validate the method across multiple pre-trained models in class-incremental learning without task boundary annotations.

Proposed method

  • The model uses a three-stage pipeline: encode, process via a discrete key-value bottleneck, and decode.
  • A pre-trained encoder produces continuous representations, which are projected into C heads for key-value retrieval.
  • Each head searches for the nearest key in a learnable key codebook and retrieves the corresponding continuous value code.
  • Only the value codes are updated during training, while keys and the encoder remain frozen, enabling localized adaptation.
  • The key-value codebooks are initialized via EMA on a diverse data distribution to ensure broad coverage of the feature manifold.
  • The method reduces hypothesis class complexity by decoupling key (encoding) and value (decoding) codes, limiting model capacity and improving generalization.

Experimental results

Research questions

  • RQ1Can a discrete key-value bottleneck reduce catastrophic forgetting in class-incremental learning without task boundaries?
  • RQ2How does the discrete bottleneck architecture affect generalization under input distribution shifts?
  • RQ3To what extent does localizing parameter updates to only value codes preserve knowledge from prior tasks?
  • RQ4How does the model perform across diverse pre-trained encoders under non-i.i.d. data streams?
  • RQ5What is the utilization pattern of key-value pairs, and does unused capacity indicate underutilization or robustness?

Key findings

  • The proposed model significantly reduces catastrophic forgetting across all tested pre-trained models (ResNet50, ViT, DINO, SwAV, ConvMixer) in class-incremental learning.
  • The model outperforms relevant baselines without requiring task boundary annotations or task-specific head reinitialization.
  • Over 70% of key-value pairs were used at least once during training, with 28% of keys remaining unused, indicating retained capacity and sparse utilization.
  • Key codes were broadly distributed across the data manifold in initialization and became more clustered on the target dataset, reflecting adaptation to domain-specific features.
  • The model achieved better generalization bounds than standard models under distribution shifts due to reduced hypothesis class complexity.
  • Value code updates were highly localized, with most keys being fetched by multiple inputs, enabling efficient and context-specific adaptation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.