Research map / Optimization / Implicit bias and generalization
Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers
Damai Dai, Yutao Sun, Li Dong, Yaru Hao, Shuming Ma, Zhifang Sui, Furu Wei
Peking University · Tsinghua University · Microsoft
Read the paperPlace an idea next to itCheck your own paper ↗
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add momentum (EMA over attention values) to attention | 350M Transformer · language modeling, Valid 1024 | perplexity: 15.14 -> 15.02 | Improved |
| add momentum (EMA over attention values) to attention | 350M Transformer · in-context learning, six datasets | average accuracy: 51.9 -> 54.7 | Improved |
| add momentum to attention | 350M Transformer · IMDB in-context learning | accuracy: 64.0 -> 70.3 | Improved |
| add momentum to attention | 350M Transformer · PIQA in-context learning | accuracy: 68.7 -> 69.0 | Improved |
| use in-context demonstrations instead of zero-shot | GPT 1.3B · SST2 | accuracy: 70.5 -> 92.7 | Improved |
| finetune on demonstrations for one step each instead of zero-shot | GPT 1.3B · SST5 | accuracy: 39.3 -> 39.5 | No clear effect |
| compare ICL updates with finetuning updates versus random updates | GPT 2.7B · six datasets average | SimAOU: -0.001 -> 0.225 | Improved |
| compare ICL attention weights to after-finetuning versus before-finetuning weights | GPT 1.3B · six datasets average | SimAM: 0.338 -> 0.442 | Improved |
| compare ICL attention to training tokens with finetuning versus random weights | GPT 2.7B · six datasets average | Kendall coefficient: 0.000 -> 0.214 | Improved |
| compare ICL attention weights before versus after finetuning | GPT 2.7B · SST2 and CB | SimAM: 0.687 -> 0.687 (SST2); 0.228 -> 0.217 (CB) | No clear effect |
Open problems in in-context learning as gradient descent
Do in-context gradient descent results for linear attention carry over to softmax and deeper transformers?
- Theory covers linear attention, while softmax is only tested empirically. · 10 papers state it
- Analysis is limited to one or two layers and simple setups. · 5 papers state it
- Experiments are small synthetic regression setups. · 5 papers state it
Closest papers by meaning
- Position: Do pretrained Transformers Learn In-Context by Gradient Descent? (ICML 2024 · similarity 0.92)
- Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Ability (ICLR 2024 · similarity 0.91)
- In-Context Learning with Representations: Contextual Generalization of Trained Transformers (NeurIPS 2024 · similarity 0.90)
- Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergence (ICML 2025 · similarity 0.90)
- In-Context Learning through the Bayesian Prism (ICLR 2024 · similarity 0.90)
- In-Context Learning State Vector with Inner and Momentum Optimization (NeurIPS 2024 · similarity 0.90)
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.