TL;DR
This paper investigates how language models learn to perform compositional tasks using "trigger compositions" (sequences of instructions). They find that using a "scratchpad" – visible intermediate steps before the final answer – is crucial for reliable performance, especially for longer sequences. However, simply adding reasoning text after the answer or using very compact scratchpads doesn't yield the same benefits.
What Problem Does This Paper Address?
Modern language models are increasingly adept at following complex instructions. A key challenge is understanding how they handle compositional tasks, where multiple learned operations must be chained together in a specific order. Think of it like a recipe: you need to perform step 1, then step 2, then step 3, and so on. If the model can only do individual steps well but struggles to combine them, its usefulness is limited. This paper explores how language models learn to compose these operations, focusing on the role of intermediate "scratchpad" text that can guide the model's reasoning process. They specifically investigate whether this scratchpad needs to be a pre-answer workspace, what kind of structure it should have, and if this learned skill transfers to direct answering without any intermediate steps.
Methods
The researchers designed a controlled experiment using deterministic arithmetic triggers. These triggers are simple functions applied to integers (e.g., "if the number is odd, add 1; otherwise, add 2"). By composing these triggers, they created tasks of varying complexity (depth 1, 2, and 3). The core of their investigation lies in comparing different "output formats" for the language model:
- Direct: The model outputs only the final answer.
- Scratchpad (brief): The model outputs compact, symbolic intermediate steps before the final answer.
- Scratchpad (full): The model outputs verbose, natural-language intermediate steps before the final answer.
- Answer-first (verify): The model outputs the final answer first, followed by verification steps.
- Brief-post: The model outputs the final answer, followed by the same symbolic intermediate steps as the "brief" scratchpad, but after the answer.
They trained language models (LLaMA-3.2-3B-Instruct) on these different formats and then evaluated their performance on held-out inputs and, crucially, on held-out composition depths (length generalization).
Datasets
The paper uses a custom dataset of 15 trigger compositions: 3 atomic triggers, 6 ordered length-2 compositions, and 6 ordered length-3 compositions. The experiments involve splitting these compositions for training and evaluation, as well as creating a specific split for length generalization where depth-3 compositions are held out from training.
Key Insights and Ideas
- Scratchpad as a Workspace is Key: The most significant finding is that the placement of intermediate steps matters immensely. Having a scratchpad before the final answer acts as a crucial workspace, allowing the model to condition its subsequent steps.
- Reasoning Text Alone Isn't Enough: Simply appending explanatory text after the answer (like in the "brief-post" format) provides little benefit. This suggests that the value of a scratchpad isn't just in providing reasoning, but in guiding the generation process before the final output is committed.
- Structure Matters for Generalization: While compact symbolic scratchpads are effective for learned composition depths, they struggle to generalize to longer sequences. Verbose, self-contained natural-language descriptions of each step, however, show much better length generalization. This implies that the extensibility of the step representation is vital for handling unseen complexities.
- Compositional Skill Isn't Automatically Direct: Training with scratchpads significantly improves performance on tasks requiring intermediate steps. However, this skill doesn't automatically transfer to direct answering without the scratchpad. The model's ability to compose triggers appears to be channel-dependent.
- Prompting Isn't a Substitute for Fine-tuning: Simple in-context prompting with examples of the desired scratchpad format doesn't replicate the gains achieved through fine-tuning. This suggests that the model is truly learning to use the scratchpad as a workspace, not just mimicking a format.
Key Results
- Held-out Input Performance: Pre-answer scratchpad formats (brief and full) achieved near-ceiling accuracy (98.6% and 99.4%) on 3-trigger compositions with held-out inputs. In contrast, direct answering and answer-first verification formats performed poorly (around 20-26%).
- Placement Ablation: Moving the same symbolic scratchpad work from before the answer to after the answer (brief vs. brief-post) caused accuracy to drop from near-perfect to around 30%.
- Length Generalization: When trained only on depth 1 and 2 compositions and tested on depth 3:
- Verbose "full" scratchpads maintained high accuracy (83-93%).
- Compact "brief" scratchpads collapsed significantly (23-41%).
- Direct Answering Weakness: Even in mixed-format training (e.g., E7: d+b+f), the direct channel remained weak (9.7% accuracy), highlighting the channel-dependent nature of the learned skill.
- Prompting Baseline: Five-shot prompting achieved only 0-11.7% accuracy, far below fine-tuned scratchpad performance.
Limitations and Future Work
- Single Model Family: All experiments used LLaMA-3.2-3B-Instruct. It's unknown if these findings generalize to other model families, scales, or decoding strategies.
- Bounded Composition Depth: The study was limited to depth 3. The behavior of longer trigger sequences (depth 4+) remains an open question, as does whether the catastrophic collapse observed for compact scratchpads would worsen.
- Prompting Scope: While the five-shot prompting baseline showed limitations, it was a modest study. Larger models, more demonstrations, or self-consistency techniques might narrow the gap.
- Placement Ablation Nuance: The placement comparison used separate models for brief and brief-post. A stricter test would involve prompting the same model with both formats.
- Additional Mixtures Single-Seed: Some auxiliary mixtures were run with only a single seed, limiting their statistical robustness.
- Proxy Task: The use of arithmetic triggers provides exact evaluation but might not fully capture the nuances of natural-language control. A pilot study with natural-language triggers would be valuable.
- Failure Mode Analysis: Investigating why post-answer reasoning fails (e.g., by auditing incorrect answers and their rationalizations) is a promising future direction.
The authors suggest that for deployment, explicit scratchpads should not be treated as disposable training scaffolds. If direct answering is required, an explicit internalization or distillation stage is necessary. Otherwise, the operational interface should preserve a pre-answer computation channel. They propose evaluating scratchpad design along three axes: placement, extensibility of step representation, and transfer to direct answering.
Summary updated