In-context classification: Calibration and noise in linear attention with softmax readout

Arman Rysmakhanov, Mary Letey, Yue M. Lu, Jacob Zavatone-Veth, Cengiz Pehlevan
10/12/2026
stat.MLcs.LG

No confident code implementation found for this paper.

Abstract

We study in-context binary classification in a simple attention model trained to minimise a logistic loss. Each prompt has a latent logistic teacher, and the learner must infer its direction from Bernoulli-labeled context examples.

Show full abstract

We derive an asymptotic prediction for the test logit in a high-dimensional regime with context length proportional to token dimension, and total training prompts proportional to dimension squared. Our formula cleanly separates calibration, test-time context noise, and non-isotropic parameter-estimation noise as interpretable effects on in-context performance. Our analysis also identifies the ridgeless separability regime and addresses the effects of context length, pretraining-set size, regularisation, and sampling temperature on in-context classification performance. The theory's predictions closely agree with finite-dimensional simulations and fully trained linear-attention models, while experiments with standard softmax attention show qualitatively related behaviour beyond the regime assumed by our analysis.

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{rysmakhanov2026incontext,
  title  = {In-context classification: Calibration and noise in linear attention with softmax readout},
  author = {Arman Rysmakhanov and Mary Letey and Yue M. Lu and Jacob Zavatone-Veth and Cengiz Pehlevan},
  year   = {2026},
  eprint = {2610.17061},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.17061v1}
}

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/2610.17061.svg)](https://codeofpaper.com/paper/2610.17061)

Discussion