potentialpaper

Dissecting In-Context Learning: A Mechanistic Analysis of Emergent Circuits in Small Language Models

Eva Paunova

ICLR 2026 submission

Edit this page

Or clone it with git

The page gets its repository with its first edit, so start in the web editor.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. In-context learning (ICL) enables language models to adapt to new tasks from just a few examples, yet the mechanistic basis of this capability remains poorly understood. We present a comprehensive analysis of the circuits underlying ICL in transformer models ranging from 125M to 1.3B parameters. Through systematic interventions and causal analysis, we identify four distinct circuit types that emerge during training: copy circuits that replicate patterns, induction circuits that abstract rules, composition circuits that combine information, and task recognition circuits that identify problem types. We demonstrate that these circuits are (1) causally responsible for ICL performance through targeted ablations showing 73% average performance degradation, (2) transferable across model scales with 0.82 correlation in circuit structure, and (3) surgically enhanceable, achieving 28% improvement on targeted tasks. Our analysis reveals that ICL emerges through the coordinated interaction of 12–15 critical attention heads forming interpretable computational graphs. We provide an open-source toolkit for ICL circuit analysis and demonstrate applications to model debugging and capability enhancement. These findings offer actionable insights for improving model interpretability and engineering more capable systems.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

add · history

No versions are recorded yet: its preprint, the venues it went to and what they decided, the camera-ready. Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…