Lune

NeurIPS2025Top-tier venue

Bayes optimal learning of attention-indexed models

Fabrizio Boncoraglio, Emanuele Troiani, Vittorio Erba, Lenka Zdeborová

Abstract

We introduce the attention-indexed model (AIM), a theoretical framework for analyzing learning in deep attention layers. Inspired by multi-index models, AIM captures how token-level outputs emerge from layered bilinear interactions over high-dimensional embeddings. Unlike prior tractable attention models, AIM allows full-width key and query matrices, aligning more closely with practical transformers. Using tools from statistical mechanics and random matrix theory, we derive closed-form predictions for Bayes-optimal generalization error and identify sharp phase transitions as a function of sample complexity, model width, and sequence length. We propose a matching approximate message passing algorithm and show that gradient descent can reach optimal performance. AIM offers a solvable playground for understanding learning in self-attention layers, that are key components of modern architectures.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Minimax Rates for Learning Pairwise Interactions in Attention-Style Models cites Infinite attention: NNGP and NTK for deep attention networks
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling Laws cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling Laws cites Language Models are Few-Shot Learners
  • Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling Laws cites High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the Representation
  • Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer cites Infinite attention: NNGP and NTK for deep attention networks
  • Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Two failure modes of deep transformers and how to avoid them: a unified theory of signal propagation at initialisationAlessio Giorlandino, Sebastian GoldtICLR 2026 · 15 citations
  2. Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling LawsFabrizio Boncoraglio, Vittorio Erba, Emanuele Troiani, Yizhou Xu et al.ICML 2026 · 5 citations
  3. Minimax Rates for Learning Pairwise Interactions in Attention-Style ModelsShai Zucker, Xiong Wang, Fei Lu, Inbar SeroussiICLR 2026

Builds on20

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the RepresentationJimmy Ba, Murat A. Erdogdu, Taiji Suzuki, Zhichao Wang et al.NeurIPS 2022 · 173 citations
  4. Infinite attention: NNGP and NTK for deep attention networksJiri Hron, Yasaman Bahri, Jascha Sohl-Dickstein, Roman NovakICML 2020 · 147 citations
  5. Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer TransformerYuandong Tian, Yiping Wang, Beidi Chen, Simon S. DuNeurIPS 2023 · 125 citations

Related papers

  1. Fundamental limits of learning in sequence multi-index models and deep attention networks: high-dimensional asymptotics and sharp thresholdsEmanuele Troiani, Hugo Cui, Yatin Dandi, Florent Krzakala et al.ICML 2025
  2. Dissecting the Interplay of Attention Paths in a Statistical Mechanics Theory of TransformersLorenzo Tiberi, Francesca Mignacco, Kazuki Irie, Haim SompolinskyNeurIPS 2024 · 12 citations
  3. What can a Single Attention Layer Learn? A Study Through the Random Features LensHengyu Fu, Tianyu Guo, Yu Bai, Song MeiNeurIPS 2023 · 47 citations
  4. Asymptotics of SGD in Sequence-Single Index Models and Single-Layer Attention NetworksLuca Arnaboldi, Bruno Loureiro, Ludovic Stephan, Florent Krzakala et al.NeurIPS 2025 · 10 citations
  5. Learning with Restricted Boltzmann Machines: Asymptotics of AMP and GD in High DimensionsYizhou Xu, Florent Krzakala, Lenka ZdeborováNeurIPS 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines