cs.CLOct 13, 2026

From Copying to Composition: How Language Models Develop In-Context Learning

Authors: Minglai Yang, Xinyu Guo, Renxiong Wang, Sunjie Hou, Daniel Yue Zhang, Yunzhong He

Organizations: Scale AI · University of Arizona

Abstract

In-context learning (ICL) allows language models to adapt their behavior from instructions and demonstrations in a prompt, but accuracy alone does not reveal how contextual information controls their predictions. We study the acquisition and trainability of ICL with a controlled diagnostic that separates copying a nearby demonstration from integrating information across the prompt. Across 17 models, about a third prefer the copied answer, a few are undecided, and the rest prefer the rule-consistent answer, which goes with higher accuracy and with control by the requested value rather than the closest conflicting example. Checkpoint analyses show that models begin prioritizing task-relevant prompt tokens over conflicting examples long before their accuracy improves beyond chance level. In matched training experiments, synthetic documents that define endings and then query them shift models toward compositional responses on the controlled diagnostic, whereas fine-tuning on definition exercises built from rewritten real documents improves accuracy when prompts reassign label meanings. The results suggest that ICL is not acquired as a single, uniform capability. Instead, prompt control, answer preference, construction without candidates, and transfer can develop along distinct trajectories.

Figures & tables

Appendix figures & tables16 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Compile, Don't Memorize: A Context Compilation Architecture (CCA) for In-Context Learning

    Sep 1, 2026Jinhu Qi, Minda Hu, Wentao Zhang +4Instruction FollowingIn-Context Learning

  2. Label Collapse in Diffusion Language Model In-Context Learning

    Oct 12, 2026Ziye Guo, Ye YuanIn-Context LearningLLM Evaluation

  3. A Theoretical Interpretation of In-Context Learning via Probabilistic Modeling

    Jun 27, 2026Zhenyu Liu, Huaze Tang, Shao-Lun HuangIn-Context LearningExponential Family