Learn the Effects, Not the Examples: Implicit ICL via Attention Patching

Seungwon Woo, Hyunseo Shin, Wonseok Hwang
11/23/2026
cs.CLcs.LG

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{woo2026learn,
  title  = {Learn the Effects, Not the Examples: Implicit ICL via Attention Patching},
  author = {Seungwon Woo and Hyunseo Shin and Wonseok Hwang},
  year   = {2026},
  eprint = {2611.30690},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.30690v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.30690.svg)](https://codeofpaper.com/paper/2611.30690)

Discussion