Skip to content
OpenTrain AIFor AI Companies

A Circuit for In-Context Learning

Andrew Gao, William GaoPublished Nov 3, 2026
arXiv PDF
Researcher verdict
Context only
Use as context only
Benchmark evidence
Missing
Not verified yet
Time to first repro
A few days
Plan setup time
Risk flags
2
Review before use

No concrete benchmark grounding is available yet. Treat the page as context or an implementation starting point only.

Abstract

Domain fit: AI-core · Core AI workload signals detected from paper context and implementation/artifact evidence.

In-context learning (ICL) lets a pretrained language model perform a task specified by demonstrations in its prompt, with no parameter updates. With arbitrary labels the model must acquire a mapping it cannot have memorized, so the learning happens within a single forward pass. Prior work found candidate parts but not how they compose. We give the composition for few-shot sentence classification with arbitrary labels in three 3-4B-parameter transformers. The model implements a key-value memory over label-token positions: each label token's residual stream encodes the label's identity, and middle-layer attention heads write into it the class of the preceding demonstration as its key. At the query, upper-layer heads match the query's class against the stored keys and copy out the matching labels. An early-layer signal encoding whether any label has repeated gates this readout; in its absence the readers attend to the start of the prompt and no label is favored. A separate set of heads suppresses the most recently seen label. Each step is established causally by activation patching, head ablations against random-head baselines, and steering with the model's own signals. A softmax model of the readout with two constants per head, fit on one prompt distribution, predicts another. The computation is conserved across the three models, the named heads alone reproduce the behaviour, and a transformer trained from scratch grows the same parts. The circuit transfers to semantic concepts and to labels with meaning, and the same parts, with a causal gate, appear from 0.6B to 8B in one family and survive instruction tuning. ICL in this setting is a gated associative lookup built from a few identifiable component types, traced causally from demonstrations to prediction.

Results and benchmarks

In-context learning (ICL) lets a pretrained language model perform a task specified by demonstrations in its prompt, with no parameter updates.

Implementation

No direct implementation yet

Maintained implementation evidence is not confirmed for this paper yet.

Use the implementation status and reproduction sections for the current action plan.

Implementation evidence summary
Confidence: low

Recommendation evidence is currently too limited for a maintained-repo choice. Use Implementation Status and Reproduction Path for a practical baseline plan.

Reproduction risks
  • Estimate is based on paper-only reproduction flow

Compare implementation paths

Compare maintenance quality, reproducibility coverage, and evidence confidence before choosing a reproduction baseline.

Maintenance
Active
Confidence
Low
Reproducibility
Moderate
Stars
0
Last push
Nov 6, 2026 (19d)

Matched via arXiv identifier search

  • No CI pipeline detected
  • No tagged releases
  • No Docker setup
Maintenance
Active
Confidence
Low
Reproducibility
Moderate
Stars
0
Last push
Nov 24, 2026 (2d)

Matched via arXiv identifier search

  • No tagged releases
  • No Docker setup
  • Dependency manifest missing
Maintenance
Active
Confidence
Medium
Reproducibility
Limited
Stars
43
Last push
Nov 18, 2026 (8d)

Matched via arXiv identifier search · Strong overlap with paper title keywords

  • No CI pipeline detected
  • No tagged releases
  • No Docker setup

Reproduction readiness

Time to first repro: days
Last checked: Nov 25, 2026

No repo

No verified implementation available

  • No maintained repository has been identified for this paper. Check adjacent implementations or HF artifacts below.

Hardware requirements

  • Expect multi-day setup/compute for meaningful reproduction based on current guidance.

Framework baselines

Repositories and ecosystem

Official

No additional official repositories detected.

Community

  • Papers, code, etc. for the Deep Learning Study Group, which has been meeting weekly since 2016. Meeting time - Tuesdays, 6:30 pm California time on Zoom. See README.md for Meetup, Zoom and Discord links.

    43 stars · 7 forks · Last push Nov 18, 2026

Hugging Face artifacts

No trustworthy direct or curated related Hugging Face artifacts were found yet. Use targeted searches to quickly locate candidate models, datasets, and demos.

Tip: start with models, then check datasets and spaces if you need evaluation data or demos.

Research context

Tasks

Instruction tuning

Methods

Transformer

Domains

Natural Language Processing, Large Language Models

Evaluation and human feedback data

Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.

Open in HFEPX
Explore similar papers

Jump to Paper2Code search queries derived from this paper's research context.