Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspective
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) operate in two fundamental learning modes - fine-tuning (FT) and in-context learning (ICL) - raising key questions about which mode yields greater language proficiency and whether they differ in their inductive biases. Prior studies comparing FT and ICL have yielded mixed and inconclusive results due to inconsistent experimental setups. To enable a rigorous comparison, we propose a formal language learning task - offering precise language boundaries, controlled string sampling, and no data contamination - and introduce a discriminative test for language proficiency, where an LLM succeeds if it assigns higher generation probability to in-language strings than to out-of-language strings. Empirically, we find that: (a) FT has greater language proficiency than ICL on in-distribution generalization, but both perform equally well on out-of-distribution generalization. (b) Their inductive biases, measured by the correlation in string generation probabilities, are similar when both modes partially learn the language but diverge at higher proficiency levels. (c) Unlike FT, ICL performance differs substantially across models of varying sizes and families and is sensitive to the token vocabulary of the language. Thus, our work demonstrates the promise of formal languages as a controlled testbed for evaluating LLMs, behaviors that are difficult to isolate in natural language datasets. Our source code is available at https://github.com/bishwamittra/formallm.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 46 of its 70 references that are in the map. First posted on arXiv 25 Apr 2026.
Builds on
46 of 70 references.
References · 46
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,682
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 896
- 2024MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategiescited by 723
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
34 more
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2022Neural Networks and the Chomsky Hierarchycited by 217
- 2024When Scaling Meets LLM Finetuning: The Effect of Data, Model and Finetuning Methodcited by 204
- 2021How Many Data Points is a Prompt Worth?cited by 198
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 152
- 2024ProSA: Assessing and Understanding the Prompt Sensitivity of LLMscited by 149
- 2023Few-shot Fine-tuning vs. In-context Learning: A Fair Comparison and Evaluationcited by 136
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 128
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
- 2023Do We Still Need Clinical Language Models?cited by 98
- 2024In-Context Language Learning: Architectures and Algorithmscited by 89
- 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
- 2024Why are Sensitive Functions Hard for Transformers?cited by 74
- 2023BUFFET: Benchmarking Large Language Models for Few-shot Cross-lingual Transfercited by 68
- 2018Are All Languages Equally Hard to Language-Model?cited by 53
- 2019What Kind of Language Is Hard to Language-Model?cited by 50
- 2024Fine Tuning vs. Retrieval Augmented Generation for Less Popular Knowledgecited by 50
- 2024Dual Operating Modes of In-Context Learningcited by 43
- 2022Characterizing Intrinsic Compositionality in Transformers with Tree Projectionscited by 41
- 2021Examining the Inductive Bias of Neural Language Models with Artificial Languagescited by 40
- 2019Studying the Inductive Biases of RNNs with Synthetic Variations of Natural Languagescited by 37
- 2023Injecting structural hints: Using language models to study inductive biases in language learningcited by 35
- 2024Training on the Test Task Confounds Evaluation and Emergencecited by 34
- 2022Exploring The Landscape of Distributional Robustness for Question Answering Modelscited by 23
- 2023Instruction Tuned Models are Quick Learnerscited by 21
- 2024Deeper Insights Without Updates: The Power of In-Context Learning Over Fine-Tuningcited by 21
- 2024What Languages are Easy to Language-Model? A Perspective from Learning Probabilistic Regular Languagescited by 20
- 2024Comparing Specialised Small and General Large Language Models on Text Classification: 100 Labelled Samples to Achieve Break-Even Performancecited by 18
- 2023Transformer Working Memory Enables Regular Language Reasoning and Natural Language Length Extrapolationcited by 13
- 2023TART: A plug-and-play Transformer module for task-agnostic reasoningcited by 10
- 2023Transparency at the Source: Evaluating and Interpreting Language Models With Access to the True Distributioncited by 10
- 2024Towards Reliable Latent Knowledge Estimation in LLMs: Zero-Prompt Many-Shot Based Factual Knowledge Extractioncited by 7
- 2024Comparative Analysis of Different Efficient Fine Tuning Methods of Large Language Models (LLMs) in Low-Resource Settingcited by 5
- 2023Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languagescited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.