TL;DR
This paper shows that while standard question-answering (QA) training makes language models (LMs) great at in-distribution tasks, they fail miserably on out-of-distribution (OOD) tasks. By using Chain-of-Thought (CoT) reasoning, especially with fine-grained steps, LMs can generalize much better to new, unseen problems, even with less training data. This highlights CoT as a crucial paradigm for building robust LMs.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown incredible capabilities, but their ability to generalize to new, unseen tasks, especially those with slightly different underlying structures (distributional shifts), remains a significant challenge. This is critical for real-world applications where deployment environments might differ from training data. Traditional training methods, like direct question-answering (QA), lead to models that perform well on familiar tasks but collapse when faced with novel variations. The paper investigates how Chain-of-Thought (CoT) reasoning, which involves breaking down problems into intermediate steps, can improve this out-of-distribution (OOD) generalization. Specifically, it asks: how does the granularity of CoT data affect generalization, and can CoT offer better sample efficiency compared to standard QA training?
Methods
The authors propose a controlled experimental framework to study LM generalization under distribution shifts. They create synthetic compound tasks that mimic real-world scenarios with dynamic dependencies. They then train LMs using two main data paradigms:
- Question-Answer (Q-A) pairs: This represents standard training without explicit reasoning steps (CoT-0%).
- Chain-of-Thought (CoT) sequences: This involves providing step-by-step reasoning. They experiment with varying levels of CoT granularity by using probabilistic CoT dropout (30%, 50%, 70%) and full CoT (100%).
The core of their analysis involves comparing the in-distribution (ID) and out-of-distribution (OOD) performance of models trained with these different data strategies. They also provide theoretical analysis to explain why CoT helps, focusing on how it forces internalization of dependency structures and how transformer positional embeddings can amplify this effect.
Datasets
The paper uses synthetic datasets created for three specific compound reasoning tasks:
- Longest Increasing Subsequence (LIS): Tests generalization across sequence lengths.
- Multi-Step Path Counting (MPC): Tests generalization under varying combinatorial constraints.
- Equation Restoration and Variable Computation (ERVC): Tests generalization under distribution shifts in problem parameters.
For each task, datasets were prepared in both Q-A and Q-CoT formats, with varying dataset sizes (from 1k to 30k samples) to study scaling effects.
Key Insights and Ideas
- The "Generalization Gap" is Huge: Standard QA-trained models achieve near-perfect accuracy on in-distribution data but plummet to very low performance (around 10%) on OOD data, even with massive amounts of training data (up to 10,000k examples). This highlights a critical failure of current generalization strategies.
- CoT Granularity is Key: The finer the CoT steps provided during training, the better the model's OOD generalization. This suggests that simply having some reasoning steps isn't enough; the detail and completeness of those steps matter significantly.
- CoT is Sample Efficient: Models trained with fine-grained CoT can achieve comparable OOD generalization to QA models trained on much larger datasets, and often with substantially less data (even 80% less). This makes CoT a powerful tool for efficient learning.
- CoT Internalizes Structure: Theoretically, CoT forces models to learn underlying dependency structures, rather than relying on superficial shortcuts. This internalized structure is what enables better generalization.
- Positional Embeddings Help: Transformer positional embeddings can further boost generalization by emphasizing the recurrence of subtask conditions within longer CoT sequences.
Key Results
- OOD Performance Drop: Models trained with 0% CoT (pure QA) showed a dramatic drop in accuracy from ~80% ID to ~10% OOD across tasks.
- CoT Improves OOD: Models trained with 100% CoT consistently outperformed 0% CoT models on OOD tasks, maintaining significantly higher accuracy (e.g., above 0.8 for MPC and LIS in Figure 7).
- Granularity Matters: Increasing CoT granularity (from 30% to 100%) led to progressively better OOD generalization. Partial CoT (30-50%) sometimes even degraded performance compared to 0% CoT, suggesting incomplete reasoning chains can be detrimental.
- Sample Efficiency: CoT-100% models achieved robust OOD performance (0.55-0.75 accuracy) with small datasets (1k-10k samples), while less CoT models struggled below 0.4 accuracy.
Limitations and Future Work
- Synthetic Tasks: The study relies on synthetic tasks to isolate the impact of reasoning density. Quantifying "granularity" in unstructured natural language remains an open challenge.
- Inference Cost: While CoT improves sample efficiency during training, finer-grained CoT increases inference costs due to longer sequence generation.
- Transformer Dynamics: The theoretical analysis focuses on fundamental Transformer dynamics. Empirical verification on massive 100B+ parameter foundation models is needed.
The authors suggest future work will explore automated CoT generation and dynamic granularity adaptation to reduce annotation costs.
Summary updated