mlsanityData to 7 Oct 2026

How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPs

arXiv 2510.25753 ↗First posted 29 Oct 2025stat.ML cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

Pretrained Transformers demonstrate remarkable in-context learning (ICL) capabilities, enabling them to adapt to new tasks from demonstrations without parameter updates. However, theoretical studies often rely on simplified architectures (e.g., omitting MLPs), plain data models (e.g., linear regression with isotropic inputs), and single-source training, limiting their relevance to realistic settings. In this work, we study ICL in pretrained Transformers with nonlinear MLP heads on nonlinear tasks drawn from multiple data sources with heterogeneous input, task, and noise distributions. We analyze a model where the MLP comprises two layers, with the first layer trained via a single gradient step and the second layer fully optimized. Under high-dimensional asymptotics, we prove that such models are equivalent in ICL error to structured polynomial predictors, leveraging results from the theory of Gaussian universality and orthogonal polynomials. This equivalence reveals that nonlinear MLPs meaningfully enhance ICL performance, particularly on nonlinear tasks, compared to linear baselines. It also enables a precise analysis of data mixing effects: we identify key properties of high-quality data sources (low noise, structured covariances) and show that feature learning emerges only when the task covariance exhibits sufficient structure. These results are validated empirically across various activation functions, model sizes, and data distributions. Finally, we experiment with a real-world scenario involving multilingual sentiment analysis where each language is treated as a different source. Our experimental results for this case exemplify how our findings extend to real-world cases. Overall, our work advances the theoretical foundations of ICL in Transformers and provides actionable insight into the role of architecture and data in ICL.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 37 of its 49 references that are in the map. First posted on arXiv 29 Oct 2025.

Builds on

37 of 49 references.

References · 37

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Emergent Abilities of Large Language Modelscited by 2,483
  4. 2022In-context Learning and Induction Headscited by 930
  5. 2018Reconciling modern machine learning practice and the bias-variance trade-offcited by 919
  6. 2022Transformers learn in-context by gradient descentcited by 714
  7. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  8. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  9. 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 515
  10. 2024Multilingual E5 Text Embeddings: A Technical Reportcited by 357
  11. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  12. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
25 more
  1. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  2. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  3. 2024Data Mixing Laws: Optimizing Data Mixtures by Predicting Language Modeling Performancecited by 179
  4. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  5. 2022Neural Networks can Learn Representations with Gradient Descentcited by 161
  6. 2022High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the Representationcited by 146
  7. 2020The Multilingual Amazon Reviews Corpuscited by 142
  8. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
  9. 2020The Gaussian equivalence of generative models for learning with shallow neural networkscited by 113
  10. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
  11. 2022Universality of empirical risk minimizationcited by 73
  12. 2023How Two-Layer Neural Networks Learn, One (Giant) Step at a Timecited by 67
  13. 2024Asymptotic theory of in-context learning by linear attentioncited by 54
  14. 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 52
  15. 2024Bridging the Divide: Reconsidering Softmax and Linear Attentioncited by 48
  16. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
  17. 2023A Theory of Non-Linear Feature Learning with One Gradient Step in Two-Layer Neural Networkscited by 46
  18. 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
  19. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  20. 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
  21. 2023Universality laws for Gaussian mixtures in generalized linear modelscited by 28
  22. 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
  23. 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
  24. 2025Asymptotic Analysis of Two-Layer Neural Networks after One Gradient Step under Gaussian Mixtures Data with Structurecited by 4
  25. 2025Asymptotic Study of In-context Learning with Random Transformers through Equivalent Modelscited by 3

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.