Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,129 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
# Model Card for
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
11 |
|
12 |
## Model Details
|
13 |
|
14 |
### Model Description
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
-
- **
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
### Model Sources [optional]
|
29 |
|
30 |
-
|
|
|
31 |
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
-
|
36 |
-
## Uses
|
37 |
-
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
|
40 |
### Direct Use
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
|
70 |
## How to Get Started with the Model
|
|
|
|
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- 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. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
|
155 |
-
|
|
|
|
|
|
|
156 |
|
157 |
-
|
|
|
158 |
|
159 |
-
|
160 |
|
161 |
-
|
162 |
|
163 |
-
|
164 |
|
165 |
-
|
166 |
|
167 |
-
|
|
|
168 |
|
169 |
-
|
|
|
|
|
|
|
170 |
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
-
|
|
|
|
|
174 |
|
175 |
-
|
|
|
|
|
176 |
|
177 |
-
|
|
|
178 |
|
179 |
-
|
180 |
|
181 |
-
|
|
|
182 |
|
183 |
-
|
184 |
|
185 |
-
|
186 |
|
187 |
-
|
188 |
|
189 |
-
|
190 |
|
191 |
-
|
192 |
|
193 |
-
|
194 |
|
195 |
-
|
196 |
|
197 |
-
|
198 |
|
199 |
-
|
|
|
|
|
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- reward-model
|
5 |
+
- prm
|
6 |
+
- generative reward model
|
7 |
+
- process supervision
|
8 |
+
- chain-of-thought
|
9 |
+
- verification
|
10 |
+
- math reasoning
|
11 |
+
- code verification
|
12 |
+
license: apache-2.0
|
13 |
+
pipeline_tag: text-generation
|
14 |
---
|
15 |
|
16 |
+
# Model Card for ThinkPRM-7B
|
17 |
|
18 |
+
ThinkPRM-7B is a generative Process Reward Model (PRM) based on the R1-Distill-Qwen-7B architecture. It is fine-tuned to perform step-by-step verification of reasoning processes (like mathematical solutions) by generating an explicit verification chain-of-thought (CoT) that involves labeling every step. It is designed to be highly data-efficient, requiring significantly less supervision data than traditional discriminative PRMs while achieving strong performance.
|
19 |
|
20 |
+
Here's an example of the model output:
|
21 |
|
22 |
|
23 |
## Model Details
|
24 |
|
25 |
### Model Description
|
26 |
|
27 |
+
ThinkPRM-7B provides step-level verification scores by generating natural language critiques and correctness judgments for each step in a given solution prefix. It leverages the underlying reasoning capabilities of the base Large Reasoning Model (LRM) and enhances them through fine-tuning on a small (1K examples) dataset of synthetically generated verification CoTs. These synthetic CoTs were produced by prompting QwQ-32B-Preview and filtered against ground-truth step labels from the PRM800K dataset to ensure quality.
|
28 |
|
29 |
+
The model uses a standard language modeling objective, making it interpretable and allowing it to scale process verification compute by generating longer or multiple verification CoTs. It demonstrated superior performance compared to LLM-as-a-judge and discriminative PRM baselines (based on the same R1-Distill-Qwen-7B model but trained on ~100x more labels) on benchmarks including ProcessBench, MATH-500, AIME '24, GPQA-Diamond, and LiveCodeBench.
|
30 |
|
31 |
+
- **Finetuned from model [optional]:** [R1-Distill-Qwen-7B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B)
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
### Model Sources [optional]
|
34 |
|
35 |
+
- **Repository:** [Github](https://github.com/mukhal/thinkprm)
|
36 |
+
- **Paper:** [Process Reward Models that Think (arXiv:2504.16828)](https://arxiv.org/abs/2504.16828)
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
### Direct Use
|
40 |
|
41 |
+
ThinkPRM-7B is intended for verifying the correctness of step-by-step reasoning processes. Primary uses include:
|
42 |
+
- **Scoring Solutions:** Assigning step-level or overall scores to candidate solutions for ranking in Best-of-N sampling or guiding tree search in reasoning tasks.
|
43 |
+
- **Generating Verification Rationales/CoTs:** Producing detailed chain-of-thought verifications that explain *why* a particular step is correct or incorrect, aiding interpretability.
|
44 |
+
- **Standalone Verification:** Evaluating the correctness of a given problem-solution pair.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
The model has been evaluated on mathematical reasoning (MATH, AIME), scientific QA (GPQA), and code generation (LiveCodeBench). See our paper for more details.
|
47 |
|
48 |
+
## Limitations
|
49 |
|
50 |
+
- **Overconfidence:** Generative PRMs like ThinkPRM can sometimes produce scores clustered near 0 or 1, potentially not reflecting true uncertainty
|
51 |
+
- **Step Label Interference:** The autoregressive nature might cause an early incorrect step judgment to negatively bias the evaluation of subsequent steps.
|
52 |
+
- **Sensitivity to Formatting/Prompting:** Performance might be sensitive to the exact format of the input solution and the prompt used for verification (though fine-tuning likely reduces this compared to LLM-as-a-judge).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
## How to Get Started with the Model
|
55 |
+
```python
|
56 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
57 |
+
from vllm import LLM, SamplingParams
|
58 |
|
59 |
+
model_id = "launch/ThinkPRM-7B" # Replace with actual model ID on Hub
|
60 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
61 |
+
llm = LLM(model=model_id, max_model_len=16384)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
+
# Example problem and solution
|
64 |
+
problem = "Solve for x: 2x + 3 = 7"
|
65 |
+
prefix = "Step 1: Subtract 3 from both sides: 2x = 4
|
66 |
+
Step 2: Divide by 2: x = 1"
|
67 |
|
68 |
+
# Format the prompt
|
69 |
+
prompt = f"""You are given a math problem and a proposed step-by-step solution:
|
70 |
|
71 |
+
[Math Problem]
|
72 |
|
73 |
+
{problem}
|
74 |
|
75 |
+
[Solution]
|
76 |
|
77 |
+
{prefix}
|
78 |
|
79 |
+
Review and critique each step in the proposed solution to determine whether each step is correct. If the solution is incomplete, only verify the provided steps
|
80 |
+
"""
|
81 |
|
82 |
+
prompt = tokenizer.apply_chat_template([
|
83 |
+
{'role': "user", "content": prompt}
|
84 |
+
], tokenize=False, add_generation_prompt=True) + "
|
85 |
+
Let's verify step by step:"
|
86 |
|
87 |
+
# Set sampling parameters
|
88 |
+
sampling_params = SamplingParams(
|
89 |
+
temperature=0.0,
|
90 |
+
max_tokens=4096,
|
91 |
+
stop=None
|
92 |
+
)
|
93 |
|
94 |
+
# Generate the verification
|
95 |
+
outputs = llm.generate(prompt, sampling_params)
|
96 |
+
verification_cot = outputs[0].outputs[0].text
|
97 |
|
98 |
+
print(verification_cot)
|
99 |
+
"""
|
100 |
+
Step 1: Subtract 3 from both sides: 2x = 4
|
101 |
|
102 |
+
Critique: Starting with the equation 2x + 3 = 7, subtracting 3 from both sides is a correct operation to isolate the term with the variable. So, 2x + 3 - 3 = 7 - 3, which simplifies
|
103 |
+
to 2x = 4. This step seems correct.
|
104 |
|
105 |
+
Step 2: Divide by 2: x = 1
|
106 |
|
107 |
+
Critique: Now, to solve for x, we need to divide both sides of the equation by 2. So, 2x / 2 = 4 / 2, which simplifies to x = 2. Wait a minute, the solution says x = 1, but accordin
|
108 |
+
g to this calculation, it should be x = 2. This seems incorrect.
|
109 |
|
110 |
+
Therefore, the first step is correct, but the second step has an error.
|
111 |
|
112 |
+
**Final Output:**
|
113 |
|
114 |
+
Let's verify step by step:
|
115 |
|
116 |
+
Step 1: Subtract 3 from both sides: 2x = 4
|
117 |
|
118 |
+
Critique: This step is correct. Subtracting 3 from both sides of the equation 2x + 3 = 7 properly isolates the term with the variable, resulting in 2x = 4.
|
119 |
|
120 |
+
Step 1 is \boxed{correct}
|
121 |
|
122 |
+
Step 2: Divide by 2: x = 1
|
123 |
|
124 |
+
Critique: This step is incorrect. Dividing both sides of the equation 2x = 4 by 2 should yield x = 2, not x = 1.
|
125 |
|
126 |
+
Step 2 is \boxed{incorrect}
|
127 |
+
</think>
|
128 |
+
Is the solution correct? No
|
129 |
+
"""
|