🚀 ThinkPRM - 1.5B模型介绍
ThinkPRM - 1.5B是一个生成式过程奖励模型(PRM),它基于R1 - Distill - Qwen - 1.5B架构。该模型经过微调,能够通过生成显式的验证思维链(CoT),对推理过程(如数学解题步骤)进行逐步骤验证,并且会对每一步骤进行标注。它具有很高的数据效率,与传统的判别式PRM相比,在使用显著更少的监督数据的情况下,仍能取得出色的性能。
模型信息
属性 |
详情 |
模型类型 |
生成式过程奖励模型(PRM) |
训练数据 |
基于R1 - Distill - Qwen - 1.5B架构,在一个包含1K个合成生成的验证思维链(CoT)的小数据集上进行微调。这些合成CoT由QwQ - 32B - Preview生成,并根据PRM800K数据集中的真实步骤标签进行过滤。 |
许可证 |
apache - 2.0 |
任务类型 |
文本生成 |
🚀 快速开始
以下是使用ThinkPRM - 1.5B模型的示例代码:
from transformers import AutoModelForCausalLM, AutoTokenizer
from vllm import LLM, SamplingParams
model_id = "launch/ThinkPRM-1.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
llm = LLM(model=model_id, max_model_len=16384)
problem = "Solve for x: 2x + 3 = 7"
prefix = "Step 1: Subtract 3 from both sides: 2x = 4\nStep 2: Divide by 2: x = 1"
prompt = f"""You are given a math problem and a proposed step-by-step solution:
[Math Problem]
{problem}
[Solution]
{prefix}
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
"""
prompt = tokenizer.apply_chat_template([
{'role': "user", "content": prompt}
], tokenize=False, add_generation_prompt=True) + "\nLet's verify step by step:"
sampling_params = SamplingParams(
temperature=0.0,
max_tokens=4096,
stop=None
)
outputs = llm.generate(prompt, sampling_params)
verification_cot = outputs[0].outputs[0].text
print(verification_cot)
"""
Step 1: Subtract 3 from both sides: 2x = 4
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
to 2x = 4. This step seems correct.
Step 2: Divide by 2: x = 1
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
g to this calculation, it should be x = 2. This seems incorrect.
Therefore, the first step is correct, but the second step has an error.
**Final Output:**
Let's verify step by step:
Step 1: Subtract 3 from both sides: 2x = 4
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.
Step 1 is \boxed{correct}
Step 2: Divide by 2: x = 1
Critique: This step is incorrect. Dividing both sides of the equation 2x = 4 by 2 should yield x = 2, not x = 1.
Step 2 is \boxed{incorrect}
</think>
Is the solution correct? No
"""
✨ 主要特性
- 逐步骤验证:ThinkPRM - 1.5B能够对推理过程的每一步进行验证,并生成自然语言的批判和正确性判断。
- 数据高效:与传统的判别式PRM相比,该模型在使用显著更少的监督数据的情况下,仍能取得出色的性能。
- 可解释性强:通过生成显式的验证思维链(CoT),对每一步骤进行标注,使得模型的决策过程具有较高的可解释性。
- 性能优越:在包括ProcessBench、MATH - 500、AIME '24、GPQA - Diamond和LiveCodeBench等基准测试中,该模型的表现优于基于相同R1 - Distill - Qwen - 1.5B模型但在多约100倍标签上训练的LLM - as - a - judge和判别式PRM基线模型。
📚 详细文档
模型描述
ThinkPRM - 1.5B通过为给定解题前缀中的每一步生成自然语言批判和正确性判断,提供步骤级别的验证分数。它利用了基础大推理模型(LRM)的潜在推理能力,并通过在一个小的(1K个示例)合成生成的验证CoT数据集上进行微调来增强这些能力。这些合成CoT是通过提示QwQ - 32B - Preview生成的,并根据PRM800K数据集中的真实步骤标签进行过滤,以确保质量。
该模型使用标准的语言建模目标,这使得它具有可解释性,并且可以通过生成更长或多个验证CoT来扩展过程验证计算。
模型来源
直接用途
ThinkPRM - 1.5B旨在验证逐步推理过程的正确性。主要用途包括:
- 评分解决方案:为候选解决方案分配步骤级或总体分数,以便在Best - of - N采样中进行排名,或在推理任务中指导树搜索。
- 生成验证理由/思维链:生成详细的思维链验证,解释为什么特定步骤是正确或错误的,有助于提高可解释性。
- 独立验证:评估给定问题 - 解决方案对的正确性。
该模型已经在数学推理(MATH、AIME)、科学问答(GPQA)和代码生成(LiveCodeBench)等任务上进行了评估。更多详细信息请参阅我们的论文。
🔧 技术细节
ThinkPRM - 1.5B基于R1 - Distill - Qwen - 1.5B架构进行微调。在微调过程中,模型使用了一个小的合成验证CoT数据集,该数据集由QwQ - 32B - Preview生成,并经过过滤以确保质量。模型使用标准的语言建模目标进行训练,这使得它能够生成自然语言的批判和正确性判断。
⚠️ 局限性
- 过度自信:像ThinkPRM这样的生成式PRM有时可能会产生接近0或1的分数,这可能无法反映真实的不确定性。
- 步骤标签干扰:自回归的性质可能会导致早期的错误步骤判断对后续步骤的评估产生负面影响。
- 对格式/提示敏感:模型的性能可能对输入解决方案的具体格式和用于验证的提示敏感(尽管与LLM - as - a - judge相比,微调可能会降低这种敏感性)。
📄 许可证
本模型使用的许可证为apache - 2.0。