1@inproceedings{kamoi2025fover,
2 title = {Efficient PRM Training Data Synthesis via Formal Verification},
3 author = {Ryo Kamoi and Yusen Zhang and Nan Zhang and Sarkar Snigdha Sarathi Das and Ranran Haoran Zhang and Wenpeng Yin and Rui Zhang},
4 year = {2026},
5 booktitle = {Findings of the Association for Computational Linguistics: ACL 2026},
6}
Introduction
Process reward models (PRMs), which provide step-by-step feedback on the reasoning generated by large language models (LLMs), are receiving increasing attention for their potential to enhance LLMs via reinforcement learning and inference-time refinement.
We propose FoVer, an approach for training PRMs on step-level error labels that are automatically annotated using formal verification tools (e.g., Z3, Isabelle). We introduce a dataset that includes automatically annotated step-level error labels on LLM responses for the formal logic and proof tasks. We demonstrate that LLM-based PRMs trained on the FoVer dataset exhibit cross-task transfer of verification capabilities learned in formal logic and proof, leading to improved verification across a broad range of reasoning tasks, including mathematics, academic problems, logic, and abstract reasoning.
Setup
To run our PRMs:
torch==2.6.0
transformers==4.50.3
Please refer to setup/setup.sh for details. We use different environments for dataset creation, training, and evaluation.
We run our experiments on the following environment. You might need to modify configulations if you are using a different environment.
Four NVIDIA A100 SXM4 80GB GPUs
CUDA Version: 12.2
Quick Start
Evaluate Your PRM on the FoVer Datasets
The FoVer dataset is initially designed to train models, but our test splits also serves as an evaluation benchmark for PRMs. Our dataset provides the following information. Please refer to FoVer Dataset for details of other items in our dataset.
json
1{2"problem":"""Based on the provided facts ($context$), either prove or disprove the hypothesis or state that it is unknown. The facts and the hypothesis are written in logical formulas as follows: capital letters such as "{A}","{B}","{AB}" are predicates, small letters such as "{a}","{b}","{ab}" are constants,"&" is logical conjunction,"v" is logical disjunction,"¬" is negation,"->" is implication,"(x)" is "for all x", and "(Ex)" is "for some x".\n\n$hypothesis$: ¬{A}\n\n$context$:\nfact1:{IN}\nfact2:{BH}\nfact3:{EE}\nfact4: ¬{B} -> ({A} & {FH})\nfact5:{CA}\nfact6:{GO}\nfact7:{IR}\nfact8:{HH}\nfact9:{JI}\nfact10:{AN}\nfact11:{C} -> ({B} & ¬{A})\nfact12:{HP}\nfact13:{GK}\nfact14:{JC}\nfact15: ¬{E} -> ({C} & {D})\nfact16:{T}\nfact17:{H}\nfact18:{AF}""",3"solution_steps":[4"fact11 -> int1: {B} & ¬{A}",5"int1 -> int2: ¬{A}",6"The final answer is PROVED"7],8"error_labels":[false,true,true]9}
The performance metrics of the FoVer PRM on your dataset.
The step-level and instance-level scores by the FoVer PRM on your dataset.
FoVer Dataset
We provide the FoVer datasets that include the mistakes made by Llama 3.1 8B and Qwen 2.5 7B on formal logic and proof tasks.
Dataset Format
Each instance of the FoVer datasets include the following items.
problem (str)
solution_steps (list[str])
The solution steps generated by the model.
error_labels (list[str])
The ground-truth error labels generated by the error verification tools (Z3, Isabelle)
messages (list[dict[str, str]])
The conversation we use for fine-tuning our PRMs.
messages_for_prediction (list[dict[str, str]])
The conversation we use for prediction. The model outputs are dummy values and all correct.
problem_witout_definition (str)
The problem without task definition (metadata, not used in our experiments).
Dataset Statistics
LastStepBalanced Dataset
We create the LastStepBalanced dataset to train PRMs on the balanced dataset where the last step includes 50% of correct and 50% of incorrect steps. We truncate solutions to make the last step balanced, so we expect to mask all steps but the last step to train the PRMs.
Specificlaly, we use Llama-Factory with the option mask_history: true.
Creating Training Data for New Models
You can create mistakes made by stronger models to make a better training dataset. Please refer to run/01_dataset_creation for the dataset creation process. You may need to update our code to support other models.
Reproducing the Experiments in the Paper
You can refer to shell files in the run directory to reproduce the experiments in our paper.
You do not need to run the code if you are only interested in using our models or datasets. Please refer to Quick Start.
License
Please refer to the LICENSE.md file for the license of this repository.