Downloads · 30 days
13
18% of all-time downloads
Diginyx/Qwen3.5-27B-prm-ep1
Qwen3.5-27B-prm-ep1 is a text classification model from Diginyx. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as apache-2.0.
A QLoRA Process Reward Model (PRM) fine-tuned from Qwen/Qwen3.5-27B to score turn-level responses in Playpen clembench 2.0 games. It predicts the expected game success probability given the conversation history up to…
Downloads · 30 days
13
18% of all-time downloads
All-time downloads
74
Public
Repo size
964 MB
Likes
0
Public
Click a slice to open those files.
.safetensors24.2 MB · 55%
From the Hugging Face model README
A QLoRA Process Reward Model (PRM) fine-tuned from Qwen/Qwen3.5-27B to score turn-level responses in Playpen clembench 2.0 games. It predicts the expected game success probability given the conversation history up to and including a candidate response, and is used to guide the companion policy model (Diginyx/Qwen3.5-27B-sft-ep1) via best-of-N selection or beam search at inference time.
num_labels=1The PRM is trained using soft labels derived from Monte Carlo rollouts (MATH-SHEPHERD style), not human annotations. For each step in a game trajectory, the label is the fraction of independent rollouts from that step that reached a successful game outcome — the expected future success probability.
Rollout pipeline:
BENCH_SCORE metric (0–1 continuous, aborts → 0).BENCH_SCORE over all N rollouts from that branch point — the expected bench score reachable from that state.AutoModelForSequenceClassification (num_labels=1) on (conversation_prefix + candidate_response, soft_label) pairs using MSE/BCE loss.Design decisions:
bench scoring strategy: Trained on the game's native clembench bench score rather than a simple win/loss flag, giving the PRM a richer signal that reflects partial progress (e.g., partial credit for partial task completion).game_name="all")bench — mean clembench BENCH_SCORE over N rollouts from each branch pointPRM_MAX_ROLLOUT_ROUNDS rounds past the branch point; partial rollouts labelled with the clembench partial score at cutoff| Parameter | Value |
|---|---|
| Learning rate | 3e-5 |
| LR scheduler | Default (linear) |
| Max epochs | 50 (early stopping, patience=3) |
| Per-device batch size | 4 |
| Gradient accumulation | 32 |
| Effective batch size | 128 |
| Max sequence length | 1024 tokens (truncate left) |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA target modules | q_proj, v_proj |
| Task type | SEQ_CLS (num_labels=1) |
| Quantization | 4-bit NF4 (bitsandbytes) |
| Compute dtype | bfloat16 |
| Weight decay | 0.0 |
| Eval strategy | Per epoch |
| Resource | Details |
|---|---|
| Hardware | NVIDIA A40 (48 GB) GPUs |
| Cluster | University of Michigan HPC (SLURM) |
| Account | chaijy2 / chaijy0 |
import torch
import torch.nn.functional as F
from peft import PeftModel, PeftConfig
from transformers import AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig
prm_path = "Diginyx/Qwen3.5-27B-prm-ep1"
peft_cfg = PeftConfig.from_pretrained(prm_path)
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)
base = AutoModelForSequenceClassification.from_pretrained(
peft_cfg.base_model_name_or_path,
num_labels=1,
quantization_config=bnb_config,
device_map="auto",
)
prm = PeftModel.from_pretrained(base, prm_path)
tokenizer = AutoTokenizer.from_pretrained(prm_path)
prm.eval()
# messages: the conversation history up to the current turn
# candidate: the response to score
messages = [
{"role": "user", "content": "Guess a 5-letter word."},
{"role": "assistant", "content": "Guess: crane"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=1024,
truncation_side="left").to("cuda")
with torch.no_grad():
score = torch.sigmoid(prm(**inputs).logits[0, 0]).item()
print(f"P(success) = {score:.4f}")
Install Playpen and run:
python examples/trl/prm_eval.py \
--policy-model Qwen3.5-27B-sft-ep1 \
--prm-path Diginyx/Qwen3.5-27B-prm-ep1 \
--game-all \
--n-candidates 4 \
--temperature 0.7 \
--max-tokens 2048
python examples/trl/prm_eval.py \
--policy-model Qwen3.5-27B-sft-ep1 \
--prm-path Diginyx/Qwen3.5-27B-prm-ep1 \
--mode beam-search \
--n-candidates 4 \
--num-beam-iterations 20 \
--game-all \
--temperature 0.7 \
--max-tokens 2048
The full training and inference pipeline — including rollout collection, PRM training, SFT training, best-of-N, and beam search — is available at Diginyx/playpen-prm-code:
| Script | Purpose |
|---|---|
prm_trainer.py | PRM rollout collection + training |
prm_train_from_records.py | Train PRM from pre-collected rollout records |
prm_eval.py | Best-of-N and beam search guided inference |
sft_trainer_lora.py | SFT policy fine-tuning |
eval_validation_one.py | Plain (no PRM) evaluation |