Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models
Not on the map. Why?
Abstract (arXiv)
Transformer-based large language models exhibit in-context learning, enabling adaptation to downstream tasks via few-shot prompting with demonstrations. In practice, such models are often fine-tuned to improve zero-shot performance on downstream tasks, allowing them to solve tasks without examples and thereby reducing inference costs. However, fine-tuning can degrade in-context learning, limiting the performance of fine-tuned models on tasks not seen during fine-tuning. Using linear attention models, we provide a theoretical analysis that characterizes how fine-tuning objectives modify attention parameters and identifies conditions under which this leads to degraded few-shot performance. We show that fine-tuning all attention parameters can harm in-context learning, whereas restricting updates to the value matrix improves zero-shot performance while preserving in-context learning. We further show that incorporating an auxiliary few-shot loss enhances in-context learning primarily on the target task, at the expense of degraded in-context learning ability on tasks not seen during fine-tuning. We provide empirical evidence from synthetic and real-world datasets consistent with the qualitative predictions of our theory.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 40 of its 52 references that are in the map. First posted on arXiv 26 Feb 2026.
Builds on
40 of 52 references.
References · 40
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2024Qwen2.5 Technical Reportcited by 4,713
- 2023A Survey of Large Language Modelscited by 2,537
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,442
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
28 more
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 679
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 471
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2021Pre-Trained Models: Past, Present and Futurecited by 319
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2024Many-Shot In-Context Learningcited by 203
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
- 2023Few-shot Fine-tuning vs. In-context Learning: A Fair Comparison and Evaluationcited by 134
- 2023In-Context Convergence of Transformerscited by 112
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 97
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
- 2024Dual Operating Modes of In-Context Learningcited by 42
- 2022Two-stage LLM Fine-tuning with Less Specialization and More Generalizationcited by 39
- 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 39
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
- 2025Test-Time Training Provably Improves Transformers as In-context Learnerscited by 15
- 2024On the Loss of Context-awareness in General Instruction Fine-tuningcited by 10
- 2024Theoretical Insights into Fine-Tuning Attention Mechanism: Generalization and Optimizationcited by 9
- 2022Expected Value of Matrix Quadratic Forms with Wishart distributed Random Matricescited by 1
Built on by
Citing papers per year: 2026: 1.
1 paper.