File size: 3,388 Bytes
3fa4d51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
license: apache-2.0
task_categories:
- text-generation
language:
- en
tags:
- dpo
- preference
- process-reward-model
- code-critic
size_categories:
- 1K<n<10K
configs:
- config_name: default
  data_files:
  - split: train
    path: prm_dpo_pairs_train.jsonl
---

# PRM_1541i

1541 preference pairs for training a critic over coding-agent trajectories. Each example is a
multi-turn agent transcript paired with two candidate critiques — one preferred, one rejected.

A critique is a structured error analysis over 12 categories, each with a `DETECTED: Yes/No` verdict
and, when detected, `EVIDENCE` and `RECOVERY_ACTION` fields, closing with `TASK_STATUS` and
`OVERALL_GUIDANCE`.

## Format

ShareGPT / LLaMA-Factory layout (`dataset_info.json` included):

```json
{
  "messages":  [{"role": "system", ...}, {"role": "user", ...}, ...],
  "chosen":    {"role": "assistant", "content": "SPECIFICATION ERRORS:\n1. ..."},
  "rejected":  {"role": "assistant", "content": "SPECIFICATION ERRORS:\n1. ..."}
}
```

`messages` ends on a user turn; `chosen` and `rejected` are single assistant messages. To use with
TRL's conversational preference format:

```python
from datasets import load_dataset

def to_preference(example):
    return {
        "prompt": example["messages"],
        "chosen": [example["chosen"]],
        "rejected": [example["rejected"]],
    }

dataset = load_dataset("code-critic-model/PRM_1541i", split="train")
dataset = dataset.map(to_preference, remove_columns=["messages"])
dataset = dataset.train_test_split(test_size=0.1, seed=42)  # 1386 train / 155 eval
```

## Length filtering

Pre-filtered so that every pair fits whole in **8192 tokens** under the
`Qwen/Qwen3-4B-Instruct-2507` tokenizer, measured the way `DPOTrainer` measures it (render with the
chat template, then tokenize `prompt` and `prompt + completion`). Nothing is truncated or dropped at
train time. Prompts are long — around 7000 tokens — and completions are around 580.

## Statistics

Measured over all 1541 pairs:

| | |
|---|---|
| pairs | 1541 |
| median prompt length | ~7000 tokens |
| median completion length | ~580 tokens |
| `OVERALL_GUIDANCE` share of completion | 12.5% (median 74 tokens) |
| pairs where chosen/rejected flip >= 1 `DETECTED` verdict | 892 (57.9%) |
| pairs differing in prose only (identical verdicts) | 649 (42.1%) |
| median flipped `DETECTED` labels per pair | 1 |
| median char similarity, pre-`OVERALL_GUIDANCE` section | 0.399 |
| pairs whose common prefix reaches `OVERALL_GUIDANCE` | 8.2% |

The last three rows matter for anyone planning to slice this data. The chosen and rejected critiques
are **not** identical up to the guidance paragraph — they diverge a median of ~1859 characters before
`OVERALL_GUIDANCE` begins, and the categorization sections differ substantially. Training only on the
`OVERALL_GUIDANCE` span would discard ~87% of the tokens and most of the signal.

Slicing by pair type does not help either: in a DPO run on this data, the verdict-flip subset scored
0.620 held-out preference accuracy and the prose-only subset 0.618 — statistically indistinguishable.

## Models trained on this dataset

- [`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)
  — 0.619 held-out preference accuracy vs 0.516 for the base model.