Abstract
Mathematical reasoning presents a significant challenge for Large Language Models (LLMs) due to the extensive and precise chain of reasoning required for accuracy. Ensuring the correctness of each reasoning step is critical. To address this, we aim to enhance the robustness and factuality of LLMs by learning from human feedback. However, Direct Preference Optimization (DPO) has shown limited benefits for long-chain mathematical reasoning, as models employing DPO struggle to identify detailed errors in incorrect answers. This limitation stems from a lack of fine-grained process supervision. We propose a simple, effective, and data-efficient method called Step-DPO, which treats individual reasoning steps as units for preference optimization rather than evaluating answers holistically. Additionally, we have developed a data construction pipeline for Step-DPO, enabling the creation of a high-quality dataset containing 10K step-wise preference pairs. We also observe that in DPO, self-generated data is more effective than data generated by humans or GPT-4, due to the latter's out-of-distribution nature. Our findings demonstrate that as few as 10K preference data pairs and fewer than 500 Step-DPO training steps can yield a nearly 3% gain in accuracy on MATH for models with over 70B parameters. Notably, Step-DPO, when applied to Qwen2-72B-Instruct, achieves scores of 70.8% and 94.0% on the test sets of MATH and GSM8K, respectively, surpassing a series of closed-source models, including GPT-4-1106, Claude-3-Opus, and Gemini-1.5-Pro.
Introduction
While Large Language Models (LLMs) have become remarkably proficient in conversational tasks, "long-chain reasoning"—the complex logical progression required to solve advanced mathematical problems—remains a significant hurdle. Standard Direct Preference Optimization (DPO) typically compares two full answers: one "winning" and one "losing."
However, this holistic approach is often too coarse-grained for mathematical reasoning. A model might generate ten correct steps but fail due to a single calculation error in the eleventh. In vanilla DPO, the entire response is rejected, which introduces noise—the model is penalized for early, correct steps—and lacks the precision needed to pinpoint exactly where the logic failed. Step-DPO addresses this by focusing on fine-grained process supervision.
Methodology: Step-DPO
The core innovation of this work is Step-DPO, which treats individual reasoning steps as the fundamental unit of preference. Instead of comparing entire sequences, it optimizes the model to distinguish between a correct step ($s_{win}$) and the first incorrect step ($s_{lose}$) given the preceding correct context ($s_{1 \dots k-1}$).
To implement Step-DPO, the authors developed a three-stage data construction pipeline:
- Error Collection: Prompting the model to solve problems and flagging incorrect final answers.
- Step Localization: Identifying the exact step ($k$) where the first error occurred using automated or manual methods.
- Rectification: Generating a correct version of step $k$ that leads to the right final answer, using the model's own correct prefix.
A key finding is that in-distribution data (self-generated by the model) is more effective than data from external sources like GPT-4. The model's own errors are closer to its internal probability distribution, providing a cleaner optimization signal.
Experimental Results
Step-DPO demonstrates exceptional data efficiency. With only 10,000 preference pairs and fewer than 500 training steps, the authors observed significant performance gains across various model scales.
The results are particularly striking for open-source models:
- Qwen2-72B-Instruct + Step-DPO: Achieved 70.8% on MATH and 94.0% on GSM8K.
- Competitive Edge: This performance surpasses prominent closed-source models such as GPT-4-1106 (64.3%), Claude-3-Opus (60.1%), and Gemini-1.5-Pro (67.7%) on the MATH benchmark.
- Scaling: The benefits of Step-DPO scale with model size, with larger models (70B+) showing the most significant "untapped potential" unlocked by this fine-grained supervision.
Conclusion and Future Work
Step-DPO provides a robust framework for aligning LLMs with complex reasoning tasks. By focusing on the "first error," the model learns to locate and rectify logical fallacies more effectively than through holistic feedback.
Future work will address current limitations, such as the dependency on ground-truth answers for verification, which currently limits the method's application to objective tasks. Additionally, automating step segmentation and localization further will reduce the reliance on external models or human intervention in the data pipeline.
Summary updated