🚀 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。