On the Role of Depth and Looping for In-Context Learning with Task Diversity
Not on the map. Why?
Abstract (arXiv)
The intriguing in-context learning (ICL) abilities of deep Transformer models have lately garnered significant attention. By studying in-context linear regression on unimodal Gaussian data, recent empirical and theoretical works have argued that ICL emerges from Transformers' abilities to simulate learning algorithms like gradient descent. However, these works fail to capture the remarkable ability of Transformers to learn multiple tasks in context. To this end, we study in-context learning for linear regression with diverse tasks, characterized by data covariance matrices with condition numbers ranging from [1, kappa], and highlight the importance of depth in this setting. More specifically, (a) we show theoretical lower bounds of log(kappa) (or √kappa) linear attention layers in the unrestricted (or restricted) attention setting and, (b) we show that multilayer Transformers can indeed solve such tasks with a number of layers that matches the lower bounds. However, we show that this expressivity of multilayer Transformer comes at the price of robustness. In particular, multilayer Transformers are not robust to even distributional shifts as small as O(e-L) in Wasserstein distance, where L is the depth of the network. We then demonstrate that Looped Transformers -- a special class of multilayer Transformers with weight-sharing -- not only exhibit similar expressive power but are also provably robust under mild assumptions. Besides out-of-distribution generalization, we also show that Looped Transformers are the only models that exhibit a monotonic behavior of loss with respect to depth.
Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). Builds on 34 of its 36 references that are in the map. First posted on arXiv 29 Oct 2024.
Builds on
34 of 36 references.
References · 34
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2017BranchyNet: Fast Inference via Early Exiting from Deep Neural Networkscited by 596
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
22 more
- 2022Confident Adaptive Language Modelingcited by 310
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2023Looped Transformers as Programmable Computerscited by 237
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2020Provable Meta-Learning of Linear Representationscited by 161
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
- 2021Deep Learning Through the Lens of Example Difficultycited by 141
- 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
- 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 105
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 98
- 2019Meta-Learning without Memorizationcited by 92
- 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
- 2024Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning?cited by 65
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 24
- 2023Trainable Transformer in Transformercited by 17
- 2023Towards Anytime Classification in Early-Exit Architectures by Enforcing Conditional Monotonicitycited by 16
- 2022The Effect of Diversity in Meta-Learningcited by 14
Built on by
Citing papers per year: 2025: 4; 2026: 7.
11 papers.
- 2025Reasoning with Latent Thoughts: On the Power of Looped Transformerscited by 240
- 2025Scaling Latent Reasoning via Looped Language Modelscited by 165
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 46
- 2026Recurrent-Depth VLA: Implicit Test-Time Compute Scaling of Vision-Language-Action Models via Latent Iterative Reasoningcited by 18
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 16
- 2026Solve the Loop: Attractor Models for Language and Reasoningcited by 13
- 2026Prioritize the Process, Not Just the Outcome: Rewarding Latent Thought Trajectories Improves Reasoning in Looped Language Modelscited by 8
- 2026Loop the Loopies!cited by 8
- 2026LT2: Linear-Time Looped Transformerscited by 7
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMscited by 0
- 2026Beyond What Seems Necessary: Hidden Gains from Scaling Training-Time Reasoning Length under Outcome Supervisioncited by 0
- 2026Loop the Loopies!17 Jul 2026
- 2026LT2: Linear-Time Looped Transformers20 May 2026
- 2026Solve the Loop: Attractor Models for Language and Reasoning12 May 2026
- 2026Prioritize the Process, Not Just the Outcome: Rewarding Latent Thought Trajectories Improves Reasoning in Looped Language Models11 Feb 2026
- 2026Recurrent-Depth VLA: Implicit Test-Time Compute Scaling of Vision-Language-Action Models via Latent Iterative Reasoning8 Feb 2026
- 2026Beyond What Seems Necessary: Hidden Gains from Scaling Training-Time Reasoning Length under Outcome Supervision31 Jan 2026
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs31 Jan 2026
- 2025Scaling Latent Reasoning via Looped Language Models29 Oct 2025
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time1 Oct 2025
- 2025Reasoning with Latent Thoughts: On the Power of Looped Transformers24 Feb 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025