Step-Controlled DPO: Leveraging Stepwise Errors for Enhancing Mathematical Reasoning of Language Models

Zimu Lu, Aojun Zhou, Ke Wang, Houxing Ren, Weikang Shi, Junting Pan, Mingjie Zhan, Hongsheng LiOpenReview 2025 · Submission to ICLR 2025 · Rejected

Large Language Models (LLMs) often struggle with complex, multi-step mathematical reasoning. While Direct Preference Optimization (DPO) has become a popular method to align models by showing them "good" versus "bad" responses, it typically relies on outcome supervision. In this setup, a response is labeled "bad" simply because the final answer is wrong.

This creates a significant problem for math problems: a solution might feature ten perfect logical steps and one tiny calculation error at the very end. Standard DPO treats the entire sequence as "bad," potentially penalizing the correct early steps. While "process supervision" (labeling the correctness of every single step) fixes this, it requires massive amounts of expensive human annotation.

To bridge this gap, researchers have developed Step-Controlled DPO (SCDPO), a method that automatically generates "stepwise" feedback for training AI on math problems without needing human labels. By forcing a model to deviate from a correct path at a specific step, they create precise negative examples that teach the model exactly where reasoning goes wrong.

The SCDPO Methodology

The authors introduce a two-stage pipeline to generate training data and then fine-tune the model:

1. Step-Controlled Data Generation

Instead of relying on humans to write out incorrect math steps, the researchers automate the creation of "dispreferred" samples.

  • The Process: They start with a known correct solution. Then, they pick a random intermediate step $k$. From that point onward, the model is asked to finish the problem, but the system gradually increases the "temperature" (randomness) of the output (e.g., ramping from 1.1 up to 1.4).
  • The Result: If the model eventually reaches an incorrect final answer, the system has successfully generated a perfect "dispreferred" sample. It matches the "preferred" sample exactly until step $k$, after which it diverges into an error.
Step-Controlled Data Generation pipeline and example

2. Step-Aware DPO Training

The model is then trained using a combination of standard DPO (comparing full correct vs. full incorrect solutions) and the new Step-Controlled loss. Crucially, for the step-controlled pairs, the loss is only applied to the steps after the divergence point. This forces the model to focus its "blame" on the specific reasoning transition where the error actually occurred.

Key Insights and Innovations

  • The "Temperature Ramping" Trick: Simply raising the temperature to a high constant value often results in garbled or nonsensical text. By increasing it gradually (e.g., +0.05 per step), the authors found the model produces "diverse and plausible" errors that look like real human mistakes. These realistic mistakes are much more useful for training the model's reasoning capabilities.
  • Automated Credit Assignment: Qualitative analysis showed that standard DPO often fails to highlight the specific token where a math error starts. SCDPO, however, consistently assigns low rewards (high penalty) to the exact moment the logic fails.
Reward heatmaps demonstrating credit assignment
  • Cost Efficiency: Because the negative samples are generated by the model itself, this method provides the benefits of granular process supervision at a fraction of the cost of human labeling.

Datasets and Performance

The models were trained on an initial Supervised Fine-Tuning (SFT) dataset of 250K pairs collected via GPT-4 Code Interpreter (using APE210K, GSM8K, and MATH). They were then evaluated across 10 representative datasets, including GSM8K (grade school math), MATH (harder competition math), OCW (college level), and competition-level sets like AIME24 and AMC23.

Key Results: * State-of-the-Art 20B Performance: The resulting InternLM2-20B-SCDPO model achieved 88.5% on GSM8K and 58.1% on MATH. These scores are highly competitive, rivaling or beating much larger open-source models and approaching proprietary models like GPT-3.5. * Strong Generalizability: The authors applied SCDPO to several base models, including Mistral-7B and Qwen-2.5 (1.5B and 7B). In every case, SCDPO outperformed both the baseline SFT and standard DPO. * Beyond Math: In a surprise test on the GPQA benchmark (difficult science questions in biology and physics), the SCDPO-trained model showed improved performance, suggesting that learning to avoid stepwise errors in math translates to better general reasoning.

Limitations and Future Work

While highly effective, the current method is optimized for "Chain-of-Thought" natural language or interleaved code/text solutions, making it less effective for solutions consisting of pure code. Furthermore, the work is strictly text-based and cannot yet handle mathematical problems involving images or diagrams.

Finally, while SCDPO is a massive improvement over outcome-based DPO, it still relies on the model's internal "step" markers (like newlines) rather than pinpointing the exact token of an error. Future work will explore applying this stepwise supervision to other reasoning-heavy tasks like theorem proving and complex code generation.

Summary updated

BibTeX
@misc{lu2025step,
  author = {Zimu Lu and Aojun Zhou and Ke Wang and Houxing Ren and Weikang Shi and Junting Pan and Mingjie Zhan and Hongsheng Li},
  title = {{Step-Controlled DPO: Leveraging Stepwise Errors for Enhancing Mathematical Reasoning of Language Models}},
  year = {2025},
  url = {https://openreview.net/forum?id=ZRDa2IT1sQ},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2025},
}
Figure