mlsanityData to 14 Oct 2026

Pretrain-Test Task Alignment Governs Generalization in In-Context Learning

arXiv 2509.26551 ↗First posted 30 Sep 2025stat.ML cs.LGcited by 8

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) is a central capability of Transformer models, but the structures in data that enable its emergence and govern its robustness remain poorly understood. In this work, we study how the structure of pretraining tasks governs generalization in ICL. Using a solvable model for ICL of linear regression by linear attention, we derive an exact expression for ICL generalization error in high dimensions under arbitrary pretraining-testing task covariance mismatch. This leads to a new alignment measure that quantifies how much information about the pretraining task distribution is useful for inference at test time. We show that this measure directly predicts ICL performance not only in the solvable model but also in nonlinear Transformers. Our analysis further reveals a tradeoff between specialization and generalization in ICL: depending on task distribution alignment, increasing pretraining task diversity can either improve or harm test performance. Together, these results identify train-test task alignment as a key determinant of generalization in ICL.

Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 40 of its 46 references that are in the map. First posted on arXiv 30 Sep 2025.

Builds on

40 of 46 references.

References · 40

  1. 2022Emergent Abilities of Large Language Modelscited by 2,512
  2. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  3. 2019Similarity of Neural Network Representations Revisitedcited by 1,755
  4. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  5. 2022Transformers learn in-context by gradient descentcited by 732
  6. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  7. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  8. 2019Surprises in High-Dimensional Ridgeless Least Squares Interpolationcited by 513
  9. 2018Efficient Attention: Attention with Linear Complexitiescited by 368
  10. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  11. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
  12. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
28 more
  1. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  2. 2017High-dimensional dynamics of generalization error in neural networkscited by 241
  3. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  4. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  5. 2020Spectral Bias and Task-Model Alignment Explain Generalization in Kernel Regression and Infinitely Wide Neural Networkscited by 166
  6. 2015High-Dimensional Asymptotics of Prediction: Ridge Regression and Classificationcited by 148
  7. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
  8. 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 118
  9. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
  10. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
  11. 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 76
  12. 2024Asymptotic theory of in-context learning by linear attentioncited by 55
  13. 2024Scaling and renormalization in high-dimensional regressioncited by 50
  14. 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 33
  15. 2024LLMs learn governing principles of dynamical systems, revealing an in-context neural scaling lawcited by 32
  16. 2021Covariate Shift in High-Dimensional Random Feature Regressioncited by 24
  17. 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 24
  18. 2021Out-of-Distribution Generalization in Kernel Regressioncited by 21
  19. 2024Optimal Ridge Regularization for Out-of-Distribution Predictioncited by 19
  20. 2025Test-Time Training Provably Improves Transformers as In-context Learnerscited by 16
  21. 2025When can in-context learning generalize out of task distribution?cited by 16
  22. 2025In-Context Learning Strategies Emerge Rationallycited by 16
  23. 2025Understanding In-Context Learning on Structured Manifolds: Bridging Attention to Kernel Methodscited by 15
  24. 2024MLPs Learn In-Context on Regression and Classification Taskscited by 13
  25. 2025Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networkscited by 10
  26. 2024Risk and cross validation in ridge regression with correlated samplescited by 8
  27. 2025Distinct Computations Emerge From Compositional Curricula in In-Context Learningcited by 5
  28. 2025Is In-Context Universality Enough? MLPs are Also Universal In-Contextcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 6.

8 papers.