TL;DR
Teaching language models to solve complex reasoning problems usually requires costly step-by-step chain-of-thought (CoT) annotations for every task variant. This paper introduces Composable CoT, a simple data augmentation technique that prepares atomic reasoning models to chain skills together by training them with dummy "proxy prefixes." Combined via multi-task learning or model merging—and optionally refined with rejection sampling—this approach enables strong zero-shot and few-shot compositional reasoning without requiring expensive full-chain demonstrations.
What Problem Does This Paper Address?
While large language models (LLMs) can master simple, "atomic" skills (e.g., finding the next letter in the alphabet, string concatenation, or basic arithmetic), they notoriously struggle with compositional generalization—combining multiple elementary skills to solve harder, multi-step problems at inference time.
When a model is trained on distinct atomic tasks with standard CoT traces, it views each reasoning pattern as an isolated distribution. At test time, when faced with a composite problem, the model almost always defaults to executing just one familiar skill rather than chaining several together. Collecting human-annotated CoT data for every possible combination is practically impossible due to the combinatorial explosion of complex tasks.
Methods
The authors propose a lightweight data augmentation and combination pipeline:
- Composable CoT Augmentation: For each atomic task example $(q, t, a)$, the authors simulate multi-step reasoning by inserting $k-1$ "proxy prefix CoTs" into the prompt before the target reasoning trace.
- Surprisingly, these proxy prefixes are simply random strings of letters wrapped in intermediate tags (
<prefix> ... </prefix>), while the target atomic reasoning step is wrapped in<suffix>. - By varying $k$ (training with or without prefixes), the model learns both how to initiate a reasoning process and how to condition its reasoning on arbitrary preceding steps.
- Combining Atomic Models:
- Multi-Task Learning (ComposableCoT-MTL): Fine-tuning a single base LLM across all augmented atomic datasets.
- Model Merging (ComposableCoT-Merge): Fine-tuning separate LoRA adapters on each atomic task and merging their weight deltas using Task Arithmetic.
- Inference Tagging: At test time, the model generates the first reasoning step under
<tag 1>, after which a subsequent tag is injected to prompt continuation for the next step. - Bootstrapping with Rejection Sampling Fine-Tuning (RFT): If a small set of target composite problems is available with only final answers (no CoT traces), the combined model samples candidates, keeps correct traces, and further fine-tunes itself.
Standard atomic example:
[Prompt: Question] -> [Reasoning Trace] -> [Answer]
Composable CoT augmented example:
[Prompt: Question + <prefix> Random Filler String </prefix>] -> [<suffix> Reasoning Trace + Answer </suffix>]
Datasets
The authors evaluate models on three reasoning domains:
- String Manipulation & Arithmetic: Synthetic tasks adapted from prior benchmarks (LMentry, CUTE, and BIG-bench), including Next Letter in Alphabet, Letter Concatenation, and ASCII Multiplication. Evaluated compositions include two-way tasks (e.g., Concat + Next Letter, Next Letter + Multiplication) and three-way tasks (Concat + Next Letter + Mult).
- Natural Language Skills (Skill-Mix): Adapted from the Skill-Mix benchmark, requiring models to write sentences incorporating specific categories of linguistic devices (Literary, Rhetorical, and Logical).
- Reference Baselines: Perplexity comparisons against GSM8K, Alpaca, and WikiText.
Key Insights and Ideas
- Nonsense Prefixes Beat Realistic Ones: Counterintuitively, using random letter strings as proxy prefixes produced higher out-of-domain robustness (90.0% EM) than realistic sentences drawn from OpenWebText (70.0% EM). Random tokens prevent the model from learning spurious semantic correlations between intermediate reasoning steps, training it purely to condition on the presence of prior reasoning.
- Model Merging Works for Multi-Step CoT: This is the first work showing that model merging (Task Arithmetic) can successfully combine distinct reasoning behaviors into a coherent, multi-step generation pipeline.
- Tag Injection Bridges the Distribution Gap: Simply instructing the model to generate within delimiters (
<prefix>,<suffix>) prevents the model from halting prematurely after completing the first subtask.
Key Results
Experiments conducted on Llama 2-7B and Qwen 2.5-7B show substantial gains:
- Zero-Shot Composition: On Qwen 2.5-7B, ComposableCoT-MTL achieved 96.3% EM on Next Letter + Mult (compared to 3.6% for Standard CoT-MTL) and 63.3% EM on Concat + Next Letter (vs. 60.9%). Across all tasks, Composable CoT models beat standard CoT models zero-shot.
- With Limited Answer-Only Supervision: Combining Composable CoT with one iteration of RFT ($N \le 500$) yielded an average 18.2% boost over running RFT on standard CoT models, easily surpassing standard continued fine-tuning (CFT) and multi-task baselines.
- Skill Selection & Scaling: In environments with distractor skills (merging three skills and evaluating on a two-skill problem), Composable CoT outperformed standard CoT by 8.8%. On three-way compositions, it outperformed standard CoT by 4.8%.
- CoT Presence: Intrinsic evaluations revealed that Composable CoT models generated both required atomic reasoning steps significantly more often (e.g., jumping from 0.0% to 98.9% dual-CoT inclusion on Next Letter + Mult).
Limitations and Future Work
- Characteristic Failure Modes: The authors identify three persistent errors in zero-shot compositions:
- Replicating the same atomic step across both prefix and suffix.
- Premature termination after generating the prefix CoT (especially noticeable in merged models).
- Chaining the correct reasoning steps in the wrong logical order.
- Scope of Tasks: Evaluations were focused on synthetic algorithmic pipelines and structured linguistic constraints; validating this setup on open-ended mathematical proofs, code generation, and complex multi-hop QA remains open for future research.
Summary updated