UKPLab/Qwen2.5-3b-spare-prm-math
Model Card for SPARE-PRM
Process Reward Model (Qwen2.5-3b) used in our AAAI 2026 SPARE paper. This model was trained only on the generations from the MATH dataset.
Model Details
Input: instruction + question + step-by-step solutions with a special step tag ки.
Output: the logits. Post-process it to achieve the score of each step.
Usage
from transformers import AutoTokenizer
from transformers import AutoModelForCausalLM
import torch
incorrect_token = "-"
correct_token = "+"
step_tag = " ки" # space in the beginning required for correct tag tokenization
tokenizer = AutoTokenizer.from_pretrained("UKPLab/Qwen2.5-3b-spare-prm-math")
step_target_ids = tokenizer.convert_tokens_to_ids([incorrect_token, correct_token])
step_tag_id = tokenizer.encode(step_tag)[-1]
device = "cuda:0"
model = AutoModelForCausalLM.from_pretrained("UKPLab/Qwen2.5-3b-spare-prm-math").to(device).eval()
# include this instruction as it was left as it is during the PRM training.
instruction = "You are an expert at solving challenging math problems spanning across various categories and difficulties such as Algebra, Number Theory, Geometry, Counting and Probability, Precalculus etc. For a given math problem, your task is to generate a step-by-step reasoning-based solution providing an answer to the question. Identify the correct concepts, formulas and heuristics that needs to be applied and then derive the contents of the reasoning steps from the given contexts and accurate calculations from the previous reasoning steps."
question = "Yann and Camille go to a restaurant. </S>\nIf there are 10 items on the menu, and each orders one dish, how many different combinations of meals can Yann and Camille order if they refuse to order the same dish? (It does matter who orders what---Yann ordering chicken and Camille ordering fish is different from Yann ordering fish and Camille ordering chicken.)"
correct_generation = "Let's think step by step.\nYann can order 1 of the 10 dishes. ки\nWhen he picks a dish, there are 9 left for Camille to choose from. ки\nThus, there are $10\\cdot 9=\\boxed{90}$ possible combinations.\nHence, the answer is 90. ки\n"
incorrect_generation = "Let's think step by step.\nWithout any restrictions, Yann and Camille could both order the same dish out of the 10 options, for a total of $10 \\cdot 9$ dishes. ки\nHowever, since Yann orders one of the 9 dishes that Camille didn't order (and vice versa), the number of possible combinations becomes $10 \\cdot 9 - 8 = \\boxed{72}$.\nHence, the answer is 72. ки\n"
for generation in (correct_generation, incorrect_generation):
message = [
dict(role="system", content=instruction),
dict(role="user", content=question),
dict(role="assistant", content=generation),
]
input_ids = tokenizer.apply_chat_template(message, tokenize=True, return_tensors="pt").to(device)
with torch.no_grad():
logits = model(input_ids).logits[:,:,step_target_ids]
scores = logits.softmax(dim=-1)[:,:,1] # correct_token at index 1 in the step_target_ids
step_scores = scores[input_ids == step_tag_id]
print(step_scores)
# tensor([0.8710, 0.9163, 0.9786]) - correct_generation
# tensor([0.3292, 0.5288]) - incorrect_generation<!-- ### Model Description -->
<!-- Provide a longer summary of what this model is. -->
<!-- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated. -->
<!-- - Developed by: [More Information Needed]
- Funded by [optional]: [More Information Needed]
- Shared by [optional]: [More Information Needed]
- Model type: [More Information Needed]
- Language(s) (NLP): [More Information Needed]
- License: [More Information Needed]
- Finetuned from model [optional]: [More Information Needed] -->
<!-- ### Model Sources [optional] -->
<!-- Provide the basic links for the model. -->
<!-- - Repository: [More Information Needed]
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed] -->
<!-- ## Uses -->
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
<!-- ### Direct Use -->
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
<!-- [More Information Needed] -->
<!-- ### Downstream Use [optional] -->
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
<!-- [More Information Needed] -->
<!-- ### Out-of-Scope Use -->
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
<!-- [More Information Needed] -->
<!-- ## Bias, Risks, and Limitations -->
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
<!-- [More Information Needed] -->
<!-- ### Recommendations -->
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
<!-- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. -->
<!-- ## How to Get Started with the Model -->
<!-- Use the code below to get started with the model. -->
<!-- [More Information Needed] -->
<!-- ## Training Details -->
<!-- ### Training Data -->
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
<!-- [More Information Needed] -->
<!-- ### Training Procedure -->
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
<!-- #### Preprocessing [optional] -->
<!-- [More Information Needed] -->
<!-- #### Training Hyperparameters -->
<!-- - Training regime: [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
<!-- #### Speeds, Sizes, Times [optional] -->
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
<!-- [More Information Needed] -->
<!-- ## Evaluation -->
<!-- This section describes the evaluation protocols and provides the results. -->
<!-- ### Testing Data, Factors & Metrics -->
<!-- #### Testing Data -->
<!-- This should link to a Dataset Card if possible. -->
<!-- [More Information Needed] -->
<!-- #### Factors -->
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
<!-- [More Information Needed] -->
<!-- #### Metrics -->
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
<!-- [More Information Needed] -->
<!-- ### Results -->
<!-- [More Information Needed] -->
<!-- #### Summary -->
<!-- ## Model Examination [optional] -->
<!-- Relevant interpretability work for the model goes here -->
<!-- [More Information Needed] -->
<!-- ## Environmental Impact -->
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
<!-- Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019). -->
<!-- - Hardware Type: [More Information Needed]
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed] -->
<!-- ## Technical Specifications [optional] -->
<!-- ### Model Architecture and Objective -->
<!-- [More Information Needed] -->
<!-- ### Compute Infrastructure -->
<!-- [More Information Needed] -->
<!-- #### Hardware -->
<!-- [More Information Needed] -->
<!-- #### Software -->
<!-- [More Information Needed] -->
Citation
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
<!-- BibTeX: -->
Please cite this data using:
@article{SPARE_Rizvi_Zhu_Gurevych_2026,
title={SPARE: Single-Pass Annotation with Reference-Guided Evaluation for Automatic Process Supervision and Reward Modelling},
volume={40},
url={https://ojs.aaai.org/index.php/AAAI/article/view/40560},
DOI={10.1609/aaai.v40i39.40560},
number={39},
journal={Proceedings of the AAAI Conference on Artificial Intelligence},
author={Rizvi, Md Imbesat Hassan and Zhu, Xiaodan and Gurevych, Iryna},
year={2026},
month={Mar.},
pages={32808-32816}
}<!-- APA: -->
<!-- [More Information Needed] -->
<!-- ## Glossary [optional] -->
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
<!-- [More Information Needed] -->
<!-- ## More Information [optional] -->
<!-- [More Information Needed] -->
<!-- ## Model Card Authors [optional] -->
<!-- [More Information Needed] -->
<!-- ## Model Card Contact -->
<!-- [More Information Needed] -->
