From Copying to Composition: How Language Models Develop In-Context Learning
cs.CL, cs.AI, cs.LG
Submitted: 2026-10-13
Updated: 2026-10-13
Comments: 29 pages, 17 figures, 8 tables
License: http://creativecommons.org/licenses/by/4.0/
The gist: 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
Terminology
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.
Sources
- SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model
- The Dual-Route Model of Induction
- The Pile: An 800GB Dataset of Diverse Text for Language Modeling
- Gemma 3 Technical Report
- Localizing Model Behavior with Path Patching
- How to use and interpret activation patching
- YuLan-Mini: An Open Data-efficient Language Model
- Qwen2.5-Coder Technical Report
- INTELLECT-1 Technical Report
- Task Schema and Binding: A Double Dissociation Study of In-Context Learning
- What do Language Models Learn and When? The Implicit Curriculum Hypothesis
- LLM360: Towards Fully Transparent Open-Source LLMs
- Copy Suppression: Comprehensively Understanding an Attention Head
- OLMoE: Open Mixture-of-Experts Language Models
- Opening the Black Box: A Survey on the Mechanisms of Multi-Step Reasoning in Large Language Models
- The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale
- Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Tracking
- Qwen2.5 Technical Report
- Olmo 3
- 2 OLMo 2 Furious
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering