atlas

Research map / Large language models / Retrieval and knowledge

Online Adaptation of Language Models with a Memory of Amortized Contexts

NeurIPS 2024 · Large language models › Retrieval and knowledge · approach: Long-context and personalized retrieval · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Memory of Amortized Contexts (MAC), which compresses each incoming document into PEFT (P-tuning v2) modulations via a meta-learned amortization hypernetwork, stores them in a memory bank, and aggregates them with a question-conditioned cross-attention network to adapt a frozen LM without test-time gradient updates.

Problem

Online adaptation of language models to a growing stream of new documents is costly and forgetful when done by gradient-based finetuning, while retrieval-augmented approaches scale poorly in inference cost and can be misled by counterfactual documents.

Approach

Amortize each document into a compact modulation with a single encoder-decoder forward pass (no labels or gradients at test time), store modulations in a memory bank, and learn a permutation-invariant cross-attention aggregator conditioned on the question to produce one soft-prompt modulation for a frozen LM, with backpropagation dropout and hierarchical aggregation for memory efficiency.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace Salient Spans online finetuning with MACLLaMA-2 7B · StreamingQAF1: 18.97 -> 21.79Helped
Replace Salient Spans online finetuning with MACLLaMA-2 7B · SQuAD-SeqF1: 18.66 -> 21.14Helped
Replace Salient Spans online finetuning with MACLLaMA-2 7B · ArchivalQA-SeqF1: 22.75 -> 23.90Helped
Add MAC to BM25 retrievalLLaMA-2 7B · ArchivalQA-Seq Top-5F1: 71.83 -> 74.89Helped
Use backpropagation dropout to allow a larger training context batch (K=4 rather than K=1) (ablation)MAC on LLaMA-2 7B · StreamingQAF1: 12.43 -> 21.79Helped
Replace P-tuning v2 modulation with LoRA (ablation)MAC on GPT2-XL · StreamingQAF1: 15.38 -> 15.15Hurt
Use an encoder-only amortization network instead of encoder-decoder T5 (ablation)MAC on GPT2-XL · StreamingQAF1: 15.38 -> 15.01Hurt
Use a decoder-only amortization network instead of encoder-decoder T5 (ablation)MAC on GPT2-XL · StreamingQAF1: 15.38 -> 14.87Hurt
Remove 4-bit training quantization and use 16-bit bfloat16 (ablation)MAC on LLaMA-2 · ArchivalQAF1: 23.90 -> 26.25Helped
Use hierarchical modulation aggregation with subgroup size M=16 (ablation)MAC · ArchivalQA-SeqGPU memory usage: 65.6% reductionHelped
Use hierarchical modulation aggregation with subgroup size M=16 (ablation)MAC · ArchivalQA-Seqaccuracy retention: 93.2%Hurt
Use MAC rather than CaMeLS during continued adaptationGPT2-XL · StreamingQA, initial 200 documents after adapting 1,400 additional documentsF1 retention rate: 70.8% -> 96.2%Helped

Surprising findings

Limitations

Experimental setup

Datasets: StreamingQA SQuAD ArchivalQA

Benchmarks: StreamingQA SQuAD-Seq ArchivalQA-Seq

Metrics: exact match F1 peak GPU memory adaptation time perplexity F1 retention rate

Baselines: Uniform finetuning Salient Spans CaMeLS BM25 Contriever DPR CCM

Builds on: CaMeLS P-tuning v2 T5 Retrieval-augmented generation Hypernetworks

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy