On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recovery
Not on the map. Why?
Abstract (arXiv)
An intriguing property of the Transformer is its ability to perform in-context learning (ICL), where the Transformer can solve different inference tasks without parameter updating based on the contextual information provided by the corresponding input-output demonstration pairs. It has been theoretically proved that ICL is enabled by the capability of Transformers to perform gradient-descent algorithms (Von Oswald et al., 2023a; Bai et al., 2024). This work takes a step further and shows that Transformers can perform learning-to-optimize (L2O) algorithms. Specifically, for the ICL sparse recovery (formulated as LASSO) tasks, we show that a K-layer Transformer can perform an L2O algorithm with a provable convergence rate linear in K. This provides a new perspective explaining the superior ICL capability of Transformers, even with only a few layers, which cannot be achieved by the standard gradient-descent algorithms. Moreover, unlike the conventional L2O algorithms that require the measurement matrix involved in training to match that in testing, the trained Transformer is able to solve sparse recovery problems generated with different measurement matrices. Besides, Transformers as an L2O algorithm can leverage structural information embedded in the training tasks to accelerate its convergence during ICL, and generalize across different lengths of demonstration pairs, where conventional L2O algorithms typically struggle or fail. Such theoretical findings are supported by our experimental results.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 44 of its 60 references that are in the map. First posted on arXiv 17 Oct 2024.
Builds on
44 of 60 references.
References · 44
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
- 2022LaMDA: Language Models for Dialog Applicationscited by 1,220
- 2020Meta-Learning in Neural Networks: A Surveycited by 950
- 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
- 2016Learning to learn by gradient descent by gradient descentcited by 620
32 more
- 2017Deep Learning for Medical Image Analysiscited by 401
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2021Learning to Optimize: A Primer and A Benchmarkcited by 208
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2016Learning to Optimizecited by 195
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2017No Spurious Local Minima in Nonconvex Low Rank Problems: A Unified Geometric Analysiscited by 129
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
- 2023In-Context Convergence of Transformerscited by 115
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2018Theoretical Linear Convergence of Unfolded ISTA and its Practical Weights and Thresholdscited by 85
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2023Transformers as Support Vector Machinescited by 74
- 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2023Max-Margin Token Selection in Attention Mechanismcited by 58
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 46
- 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2017The Global Optimization Geometry of Low-Rank Matrix Optimizationcited by 25
- 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 24
- 2024Provably learning a multi-head attention layercited by 21
- 2021Learning to Solve Hard Minimal Problemscited by 19
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 14
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
- 2024Learning-to-Optimize with PAC-Bayesian Guarantees: Theoretical Considerations and Practical Implementationcited by 6
Built on by
Citing papers per year: 2025: 2; 2026: 4.
6 papers.
- 2025Towards Theoretical Understanding of Transformer Test-Time Computing: Investigation on In-Context Linear Regressioncited by 3
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformerscited by 2
- 2026The Scaling Properties of Implicit Deductive Reasoning in Transformerscited by 1
- 2025From Text to Trajectories: GPT-2 as an ODE Solver via In-Contextcited by 0
- 2026Understanding Generalization and Forgetting in In-Context Continual Learningcited by 0
- 2026High-probability guarantees for linear accessibility in feature superpositioncited by 0
- 2026High-probability guarantees for linear accessibility in feature superposition9 Sep 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026The Scaling Properties of Implicit Deductive Reasoning in Transformers5 May 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Towards Theoretical Understanding of Transformer Test-Time Computing: Investigation on In-Context Linear Regression11 Aug 2025
- 2025From Text to Trajectories: GPT-2 as an ODE Solver via In-Context5 Aug 2025