Introduction
Process Reward Models (PRMs) have emerged as a critical component in enhancing the mathematical reasoning capabilities of Large Language Models (LLMs). Unlike traditional outcome-based reward models that only evaluate the final answer, PRMs verify the logical validity of each intermediate reasoning step. However, the effectiveness of PRMs is often hampered by Out-of-Distribution (OOD) failures, where models struggle to evaluate unfamiliar problems or reasoning styles not present in their training data.
This paper introduces RetrievalPRM, a framework designed to mitigate these OOD challenges. By implementing a two-stage retrieval mechanism, RetrievalPRM fetches relevant reference questions and reasoning steps to provide the model with dynamic, in-context guidance. This approach allows a relatively compact 7B-parameter model to achieve state-of-the-art performance, rivaling and even surpassing much larger proprietary models.
The Challenge: Out-of-Distribution Failures in PRMs
The authors identify two primary categories of OOD failures that limit the generalization of current PRMs:
- Question OOD: Most PRMs are trained on standard datasets like GSM8K or MATH, which primarily cover middle- and high-school mathematics. When faced with Olympiad-level or specialized domain problems, these models lack the necessary domain knowledge to distinguish between valid and invalid logical leaps.
- Step OOD: Reasoning style varies significantly across different LLM architectures. For instance, a massive model like GPT-4o might employ abstract algebraic proofs, while a smaller model might rely on brute-force enumeration. PRMs trained on a specific model's reasoning traces often fail to generalize to the diverse stylistic expressions of other models, leading to unfair penalties for valid but unfamiliar reasoning steps.
Methodology: The RetrievalPRM Framework
To address these limitations, RetrievalPRM utilizes a Two-stage Retrieval-enhanced Mechanism built upon a Qwen-2.5-Math-7B-Instruct base. This mechanism functions as a cognitive "warm-up" by providing the model with relevant context before it evaluates a target step.
Stage 1: Question-level Retrieval
When a target question is presented, the system uses Sentence-BERT and PCA embeddings to search a comprehensive database for the top-$k$ most semantically similar questions. The system retrieves the full, labeled solutions for these questions to establish a broad context of the problem domain.
Stage 2: Step-level Retrieval
Searching for isolated steps across a massive database can introduce significant noise due to mathematical ambiguity (e.g., a variable having different meanings in different contexts). To solve this, RetrievalPRM performs a nested search, looking for similar reasoning steps only within the solutions of the top-$m$ questions identified in Stage 1.
These retrieved questions and steps are then injected into the PRM's system prompt as dynamic, in-context reference examples. By seeing examples of both correct and incorrect reasoning for similar problems, the PRM can better calibrate its judgment for the specific task at hand.
Experimental Setup and Results
The model was trained using the PRM800K dataset and utilized a retrieval pool consisting of both PRM800K and Math-Shepherd. Evaluation was conducted on ProcessBench, a rigorous benchmark spanning four levels of difficulty: GSM8K (grade school), MATH (high school), OlympiadBench (Olympiad-level), and OmniMATH (highly difficult, multi-domain problems).
Key Findings
- Superior Generalization: RetrievalPRM-7B achieved an average F1 score of 65.8 on ProcessBench, a substantial improvement over the baseline Qwen2.5-Math-7B-PRM800K, which scored 56.5.
- Efficiency vs. Scale: Despite its smaller size, the 7B-parameter RetrievalPRM outperformed massive models acting as zero-shot critics, including GPT-4o (61.9 Avg F1) and Qwen2.5-72B-Instruct (61.2 Avg F1).
- Robustness on Complex Tasks: The performance gap widened as problem difficulty increased. On the OmniMATH dataset, RetrievalPRM achieved an F1 score of 57.33, compared to the baseline's 44.3, demonstrating its efficacy in handling extreme Question OOD scenarios.
Discussion and Future Work
The success of RetrievalPRM highlights that for mathematical reasoning, style and context are as important as raw logic. By nesting step-level retrieval within question-level retrieval, the authors effectively filtered out mathematical noise, ensuring that reference steps were relevant to the broader problem context.
However, the authors note that the current system relies on Sentence-BERT, which is optimized for natural language rather than mathematical structure. Future iterations could benefit from embedding models specifically trained to capture mathematical logic and theorem-based similarity. Additionally, expanding the retrieval pool beyond the current datasets could further enhance the model's domain-specific knowledge, particularly in niche or emerging mathematical fields.
Summary updated