Views
No views yet
Qwen/Qwen2.5-1.5B-Instruct, trained with
reasoning-aware Direct Preference Optimization (DPO) on flip pairs
of a procedural-compliance corpus.compliant or
non-compliant with the procedure, and produce structured reasoning before the
verdict.EDGE CHECKS ... FINAL ANSWER: completion whose reasoning
matches this scenario and ends in the gold verdict;| regime | flip rate | anchor acc | plain acc |
|---|---|---|---|
| forced-verdict | 0.328 | 0.615 | 0.660 |
| free-form | 0.484 | 0.672 | 0.752 |
| base ref (FF) | 0.219 | 0.467 | 0.576 |
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5BASE = "Qwen/Qwen2.5-1.5B-Instruct"
6ADAPTER = "kennethp97/dpo-flip-1p5b"
7
8tok = AutoTokenizer.from_pretrained(BASE, use_fast=True)
9tok.pad_token = tok.pad_token or tok.eos_token
10tok.padding_side = "left"
11
12base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16,
13 device_map="auto")
14model = PeftModel.from_pretrained(base, ADAPTER)
15model.eval()
16
17USER = (
18 "You are a process-structure compliance checker.\n"
19 "Check edge-level constraints before final judgment.\n\n"
20 "Process:\n<your procedure>\n\n"
21 "Scenario:\n<your scenario>\n\n"
22 "Output format:\nEDGE CHECKS:\n- VIOLATED - [edge]: [reason]\n"
23 "- SATISFIED - [edge]: [reason]\nFINAL ANSWER: compliant|non-compliant\n"
24)
25prompt = tok.apply_chat_template([{"role": "user", "content": USER}],
26 tokenize=False, add_generation_prompt=True)
27out = model.generate(**tok(prompt, return_tensors="pt").to(model.device),
28 max_new_tokens=1024, do_sample=False,
29 pad_token_id=tok.eos_token_id)
30print(tok.decode(out[0], skip_special_tokens=True))kennethp97/sft-arm-a-1p5b), see the
combined eval notebook in the repository this adapter was released from.Qwen/Qwen2.5-1.5B-Instructtrain_registry v0.4.0 corpusEDGE CHECKS ... FINAL ANSWER
format above; deviation may degrade performance. Greedy (T=0) matches the
reported numbers.