From Copying to Composition: How Language Models Develop In-Context Learning
Minglai Yang, Xinyu Guo, Renxiong Wang, Sunjie Hou, Daniel Yue Zhang, Yunzhong He
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.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
- Comments
- 29 pages, 17 figures, 8 tables
Related papers
How Many Examples, and Which Ones? A Study of In-Context Learning for Natural Language Inference
Shared title terminologycs.CLGeorgos Dikaios, Isidoros Perikos, Ioannis Hatzilygeroudis
NORMCRAFT: Cultural Norm Generation for Context-Aware Language Model Alignment
Shared title terminologycs.CLTangyuan Zhang, Zhuang Li, Fatemeh Shiri et al.
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
ReaDy: Recurrent States as Dynamic Context for Speculative Drafting in Hybrid Linear Attention Large Language Models
Shared title terminologycs.CLBohan Sun, Zunhai Su, Xialie Zhuang et al.
Cross-Model In-Context Neurofeedback Reveals (Limited) Activation Control in LLMs
Shared title terminologycs.CLDavide Baldelli, Robyn Kozierok, Mirko Bronzi et al.
Copy-Paste Language Models
Shared title terminologycs.CLNathan Godey, Yoav Artzi