Paper · published 2026-11 · added 2026-11-04 · arxiv.org

A Circuit for In-Context Learning

What it is

This paper identifies the specific attention heads and computational mechanisms that enable in-context learning in transformer models. It demonstrates that the model implements a key-value memory system where middle-layer heads write class information to label tokens, and upper-layer heads read this information to predict the correct label for a query.

The problem it solves

Previous research identified candidate components for in-context learning but failed to explain how these parts compose to perform the task, leaving the underlying mechanism opaque.

What you could use it for

Why it matters

Provides a mechanistic explanation for a core capability of modern LLMs, potentially enabling more reliable control, debugging, and optimization of in-context learning performance.

in-context learningtransformersmechanistic interpretabiattention headsNLP

Read the source ↗Back to the library →

Summary written by an AI model from the source; check the source before you rely on it.