mlsanityData to 14 Oct 2026

On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recovery

arXiv 2410.13981 ↗First posted 17 Oct 2024cs.LG cs.AIcited by 6

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  5. 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
  6. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
  7. 2022LaMDA: Language Models for Dialog Applicationscited by 1,220
  8. 2020Meta-Learning in Neural Networks: A Surveycited by 950
  9. 2022Transformers learn in-context by gradient descentcited by 732
  10. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  11. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  12. 2016Learning to learn by gradient descent by gradient descentcited by 620
32 more
  1. 2017Deep Learning for Medical Image Analysiscited by 401
  2. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  3. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  4. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  5. 2021Learning to Optimize: A Primer and A Benchmarkcited by 208
  6. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  7. 2016Learning to Optimizecited by 195
  8. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  9. 2017No Spurious Local Minima in Nonconvex Low Rank Problems: A Unified Geometric Analysiscited by 129
  10. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
  11. 2023In-Context Convergence of Transformerscited by 115
  12. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
  13. 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
  14. 2018Theoretical Linear Convergence of Unfolded ISTA and its Practical Weights and Thresholdscited by 85
  15. 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
  16. 2023Transformers as Support Vector Machinescited by 74
  17. 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
  18. 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
  19. 2023Max-Margin Token Selection in Attention Mechanismcited by 58
  20. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  21. 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 46
  22. 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
  23. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  24. 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
  25. 2017The Global Optimization Geometry of Low-Rank Matrix Optimizationcited by 25
  26. 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 24
  27. 2024Provably learning a multi-head attention layercited by 21
  28. 2021Learning to Solve Hard Minimal Problemscited by 19
  29. 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
  30. 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 14
  31. 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
  32. 2024Learning-to-Optimize with PAC-Bayesian Guarantees: Theoretical Considerations and Practical Implementationcited by 6

Built on by

Cited by year (2026 to 14 Oct)

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

6 papers.