mlsanityData to 14 Oct 2026

The Closeness of In-Context Learning and Weight Shifting for Softmax Regression

arXiv 2304.13276 ↗First posted 26 Apr 2023cs.CL cs.LGcited by 41

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) are known for their exceptional performance in natural language processing, making them highly effective in many human life-related or even job-related tasks. The attention mechanism in the Transformer architecture is a critical component of LLMs, as it allows the model to selectively focus on specific input parts. The softmax unit, which is a key part of the attention mechanism, normalizes the attention scores. Hence, the performance of LLMs in various NLP tasks depends significantly on the crucial role played by the attention mechanism with the softmax unit. In-context learning, as one of the celebrated abilities of recent LLMs, is an important concept in querying LLMs such as ChatGPT. Without further parameter updates, Transformers can learn to predict based on few in-context examples. However, the reason why Transformers becomes in-context learners is not well understood. Recently, several works [ASA+22,GTLV22,ONR+22] have studied the in-context learning from a mathematical perspective based on a linear regression formulation minx| Ax - b |2, which show Transformers' capability of learning linear functions in context. In this work, we study the in-context learning based on a softmax regression formulation minx | langle exp(Ax), bf 1n rangle-1 exp(Ax) - b |2 of Transformer's attention mechanism. We show the upper bounds of the data transformations induced by a single self-attention layer and by gradient-descent on a ℓ2 regression loss for softmax prediction function, which imply that when training self-attention-only Transformers for fundamental regression tasks, the models learned by gradient-descent and Transformers show great similarity.

Key facts. Cited by 41 papers in the map (data through 14 Oct 2026). Builds on 43 of its 93 references that are in the map. First posted on arXiv 26 Apr 2023.

Builds on

43 of 93 references.

References · 43

  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. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  5. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  6. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  7. 2020Reformer: The Efficient Transformercited by 1,668
  8. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  9. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  10. 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,059
  11. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  12. 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 876
31 more
  1. 2022Transformers learn in-context by gradient descentcited by 732
  2. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  3. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  4. 2018Universal Transformerscited by 647
  5. 2019Designing and Interpreting Probes with Control Taskscited by 640
  6. 2022BioGPT: Generative Pre-trained Transformer for Biomedical Text Generation and Miningcited by 538
  7. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
  8. 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 243
  9. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  10. 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 130
  11. 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
  12. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 106
  13. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  14. 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 102
  15. 2023Fast Attention Requires Bounded Entriescited by 102
  16. 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
  17. 2021Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Modelscited by 76
  18. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  19. 2020How Can Self-Attention Networks Recognize Dyck-n Languages?cited by 51
  20. 2023Attention Scheme Inspired Softmax Regressioncited by 49
  21. 2023Do Transformers Parse while Predicting the Masked Word?cited by 48
  22. 2020A Mathematical Theory of Attentioncited by 46
  23. 2023An Over-parameterized Exponential Regressioncited by 45
  24. 2023Solving Regularized Exp, Cosh and Sinh Regression Problemscited by 44
  25. 2020SMYRF: Efficient Attention using Asymmetric Clusteringcited by 43
  26. 2021Approximating How Single Head Attention Learnscited by 38
  27. 2023Algorithm and Hardness for Dynamic Attention Maintenance in Large Language Modelscited by 37
  28. 2023Randomized and Deterministic Attention Sparsification Algorithms for Over-parameterized Feature Dimensioncited by 37
  29. 2019Fully Quantized Transformer for Machine Translationcited by 36
  30. 2023Solving Tensor Low Cycle Rank Approximationcited by 8
  31. 2020Multi-Pass Transformer for Machine Translationcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 23; 2024: 8; 2025: 9; 2026: 1.

41 papers.

Sort:

By area:

  1. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
  2. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  3. 2023Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Timecited by 252
  4. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
  5. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
  6. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  7. 2023An Iterative Algorithm for Rescaled Hyperbolic Functions Regressioncited by 35
  8. 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
  9. 2023In-Context Learning for Attention Scheme: from Single Softmax Regression to Multiple Softmax Regression via a Tensor Trickcited by 32
  10. 2024Conv-Basis: A New Paradigm for Efficient Attention Inference and Gradient Computation in Transformerscited by 32
  11. 2023InfoPrompt: Information-Theoretic Soft Prompt Tuning for Natural Language Understandingcited by 30
  12. 2023Towards Trustworthy and Aligned Machine Learning: A Data-centric Survey with Causality Perspectivescited by 30
29 more
  1. 2023A Mathematical Abstraction for Balancing the Trade-off Between Creativity and Reality in Large Language Modelscited by 29
  2. 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
  3. 2023How to Protect Copyright Data in Optimization of Large Language Models?cited by 26
  4. 2023Beyond Classical Attention: Quantum Attention for Scalable Computationcited by 18
  5. 2023Do pretrained Transformers Learn In-Context by Gradient Descent?cited by 18
  6. 2024How do Large Language Models Learn In-Context? Query and Key Matrices of In-Context Heads are Two Towers for Metric Learningcited by 18
  7. 2023Zero-th Order Algorithm for Softmax Attention Optimizationcited by 16
  8. 2024Exploring the Frontiers of Softmax: Provable Optimization, Applications in Diffusion Model, and Beyondcited by 15
  9. 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 14
  10. 2023A Unified Scheme of ResNet and Softmaxcited by 12
  11. 2023Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention Weightscited by 12
  12. 2025Sample Complexity and Representation Ability of Test-time Scaling Paradigmscited by 12
  13. 2023Efficient SGD Neural Network Training via Sublinear Activated Neuron Identificationcited by 11
  14. 2023Federated Empirical Risk Minimization via Second-Order Methodcited by 9
  15. 2023An Automatic Learning Rate Schedule Algorithm for Achieving Faster Convergence and Steeper Descentcited by 9
  16. 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attackscited by 9
  17. 2023The Expressibility of Polynomial based Attention Schemecited by 7
  18. 2023A Theoretical Insight into Attack and Defense of Gradient Leakage in Transformercited by 6
  19. 2025The Role of Diversity in In-Context Learning for Large Language Modelscited by 6
  20. 2025DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfercited by 5
  21. 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
  22. 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3
  23. 2025ConText: Driving In-context Learning for Text Removal and Segmentationcited by 3
  24. 2025On Theoretical Interpretations of Concept-Based In-Context Learningcited by 3
  25. 2024Where does In-context Translation Happen in Large Language Modelscited by 1
  26. 2024A Theoretical Survey on Foundation Modelscited by 1
  27. 2025Brewing Knowledge in Context: Distillation Perspectives on In-Context Learningcited by 1
  28. 2025Genomic Next-Token Predictors are In-Context Learnerscited by 1
  29. 2026Graph-based Target Back-Propagation for Context Adaptation in Multi-LLM Agentic Systemscited by 0