Papers › Discrete Key-Value Bottleneck

Discrete Key-Value Bottleneck

22 Jul 2022arXiv:2207.11240archive 2025-07-28

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

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2207.11240")

Code

Syntology Ran 2 of 9 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 2 ran · violated contract.

By repository: official repository: 7 samples from 1 repository, 0 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ftraeuble/experiments_discrete_key_value_bottleneck officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 2 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · violated contract
7unverified

Licence: 2 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ftraeuble/experiments_discrete_key_value_bottleneck. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

embedding_dataset_exists ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/data.py official repository unverified MIT (permissive) · 746e0f9d6857f472 · report
get_class_nums ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/base.py official repository unverified MIT (permissive) · e9304c4dd4be4d62 · report
get_embedding_dataloader ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/data.py official repository unverified MIT (permissive) · 05b24aa01f9569e1 · report
get_encoder_output_shape ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/model.py official repository unverified MIT (permissive) · de459db4d1d897e2 · report
get_image_size ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/base.py official repository unverified MIT (permissive) · 1e4efca94cf1e079 · report
get_resnet50_output_shape ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/model.py official repository unverified MIT (permissive) · e9809af7e92e8792 · report
get_split_dataloaders ftraeuble/experiments_discrete_key_value_bottleneck/kv_bottleneck_experiments/utils/data.py official repository unverified MIT (permissive) · c1432af58cb5e45a · report
default identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 60fff7c3c400d7ff · report
exists identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report

Tasks

Class Incremental LearningContinual LearningIncremental Learningclass-incremental learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections