mlsanityData to 14 Oct 2026

Understanding the Generalization of In-Context Learning in Transformers: An Empirical Study

arXiv 2503.15579 ↗First posted 19 Mar 2025cs.LGcited by 4

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) like GPT-4 and LLaMA-3 utilize the powerful in-context learning (ICL) capability of Transformer architecture to learn on the fly from limited examples. While ICL underpins many LLM applications, its full potential remains hindered by a limited understanding of its generalization boundaries and vulnerabilities. We present a systematic investigation of transformers' generalization capability with ICL relative to training data coverage by defining a task-centric framework along three dimensions: inter-problem, intra-problem, and intra-task generalization. Through extensive simulation and real-world experiments, encompassing tasks such as function fitting, API calling, and translation, we find that transformers lack inter-problem generalization with ICL, but excel in intra-task and intra-problem generalization. When the training data includes a greater variety of mixed tasks, it significantly enhances the generalization ability of ICL on unseen tasks and even on known simple tasks. This guides us in designing training data to maximize the diversity of tasks covered and to combine different tasks whenever possible, rather than solely focusing on the target task for testing.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 30 of its 34 references that are in the map. First posted on arXiv 19 Mar 2025.

Builds on

30 of 34 references.

References · 30

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2023GPT-4 Technical Reportcited by 18,396
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  5. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  7. 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
  8. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
  9. 2023Qwen Technical Reportcited by 3,344
  10. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
  11. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,947
  12. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
18 more
  1. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
  2. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  3. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  4. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  5. 2021Robust fine-tuning of zero-shot modelscited by 797
  6. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  7. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  8. 2021MetaICL: Learning to Learn In Contextcited by 454
  9. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  10. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  11. 2023Real-World Humanoid Locomotion with Reinforcement Learningcited by 187
  12. 2021Meta-learning via Language Model In-context Tuningcited by 164
  13. 2022On the Relation between Sensitivity and Accuracy in In-context Learningcited by 72
  14. 2024Humanoid Locomotion as Next Token Predictioncited by 69
  15. 2023In-context Example Selection with Influencescited by 61
  16. 2023Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Modelscited by 45
  17. 2023Using In-Context Learning to Improve Dialogue Safetycited by 42
  18. 2023A Closer Look at In-Context Learning under Distribution Shiftscited by 25

Built on by

Cited by year (2026 to 14 Oct)

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

4 papers.