Introduction
Large Language Models (LLMs) have demonstrated remarkable reasoning capabilities through Chain-of-Thought (CoT) prompting. However, they often encounter a "compositional gap": while they can perform individual atomic tasks (e.g., Skill A or Skill B), they struggle to combine these skills to solve complex, unseen problems (Skill A + B) without explicit training on the combination. This limitation, known as a lack of compositional generalization, often forces researchers to collect massive, expensive datasets covering every possible task permutation.
This paper introduces Composable Chain-of-Thought (CoT), a novel data augmentation scheme designed to make reasoning modular. By training models to treat reasoning steps as independent blocks using specific structural tags, the authors enable models to compose skills zero-shot or with minimal supervision.
Methodology: Building Modular Reasoners
The core innovation lies in formatting atomic skill data to be structurally aware of its potential role in a larger chain. The researchers propose a two-stage pipeline:
1. Composable CoT Formatting
Instead of standard linear reasoning traces, atomic task data is augmented into two roles:
- Prefixes: Wrapped in
<prefix>tags, these represent the start of a reasoning chain. - Suffixes: Wrapped in
<suffix>tags, these are trained to follow a "proxy prefix"—randomly generated text that simulates a preceding reasoning step. This forces the model to remain robust and continue its logic regardless of the specific content that came before it.
2. Skill Combination and Bootstrapping
Once atomic skills are formatted, they are combined using either Multitask Learning (MTL) or Model Merging (via Task Arithmetic). To further bridge the gap to full composition, the authors employ Self-Bootstrapping via Rejection Sampling Fine-tuning (RFT). The combined model generates multiple attempts at a complex task and is then fine-tuned only on those that yield the correct answer, effectively learning from its own successful compositions.
Experimental Evaluation
The framework was tested on two primary benchmarks using Llama 2 7B and Qwen 2.5 7B:
- String Operations: Synthetic tasks requiring multi-step logic, such as finding the next letter in the alphabet and then performing ASCII multiplication.
- Skill-Mix: A natural language challenge where models must write sentences that simultaneously exhibit two distinct linguistic skills (e.g., anaphora resolution and oxymoron usage).
Key Results and Insights
The results demonstrate a significant "zero-shot leap." On the "Last Letter + Multiplication" task, a standard MTL Llama 2 model achieved only 5.0% accuracy. In contrast, the Composable CoT variant reached 18.7%. The improvement was even more stark for Qwen 2.5, which jumped from a baseline of 3.6% to 96.3% accuracy.
Key takeaways include:
- Structural Hints Matter: The
<prefix>and<suffix>tags act as critical signals, preventing the model from collapsing into single-task memorization. - Efficiency: With as few as 100-500 compositional examples, Composable models using RFT consistently outperformed baselines, often doubling or tripling their accuracy.
- Merging vs. MTL: The optimal combination strategy is domain-dependent. Model merging excelled in rigid string operations, while MTL performed better for fluid natural language tasks.
Conclusion and Future Directions
Composable CoT offers a scalable path toward general-purpose reasoning by treating skills as modular components rather than monolithic patterns. While current work focuses on pairwise combinations, future research aims to scale this to deeper chains of reasoning and explore "internalized" composition, where modular steps occur within the model's latent space rather than through explicit text generation.
Summary updated