Learning Compositional Tasks via Trigger Compositions: Using Scratchpads as Pre-Answer Workspaces
Abstract
Modern instruction-tuned language models perform increasingly well on complicated tasks, but it remains unclear how this capability extends to compositional tasks that require several learned operations to be applied in sequence. We study this question through trigger compositions: short tags that specify operations to be composed and applied in order. We instantiate triggers as deterministic arithmetic operations, so every output has a unique correct answer. Our central hypothesis is that the model benefits from a scratchpad -- visible intermediate text generated before the final answer -- and we study which properties of the scratchpad matter. In this controlled setting, pre-answer scratchpads support reliable composed execution on new numeric inputs, while direct-answer and answer-first formats remain much weaker. Three findings emerge. First, reasoning-like text alone is not sufficient: a placement ablation shows that the gain comes from using the scratchpad as a pre-answer workspace, not merely from appending reasoning-like text -- moving the same symbolic work from before to after the answer reduces three-trigger accuracy from near-perfect to roughly one-third. Second, step structure matters for length generalization: verbose self-contained step descriptions generalize to longer trigger sequences, while compact symbolic scratchpads largely do not. Third, scratchpad training does not automatically produce direct answering without the scratchpad; removing it at inference time collapses accuracy back to near the direct-only baseline, and a no-finetuning prompting baseline does not reproduce the fine-tuned scratchpad gains.