OpenR: An Open Source Framework for Advanced Reasoning with Large Language Models

Jun Wang, Meng Fang, Ziyu Wan, Muning Wen, Jiachen Zhu, Anjie Liu, Ziqin Gong, Yan Song, Lei Chen, Lionel M. Ni, Linyi Yang, Ying Wen, Weinan ZhangarXiv 2024 · DOI

Abstract

OpenR is a comprehensive open-source framework designed to bridge the gap between standard Large Language Models (LLMs) and specialized reasoning models. By unifying process supervision, reinforcement learning (RL), and search-based decoding, OpenR provides a modular environment for developing models capable of "deep thinking" through complex problems. This report details the integration of Process Reward Models (PRMs) and RL techniques that allow models to trade test-time compute for increased accuracy, yielding significant improvements on challenging mathematical benchmarks.

Introduction

Current Large Language Models primarily exhibit "System 1" thinking—fast, intuitive, and token-by-token generation without internal deliberation. While Chain-of-Thought (CoT) prompting has improved performance, it often remains a superficial layer. In complex domains like mathematics and programming, a single early error can lead to irrecoverable "hallucinations."

OpenR addresses this by fostering Native CoT, where reasoning is treated as a deliberate, multi-step process ("System 2" thinking). By formalizing reasoning as a sequence of searchable and evaluatable actions, OpenR enables models to identify and correct errors mid-trajectory.

The OpenR Framework

OpenR formalizes the reasoning process as a Markov Decision Process (MDP). In this formulation, each reasoning step is an "action," and the accumulated sequence of steps constitutes the "state."

The reasoning process modeled as a Markov Decision Process (MDP) with step-by-step process rewards.

The framework is built upon three technical pillars:

  1. Process Reward Models (PRMs): Unlike Outcome Reward Models (ORMs) that only evaluate final answers, PRMs provide a dense reward signal by assessing the correctness of every individual reasoning step ($R_1, R_2, \dots, R_n$).
  2. Reinforcement Learning (RL): OpenR supports Proximal Policy Optimization (PPO) and Group Relative Policy Optimization (GRPO). These algorithms utilize PRM feedback to refine the model's policy ($\pi$), training it to prioritize high-validity reasoning paths.
  3. Guided Search at Inference: During test-time, the model utilizes the PRM to guide search algorithms such as Beam Search and Best-of-N sampling, exploring multiple potential trajectories to find the optimal solution.

Training and Inference Workflow

The synergy between training and inference is central to OpenR's architecture. The framework facilitates a continuous loop of self-improvement through data augmentation and policy iteration.

The OpenR framework workflow, distinguishing between training-time policy iteration and inference-time guided search.

As illustrated above, the training compute phase involves value iteration to refine the PRM and policy iteration to update the LLM. At inference, the system scales compute by employing guided search and planning to reach the final results.

Datasets and Evaluation

To validate the framework, the authors utilized a mix of established and novel datasets:

  • MATH & MATH500: Standard benchmarks for high-school competition-level mathematics.
  • PRM800K & Math-Shepherd: Sources for human and automated process supervision.
  • MATH-APS: A new synthetic dataset of 150,000 state-value pairs generated via automated tree-search (OmegaPRM), reducing the need for costly human labeling.

Key Insights and Results

The primary finding of the OpenR technical report is the efficacy of Inference-Time Scaling. By allocating more compute to searching reasoning paths at test-time, smaller models (e.g., 7B parameters) can achieve performance parity with much larger models.

Key results include:

  • Performance Gains: The combination of PRMs and guided search resulted in a 10% improvement on the MATH dataset compared to baseline methods.
  • Search Superiority: Beam Search and Best-of-N strategies consistently outperformed simple Majority Voting, particularly as the token budget increased.
  • PRM Efficacy: The custom-trained Math-psa PRM outperformed existing baselines like Math-Shepherd, confirming the value of the OpenR data augmentation pipeline.

Conclusion and Future Directions

OpenR demonstrates that rewarding the reasoning "journey" is more effective than rewarding the "destination" alone. While currently focused on mathematical reasoning with mid-sized models, future iterations of OpenR will expand into coding and general logic. Planned enhancements include the integration of Monte Carlo Tree Search (MCTS) and sequential revision capabilities to further advance the state of open-source reasoning models.

The OpenR framework, including code and datasets, is available at https://openreasoner.github.io.

Summary updated

BibTeX
@misc{wang2024openr,
  author = {Jun Wang and Meng Fang and Ziyu Wan and Muning Wen and Jiachen Zhu and Anjie Liu and Ziqin Gong and Yan Song and Lei Chen and Lionel M. Ni and Linyi Yang and Ying Wen and Weinan Zhang},
  title = {{OpenR: An Open Source Framework for Advanced Reasoning with Large Language Models}},
  year = {2024},
  eprint = {2410.09671},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.09671},
}
Figure