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