Views
No views yet
Babelscape/Llama-3.1-8B-PRM800k-r is a Process Reward Model (PRM) based on Llama-3.1-8B-Instruct.
It is trained with process-supervision data from PRM800K.1import torch
2from transformers import AutoTokenizer, AutoModel
3repo_id = "Babelscape/Llama-3.1-8B-PRM800k-r"
4tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
5model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).eval()
6def build_prompt(problem, steps):
7 steps_text = "\n".join([f"Step {i+1}: {step}\nки" for i, step in enumerate(steps)])
8 return f"Problem: {problem}\nSteps:\n{steps_text}"
9problem = "If x + 3 = 10, find x."
10steps = [
11 "Subtract 3 from both sides: x = 10 - 3.",
12 "So x = 7."
13]
14prompt = build_prompt(problem, steps)
15inputs = tokenizer(prompt, return_tensors="pt")
16with torch.no_grad():
17 outputs = model(**inputs)
18pred_scalar = outputs["pred_scalar"]
19marker_id = tokenizer.encode("ки", add_special_tokens=False)[0]
20marker_positions = (inputs["input_ids"][0] == marker_id).nonzero(as_tuple=True)[0]
21step_scores = torch.sigmoid(pred_scalar[0, marker_positions]).cpu().tolist()
22print("Step scores:", step_scores)
23first_bad = next((i for i, score in enumerate(step_scores) if score < 0.5), -1)
24print("First failing step index:", first_bad)1@inproceedings{pisano2026prmplanning,
2 title={Process Reward Models Meet Planning: Generating Precise and Scalable Datasets for Step-Level Rewards},
3 author={Pisano, Raffaele and Navigli, Roberto},
4 booktitle={Proceedings of the Annual Meeting of the Association for Computational Linguistics (ACL)},
5 year={2026},
6 note={Accepted}
7}