Training Large Language Models for Reasoning through Reverse Curriculum Reinforcement Learning

Zhiheng Xi, Wenxiang Chen, Boyang Hong, Senjie Jin, Rui Zheng, Wei He, Yiwen Ding, Shichun Liu, Xin Guo, Junzhe Wang, Honglin Guo, Wei Shen, Xiaoran Fan, Yuhao Zhou, Shihan Dou, Xiao Wang, Xinbo Zhang, peng sun, Tao Gui, Qi Zhang, Xuanjing Huang

Abstract

Large Language Models (LLMs) often struggle with complex, multi-step reasoning tasks where a single error in the logic chain can lead to an incorrect conclusion. Traditional training methods rely either on sparse outcome rewards, which provide insufficient guidance for intermediate steps, or dense process supervision, which requires expensive human annotation. This paper introduces $R^3$ (Reverse Curriculum Reinforcement Learning), a novel framework that bridges this gap by teaching models to reason backward from a successful conclusion. By gradually increasing the difficulty of the reasoning task through a sliding-window curriculum, $R^3$ converts sparse outcome rewards into effective step-level signals, significantly improving performance across mathematical, logical, and natural language inference tasks.

1. Introduction

The ability of LLMs to perform multi-step reasoning is a cornerstone of their utility in complex problem-solving. However, training these models effectively remains a challenge. Standard Reinforcement Learning (RL) typically utilizes Outcome Supervision (OS), where a reward is only provided if the final answer is correct. While easy to implement, this "sparse reward" problem makes it difficult for the model to identify which specific step in a long chain led to a failure. Conversely, Process Supervision (PS) provides feedback for every intermediate step but necessitates massive amounts of human-labeled "rationales," which are difficult to scale.

To address these limitations, we present $R^3$, a method that leverages the intuition of a "reverse curriculum." By starting exploration near the end of a known correct solution and incrementally moving the starting point toward the original prompt, the model learns to bridge increasingly large logic gaps without requiring manual step-level labels.

2. The $R^3$ Framework

2.1 Reverse Curriculum Design

The core of $R^3$ is the transition from easy to difficult tasks. Given a "golden" demonstration (a correct reasoning chain), the training process is divided into stages:

  1. Initial Stage: The model is provided with the entire demonstration except for the final step. It only needs to generate the last step to reach the correct answer.
  2. Sliding Window: Once the model achieves proficiency at the current stage, the "start state" is moved one step backward. The model must now generate the last two steps, then the last three, and so on.
  3. Full Chain Generation: Eventually, the model is required to generate the entire reasoning chain from the initial prompt.

2.2 Step-Level Signals from Outcome Rewards

By restricting the exploration space to a small "gap" between the provided demonstration and the final answer, $R^3$ effectively localizes the credit for success. If the model completes the chain correctly, the reward can be attributed to the specific tokens generated in that window. This transforms a global outcome reward into a dense, localized signal, reducing the search space from exponential to linear relative to the number of reasoning steps.

2.3 Mixed Strategy for Stability

To ensure the model does not forget how to solve later stages while learning earlier ones, $R^3$ employs a mixed sampling strategy. During training, starting points are sampled from various stages of the curriculum simultaneously. This maintains stability and prevents the "jittery" performance often seen in standard RL training.

3. Experimental Evaluation

3.1 Datasets and Models

We evaluated $R^3$ across eight reasoning datasets, including mathematical (GSM8K, SVAMP), logical (BoardgameQA), and NLI (SNLI, MNLI) tasks. The framework was tested using Llama2-7B and Codellama-7B, covering both standard Chain-of-Thought (CoT) and Program-based CoT (P-CoT).

3.2 Key Results

  • Performance Gains: $R^3$ outperformed standard RL by an average of 4.1 points and Supervised Fine-Tuning (SFT) by 5.4 points across all benchmarks.
  • Coding and Math: In P-CoT tasks on GSM8K, where the model generates Python code to solve problems, $R^3$ improved performance by 11.4 points over the SFT baseline.
  • Data Efficiency: $R^3$ demonstrated remarkable efficiency, with models trained on only 20% of the available data often outperforming standard RL models trained on the full dataset.
  • Model Scaling: A Codellama-7B model trained with $R^3$ achieved performance levels competitive with much larger models like GPT-3.5-Turbo, despite having significantly fewer parameters.

4. Discussion and Limitations

$R^3$ provides a robust middle ground between outcome and process supervision. By interpreting the reasoning process through the lens of dynamic programming, it simplifies the learning objective into manageable sub-problems.

However, the method currently requires at least one "golden" demonstration per problem to initialize the curriculum. While these are often available in training sets, the reliance on existing demonstrations means the model cannot yet learn entirely from scratch through "blind" exploration. Additionally, the performance of $R^3$ is sensitive to the number of curriculum stages ($M$); finding the optimal granularity for different task complexities remains an area for future optimization.

5. Conclusion

Reverse Curriculum Reinforcement Learning ($R^3$) offers a powerful, data-efficient way to enhance the reasoning capabilities of LLMs. By starting at the "finish line" and working backward, models can learn complex logic chains using only final-answer labels, bypassing the need for expensive human-annotated process data. Future work will focus on automating the generation of initial demonstrations to create a fully autonomous self-improving reasoning loop.

Summary updated

BibTeX
@inproceedings{xi2024training,
  author = {Zhiheng Xi and Wenxiang Chen and Boyang Hong and Senjie Jin and Rui Zheng and Wei He and Yiwen Ding and Shichun Liu and Xin Guo and Junzhe Wang and Honglin Guo and Wei Shen and Xiaoran Fan and Yuhao Zhou and Shihan Dou and Xiao Wang and Xinbo Zhang and peng sun and Tao Gui and Qi Zhang and Xuanjing Huang},
  title = {{Training Large Language Models for Reasoning through Reverse Curriculum Reinforcement Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=t82Y3fmRtk},
}
Figure