Lune

ICLR2025Top-tier venue

Investigating the Pre-Training Dynamics of In-Context Learning: Task Recognition vs. Task Learning

Xiaolei Wang, Xinyu Tang, Junyi Li, Xin Zhao, Ji-Rong Wen

Abstract

The emergence of in-context learning (ICL) is potentially attributed to two major abilities: task recognition (TR) for recognizing the task from demonstrations and utilizing pre-trained priors, and task learning (TL) for learning from demonstrations. However, relationships between the two abilities and how such relationships affect the emergence of ICL is unclear. In this paper, we take the first step by examining the pre-training dynamics of the emergence of ICL. With carefully designed metrics, we find that these two abilities are, in fact, competitive during pre-training. Moreover, we observe a strong negative correlation between the competition and ICL performance. Further analysis of common pre-training factors (i.e., model size, dataset size, and data curriculum) demonstrates possible ways to manage the competition. Based on these insights, we propose a simple yet effective method to better integrate these two abilities for ICL at inference time. Through adaptive ensemble learning, the performance of ICL can be significantly boosted, enabling two small models to outperform a larger one with more than twice the parameters. The code is available at https://github.com/RUCAIBox/Competitive-ICL.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling cites Language Models are Few-Shot Learners
  • A Survey on In-context Learning cites Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
  • A Survey on In-context Learning cites Language Models are Few-Shot Learners
  • Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? cites Language Models are Few-Shot Learners
  • Strategy Coopetition Explains the Emergence and Transience of In-Context Learning cites Language Models are Few-Shot Learners
  • Prior Forgetting and In-Context Overfitting cites Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
  • Prior Forgetting and In-Context Overfitting cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Prior Forgetting and In-Context OverfittingSungyoon LeeNeurIPS 2025 · 1 citation
  2. ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution CiphersZhouxiang Fang, Aayush Mishra, Muhan Gao, Anqi Liu et al.EMNLP 2025
  3. Strategy Coopetition Explains the Emergence and Transience of In-Context LearningAaditya K. Singh, Ted Moskovitz, Sara Dragutinovic, Felix Hill et al.ICML 2025

Builds on13

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley et al.ICML 2023 · 1,822 citations
  3. Federated Learning with Matched AveragingHongyi Wang, Mikhail Yurochkin, Yuekai Sun, Dimitris S. Papailiopoulos et al.ICLR 2020 · 1,368 citations
  4. Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe et al.EMNLP 2022 · 634 citations
  5. A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng et al.EMNLP 2024 · 479 citations

Related papers

  1. What Do Language Models Learn in Context? The Structured Task HypothesisJiaoda Li, Yifan Hou, Mrinmaya Sachan, Ryan CotterellACL 2024 · 5 citations
  2. What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task LearningJane Pan, Tianyu Gao, Howard Chen, Danqi ChenACL Findings 2023 · 29 citations
  3. When can in-context learning generalize out of task distribution?Page C. Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. SchwabICML 2025
  4. Debiasing In-Context Learning by Instructing LLMs How to Follow DemonstrationsLvxue Li, Jiaqi Chen, Xinyu Lu, Yaojie Lu et al.ACL Findings 2024 · 5 citations
  5. Revisiting In-context Learning Inference Circuit in Large Language ModelsHakaze Cho, Mariko Kato, Yoshihiro Sakai, Naoya InoueICLR 2025
Dusk over the sea between two cliffs drawn in fine vertical lines