Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformers
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
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
27 more
- 2020Rethinking Attention with Performerscited by 1,584
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
- 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
- 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,023
- 2022Mass-Editing Memory in a Transformercited by 976
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
- 2021Knowledge Neurons in Pretrained Transformerscited by 590
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
- 2023Larger language models do in-context learning differentlycited by 386
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Can We Edit Factual Knowledge by In-Context Learning?cited by 284
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2022Learning by Distilling Contextcited by 128
- 2024The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicrycited by 119
- 2023Generalization on the Unseen, Logic Reasoning and Degree Curriculumcited by 73
- 2022The Dual Form of Neural Networks Revisited: Connecting Test Time Predictions to Training Patterns via Spotlights of Attentioncited by 45
- 2017Adaptive Sampled Softmax with Kernel Based Samplingcited by 38
- 2022Prompt Injection: Parameterization of Fixed Inputscited by 35
- 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanismcited by 15
- 2021On Learning the Transformer Kernelcited by 14
- 2024AlgoFormer: An Efficient Transformer Framework with Algorithmic Structurescited by 11
- 2023Role of Bias Terms in Dot-Product Attentioncited by 4
Built on by
Citing papers per year: 2025: 5; 2026: 1.
6 papers.
- 2025Learning without training: The implicit dynamics of in-context learningcited by 41
- 2025ContextNav: Towards Agentic Multimodal In-Context Learningcited by 9
- 2025PrefixMemory-Tuning: Modernizing Prefix-Tuning by Decoupling the Prefix from Attentioncited by 4
- 2025Transmuting prompts into weightscited by 3
- 2025IA2: Alignment with ICL Activations Improves Supervised Fine-Tuningcited by 1
- 2026When Can Prefixes Compile LoRA? Exact Resource-Capped Tests for Frozen Attentioncited by 0
- 2026When Can Prefixes Compile LoRA? Exact Resource-Capped Tests for Frozen Attention29 Sep 2026
- 2025Transmuting prompts into weights9 Oct 2025
- 2025ContextNav: Towards Agentic Multimodal In-Context Learning6 Oct 2025
- 2025IA2: Alignment with ICL Activations Improves Supervised Fine-Tuning26 Sep 2025
- 2025Learning without training: The implicit dynamics of in-context learning21 Jul 2025
- 2025PrefixMemory-Tuning: Modernizing Prefix-Tuning by Decoupling the Prefix from Attention16 Jun 2025