Learn the Effects, Not the Examples: Implicit ICL via Attention Patching
Seungwon Woo, Hyunseo Shin, Wonseok Hwang
Key points
From the paper's conclusion- We propose Attention-Patching, an implicit ICL method that models contextual changes in self-attention outputs through task-specific updates to attention output projections.
Abstract
In-context learning (ICL) enables language models to adapt to new tasks from demonstrations, but repeatedly including multiple examples increases context length and inference cost. Many existing implicit ICL methods encode demonstrations as fixed vectors, limiting adaptation of the intervention to individual queries and token positions. We propose Attention-Patching, an implicit ICL method that models contextual changes in self-attention outputs through task-specific updates to attention output projections. Using query-answer pairs processed with and without a fixed demonstration set, Attention-Patching fits layer-wise affine transformations from non-contextual attention representations to the demonstration-induced output changes. Across 12 classification benchmarks and four model families, Attention-Patching achieves higher average accuracy than the evaluated implicit ICL baselines while maintaining performance comparable to explicit ICL at near zero-shot inference cost. Further experiments on diverse generation tasks demonstrate its applicability to autoregressive multi-token generation.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- From Copying to Composition: How Language Models Develop In-Context LearningarXiv · 2026
- Two Vectors Replace In-Context Demos: Structured Task Adaptation via EmbeddingsarXiv · 2026
- Capturing In-Context Learning Dynamics with Task OperatorsarXiv · 2026
- Out of Support, Not Out of Reach: In-Context Learning with Unsupported Instructions and Composed TasksarXiv · 2026
- Beyond Prediction: A Component-Level Study of Concept Recovery in In-Context LearningarXiv · 2026
- A Circuit for In-Context LearningarXiv · 2026