atlas

Research map / Architectures and efficiency / Attention and transformers

Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformers

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Training dynamics of in-context learning · 0 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.

Shows that for linearized-attention transformers, in-context learning demonstrations can be exactly converted into permanent key-value bias terms (ICLCA), with an approximate variant for softmax transformers evaluated on GPT-2.

Problem

In-context learning demonstrations must be re-supplied in every prompt and do not permanently change model weights; existing context distillation methods are empirical, approximate, and require expensive gradient-based fine-tuning.

Approach

In linearized attention, the key-value matrix aggregates ICL token information linearly, so adding a bias term to the key-value matrix (and normalizer) reproduces the effect of ICL prompt tokens exactly, with the bias computed by a cheap forward pass; for softmax models, the same idea is applied approximately via a kernel (Performer-style) approximation.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Convert the ICL prompt into bias terms with ICLCALinear attention transformer · Induction head taskin-context accuracy: 2.23% -> 99.95%Helped
Approximate ICL conversion with bias termsGPT-2 · GPT-2 logits with ICL promptrelative error: 16.56% -> 9.17%Helped
Add bias terms to the linearized attention module (ablation)Linear attention transformer trained from scratch · Induction head tasktraining speedHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic induction head bigram data

Benchmarks: synthetic induction head task GPT-2 logit relative error on text prompts

Metrics: relative error of logits in-context accuracy

Baselines: context distillation (fine-tuning-based) M_old with ICL prompt M_old without ICL prompt

Builds on: linear attention (Katharopoulos et al.) Performer RoFormer rotary embeddings induction head task (Bietti et al.)

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