yiqingx commited on
Commit
3fa4d51
·
verified ·
1 Parent(s): be825f8

1541 code-critic DPO preference pairs, filtered to fit in 8192 tokens

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +94 -0
  3. dataset_info.json +19 -0
  4. prm_dpo_pairs_train.jsonl +3 -0
.gitattributes CHANGED
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ prm_dpo_pairs_train.jsonl filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - text-generation
5
+ language:
6
+ - en
7
+ tags:
8
+ - dpo
9
+ - preference
10
+ - process-reward-model
11
+ - code-critic
12
+ size_categories:
13
+ - 1K<n<10K
14
+ configs:
15
+ - config_name: default
16
+ data_files:
17
+ - split: train
18
+ path: prm_dpo_pairs_train.jsonl
19
+ ---
20
+
21
+ # PRM_1541i
22
+
23
+ 1541 preference pairs for training a critic over coding-agent trajectories. Each example is a
24
+ multi-turn agent transcript paired with two candidate critiques — one preferred, one rejected.
25
+
26
+ A critique is a structured error analysis over 12 categories, each with a `DETECTED: Yes/No` verdict
27
+ and, when detected, `EVIDENCE` and `RECOVERY_ACTION` fields, closing with `TASK_STATUS` and
28
+ `OVERALL_GUIDANCE`.
29
+
30
+ ## Format
31
+
32
+ ShareGPT / LLaMA-Factory layout (`dataset_info.json` included):
33
+
34
+ ```json
35
+ {
36
+ "messages": [{"role": "system", ...}, {"role": "user", ...}, ...],
37
+ "chosen": {"role": "assistant", "content": "SPECIFICATION ERRORS:\n1. ..."},
38
+ "rejected": {"role": "assistant", "content": "SPECIFICATION ERRORS:\n1. ..."}
39
+ }
40
+ ```
41
+
42
+ `messages` ends on a user turn; `chosen` and `rejected` are single assistant messages. To use with
43
+ TRL's conversational preference format:
44
+
45
+ ```python
46
+ from datasets import load_dataset
47
+
48
+ def to_preference(example):
49
+ return {
50
+ "prompt": example["messages"],
51
+ "chosen": [example["chosen"]],
52
+ "rejected": [example["rejected"]],
53
+ }
54
+
55
+ dataset = load_dataset("code-critic-model/PRM_1541i", split="train")
56
+ dataset = dataset.map(to_preference, remove_columns=["messages"])
57
+ dataset = dataset.train_test_split(test_size=0.1, seed=42) # 1386 train / 155 eval
58
+ ```
59
+
60
+ ## Length filtering
61
+
62
+ Pre-filtered so that every pair fits whole in **8192 tokens** under the
63
+ `Qwen/Qwen3-4B-Instruct-2507` tokenizer, measured the way `DPOTrainer` measures it (render with the
64
+ chat template, then tokenize `prompt` and `prompt + completion`). Nothing is truncated or dropped at
65
+ train time. Prompts are long — around 7000 tokens — and completions are around 580.
66
+
67
+ ## Statistics
68
+
69
+ Measured over all 1541 pairs:
70
+
71
+ | | |
72
+ |---|---|
73
+ | pairs | 1541 |
74
+ | median prompt length | ~7000 tokens |
75
+ | median completion length | ~580 tokens |
76
+ | `OVERALL_GUIDANCE` share of completion | 12.5% (median 74 tokens) |
77
+ | pairs where chosen/rejected flip >= 1 `DETECTED` verdict | 892 (57.9%) |
78
+ | pairs differing in prose only (identical verdicts) | 649 (42.1%) |
79
+ | median flipped `DETECTED` labels per pair | 1 |
80
+ | median char similarity, pre-`OVERALL_GUIDANCE` section | 0.399 |
81
+ | pairs whose common prefix reaches `OVERALL_GUIDANCE` | 8.2% |
82
+
83
+ The last three rows matter for anyone planning to slice this data. The chosen and rejected critiques
84
+ are **not** identical up to the guidance paragraph — they diverge a median of ~1859 characters before
85
+ `OVERALL_GUIDANCE` begins, and the categorization sections differ substantially. Training only on the
86
+ `OVERALL_GUIDANCE` span would discard ~87% of the tokens and most of the signal.
87
+
88
+ Slicing by pair type does not help either: in a DPO run on this data, the verdict-flip subset scored
89
+ 0.620 held-out preference accuracy and the prose-only subset 0.618 — statistically indistinguishable.
90
+
91
+ ## Models trained on this dataset
92
+
93
+ - [`code-critic-model/Qwen3-4B-DPO-beta0.1-sft0.25-lr1e-6-bs32-ep1`](https://huggingface.co/code-critic-model/Qwen3-4B-DPO-beta0.1-sft0.25-lr1e-6-bs32-ep1)
94
+ — 0.619 held-out preference accuracy vs 0.516 for the base model.
dataset_info.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "prm_dpo_pairs_train": {
3
+ "file_name": "prm_dpo_pairs_train.jsonl",
4
+ "formatting": "sharegpt",
5
+ "ranking": true,
6
+ "columns": {
7
+ "messages": "messages",
8
+ "chosen": "chosen",
9
+ "rejected": "rejected"
10
+ },
11
+ "tags": {
12
+ "role_tag": "role",
13
+ "content_tag": "content",
14
+ "user_tag": "user",
15
+ "assistant_tag": "assistant",
16
+ "system_tag": "system"
17
+ }
18
+ }
19
+ }
prm_dpo_pairs_train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a289bda29885d35958b902f63c2ba25a7b784dd96d50d20566381d4248be397
3
+ size 51531244