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

ABSTRACT 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' behaviours in classification tasks.

Authors

Institutions

Publication Details

Journal
Stat
Published
2025-02-05
DOI
https://doi.org/10.1002/sta4.70045
Citations
1
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
2.48

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Jiliang Tang, Yue Xing, Makoto Yamada, Hui Liu et al.
1 citations
Stat
Topic Modeling
2.48
article

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

Jiliang Tang, Yue Xing, Makoto Yamada, Hui Liu, Han Xu, Pengfei He, Yingqian Cui
article en
1 citations

Abstract

ABSTRACT 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' behaviours in classification tasks.

StatVol. 14(1)
University of Arizona (US), Okinawa Institute of Science and Technology Graduate University (JP), Michigan State University (US)
National Science Foundation, Microsoft, Army Research Office
Openalex Percentile: Top 12%
Topic Modeling
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.