mlsanityData to 7 Oct 2026

Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformers

arXiv 2406.02847 ↗First posted 5 Jun 2024cs.LG stat.MLcited by 6

Not on the map. Why?

Abstract (arXiv)

In-Context Learning (ICL) has been a powerful emergent property of large language models that has attracted increasing attention in recent years. In contrast to regular gradient-based learning, ICL is highly interpretable and does not require parameter updates. In this paper, we show that, for linearized transformer networks, ICL can be made explicit and permanent through the inclusion of bias terms. We mathematically demonstrate the equivalence between a model with ICL demonstration prompts and the same model with the additional bias terms. Our algorithm (ICLCA) allows for exact conversion in an inexpensive manner. Existing methods are not exact and require expensive parameter updates. We demonstrate the efficacy of our approach through experiments that show the exact incorporation of ICL tokens into a linear transformer. We further suggest how our method can be adapted to achieve cheap approximate conversion of ICL tokens, even in regular transformer networks that are not linearized. Our experiments on GPT-2 show that, even though the conversion is only approximate, the model still gains valuable context from the included bias terms.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 39 of its 47 references that are in the map. First posted on arXiv 5 Jun 2024.

Builds on

39 of 47 references.

References · 39

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  7. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  8. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  9. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  10. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  11. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  12. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
27 more
  1. 2020Rethinking Attention with Performerscited by 1,584
  2. 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
  3. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
  4. 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,023
  5. 2022Mass-Editing Memory in a Transformercited by 976
  6. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  7. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  8. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  9. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
  10. 2021Knowledge Neurons in Pretrained Transformerscited by 590
  11. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
  12. 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
  13. 2023Larger language models do in-context learning differentlycited by 386
  14. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  15. 2023Can We Edit Factual Knowledge by In-Context Learning?cited by 284
  16. 2023Looped Transformers as Programmable Computerscited by 224
  17. 2023Birth of a Transformer: A Memory Viewpointcited by 154
  18. 2022Learning by Distilling Contextcited by 128
  19. 2024The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicrycited by 119
  20. 2023Generalization on the Unseen, Logic Reasoning and Degree Curriculumcited by 73
  21. 2022The Dual Form of Neural Networks Revisited: Connecting Test Time Predictions to Training Patterns via Spotlights of Attentioncited by 45
  22. 2017Adaptive Sampled Softmax with Kernel Based Samplingcited by 38
  23. 2022Prompt Injection: Parameterization of Fixed Inputscited by 35
  24. 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanismcited by 15
  25. 2021On Learning the Transformer Kernelcited by 14
  26. 2024AlgoFormer: An Efficient Transformer Framework with Algorithmic Structurescited by 11
  27. 2023Role of Bias Terms in Dot-Product Attentioncited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 5; 2026: 1.

6 papers.