mlsanityData to 7 Oct 2026

Towards the Effect of Examples on In-Context Learning: A Theoretical Case Study

arXiv 2410.09411 ↗First posted 12 Oct 2024cs.LG stat.MLcited by 2

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) has emerged as a powerful capability for large language models (LLMs) to adapt to downstream tasks by leveraging a few (demonstration) examples. Despite its effectiveness, the mechanism behind ICL remains underexplored. To better understand how ICL integrates the examples with the knowledge learned by the LLM during pre-training (i.e., pre-training knowledge) and how the examples impact ICL, this paper conducts a theoretical study in binary classification tasks. In particular, we introduce a probabilistic model extending from the Gaussian mixture model to exactly quantify the impact of pre-training knowledge, label frequency, and label noise on the prediction accuracy. Based on our analysis, when the pre-training knowledge contradicts the knowledge in the examples, whether ICL prediction relies more on the pre-training knowledge or the examples depends on the number of examples. In addition, the label frequency and label noise of the examples both affect the accuracy of the ICL prediction, where the minor class has a lower accuracy, and how the label noise impacts the accuracy is determined by the specific noise level of the two classes. Extensive simulations are conducted to verify the correctness of the theoretical results, and real-data experiments also align with the theoretical insights. Our work reveals the role of pre-training knowledge and examples in ICL, offering a deeper understanding of LLMs' behaviors in classification tasks.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 34 of its 46 references that are in the map. First posted on arXiv 12 Oct 2024.

Builds on

34 of 46 references.

References · 34

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  6. 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,185
  7. 2022Large Language Models Encode Clinical Knowledgecited by 1,807
  8. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  9. 2023The Rise and Potential of Large Language Model Based Agents: A Surveycited by 1,422
  10. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  11. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
  12. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
22 more
  1. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  2. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  3. 2022Transformers learn in-context by gradient descentcited by 714
  4. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  5. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  6. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  7. 2023In-Context Learning Creates Task Vectorscited by 302
  8. 2023Function Vectors in Large Language Modelscited by 292
  9. 2023Poisoning Web-Scale Training Datasets is Practicalcited by 276
  10. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  11. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  12. 2022Active Example Selection for In-Context Learningcited by 195
  13. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  14. 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 158
  15. 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
  16. 2022Ground-Truth Labels Matter: A Deeper Look into Input-Label Demonstrationscited by 116
  17. 2023In-Context Convergence of Transformerscited by 112
  18. 2024Dual Operating Modes of In-Context Learningcited by 42
  19. 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
  20. 2020Sharp Statistical Guarantees for Adversarially Robust Gaussian Classificationcited by 27
  21. 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 23
  22. 2024Data Poisoning for In-context Learningcited by 21

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 0; 2026: 1.

2 papers.