jxtse commited on
Commit
ad22d37
·
verified ·
1 Parent(s): 54c2c22

Add ReTRACE three-stage post-training data (private)

Browse files
.gitattributes CHANGED
@@ -58,3 +58,5 @@ 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
+ stage2_teacher_trajectories/train.jsonl filter=lfs diff=lfs merge=lfs -text
62
+ stage3_self_refinement/train.jsonl filter=lfs diff=lfs merge=lfs -text
LICENSE.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # License: ReTRACE research data
2
+
3
+ This dataset (`jxtse/ReTRACE-train-data`) is released **for non-commercial research use only**, to
4
+ support reproducibility of the ReTRACE paper.
5
+
6
+ - The compilation of the three training subsets, the field labels added to them, and the annotations
7
+ produced by the authors are released by the authors under these terms.
8
+ - Content inside the data that was generated by third parties — responses produced by other
9
+ providers' language models, reactions extracted from public patent sources, and target molecules
10
+ taken from prior datasets — remains subject to the terms of those originators. This license does
11
+ not extend or replace them. Where a third-party dataset is named in the card (e.g. Retro*-190),
12
+ its own license governs reuse of that portion.
13
+ - Not granted: any right to redistribute this data commercially, to sublicense it, or to use it to
14
+ train models that are offered commercially without separate permission.
15
+ - No warranty. The data is provided "as is", without any express or implied warranty, and without
16
+ any guarantee of fitness for a particular purpose or of freedom from third-party claims.
17
+ - Attribution: cite the ReTRACE paper and this dataset when you use it.
18
+
19
+ If you are unsure whether your intended use falls inside these terms, ask the authors first.
MANIFEST.sha256 ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 1f4fb7ed6eacb469ef7d0521bd2e2c235616a3e5adb8ed87f50a3c02c330d93f LICENSE.md
2
+ 116eca21bf5fe495dabfdab27be3cb9a996a702d6324c072f016dfe8ee41f875 README.md
3
+ 030db036cdf90e47cd9588d195bd074d81630c6eaf3e6bf9ad01a5e942463070 STATS.json
4
+ c4db3af83433b222ffb391aa7b1eadcb838ce5196d49bcd445546d8040bb373b stage1_critique/train.jsonl
5
+ daea5e9de33b11148b7d7d5fa6956060d92c979acbe9aecde902b03d5248227b stage2_teacher_trajectories/train.jsonl
6
+ 989dd9da3675883e0db2048ab90e71fcdeb9dafbe54d88bf35ec7976b14f9f06 stage3_self_refinement/train.jsonl
README.md ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: retrace-research-data
4
+ pretty_name: ReTRACE post-training curriculum
5
+ task_categories:
6
+ - text-generation
7
+ tags:
8
+ - chemistry
9
+ - retrosynthesis
10
+ - agents
11
+ - tool-use
12
+ configs:
13
+ - config_name: stage1_critique
14
+ data_files:
15
+ - split: train
16
+ path: stage1_critique/train.jsonl
17
+ - config_name: stage2_teacher_trajectories
18
+ data_files:
19
+ - split: train
20
+ path: stage2_teacher_trajectories/train.jsonl
21
+ - config_name: stage3_self_refinement
22
+ data_files:
23
+ - split: train
24
+ path: stage3_self_refinement/train.jsonl
25
+ ---
26
+
27
+ # ReTRACE post-training curriculum
28
+
29
+ Training data for **ReTRACE**, a retrosynthesis planning agent. The dataset is the
30
+ three-stage post-training curriculum of the released checkpoint
31
+ [`jxtse/ReTRACE-27B-latest`](https://huggingface.co/jxtse/ReTRACE-27B-latest) (tag `s3-v1`), a LoRA
32
+ adapter set trained on [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B).
33
+
34
+ Each subset is one stage of the curriculum and is a separate config, so you can load them
35
+ independently and train them in order:
36
+
37
+ ```python
38
+ from datasets import load_dataset
39
+ s1 = load_dataset("jxtse/ReTRACE-train-data", "stage1_critique", split="train") # 819 rows
40
+ s2 = load_dataset("jxtse/ReTRACE-train-data", "stage2_teacher_trajectories", split="train") # 167 rows
41
+ s3 = load_dataset("jxtse/ReTRACE-train-data", "stage3_self_refinement", split="train") # 26 rows
42
+ ```
43
+
44
+ ## What the three stages are
45
+
46
+ **Stage 1 — reference-guided critique (819 rows, 804 distinct questions).**
47
+ The model is shown a product SMILES and a few single-step precursor proposals and must screen them
48
+ (keep / reject) with reasoning. Each row is `user` → `assistant`, where the assistant turn is
49
+ `<think>` reasoning followed by the answer. The training text is the *student-visible* form only:
50
+ the reference explanation that guided generation is not part of any row. 788 rows are
51
+ reference-conditioned self-distillation of the base model, 31 are rejection sampling from the base
52
+ model that passed the answer-accuracy gates. Reactions behind the questions are USPTO patent
53
+ reactions. `screen_verdict` is the audit grade of the row (`pass`, `minor`) — not the model's own
54
+ keep/reject labels.
55
+
56
+ **Stage 2 — teacher agent trajectories (167 rows, 71 targets).**
57
+ Full tool-use trajectories of the ReTRACE agent harness on Retro*-190 training targets, generated by
58
+ a teacher LLM (GPT-6 Astra) and admitted only when the final route was audited VALID. Turn-level loss
59
+ masks are applied: 5,537 of 6,513 assistant turns are supervised and 976 are not. Tool results are
60
+ never supervised. No teacher reasoning text is present in the rows (the teacher's thinking was not
61
+ exported), so what is supervised is the model's own tool calls and short natural-language turns. The
62
+ same 167 rows were also used for the teacher-SFT arm reported in the paper. 9 tool schemas are in
63
+ the `tools` field.
64
+
65
+ **Stage 3 — self-refinement (26 rows, 22 targets).**
66
+ The stage-2 student's *own* trajectories on training targets, admitted by the route audit and then
67
+ masked at turn level. These rows ship as authoritative token arrays, exactly as trained:
68
+ 1,094,003 total tokens, of which 49,040 are selected for loss (332,573 tokens were turn-level
69
+ eligible). `labels` is `-100` on every non-selected position, i.e. `labels != -100` is exactly the
70
+ `selected_mask`. A decoded `text` copy is provided for readability; the token arrays, not the text,
71
+ are the training truth.
72
+
73
+ Order of use: stage 1 → stage 2 → stage 3, each continuing from the previous adapter.
74
+
75
+ ## Fields
76
+
77
+ Common: `id` (row identifier).
78
+
79
+ `stage1_critique`
80
+ - `messages` — ms-swift conversation: `user` (product + numbered candidates + screening instruction), `assistant` (`<think>` reasoning + verdicts). Text is byte-identical to the text that was trained.
81
+ - `chat_template_kwargs` — `{"enable_thinking": true, "preserve_thinking": true, "reasoning_effort": "medium"}`.
82
+ - `source` — `self_distillation` or `rejection_sampling`.
83
+ - `screen_verdict` — `pass` or `minor` (audit grade).
84
+
85
+ `stage2_teacher_trajectories`
86
+ - `messages` — system / user / assistant / tool turns; assistant turns carry `loss: true|false` and `tool_calls`; tool turns carry `tool_call_id`.
87
+ - `tools` — 9 function schemas.
88
+ - `chat_template_kwargs` — `{"enable_thinking": true, "reasoning_effort": "medium"}`.
89
+ - `target_index` — index of the Retro*-190 target in the 130/20/40 split (all rows are `train_stage2` targets).
90
+ - `replicate` — 1-based replicate index of that trajectory within its target, by file order (derived; the source export has no explicit replicate id).
91
+
92
+ `stage3_self_refinement`
93
+ - `input_ids`, `labels`, `selected_mask`, `eligible_mask` — token arrays exactly as trained (do not re-tokenize).
94
+ - `text` — `tokenizer.decode(input_ids, skip_special_tokens=False)` with the Qwen3.8-27B tokenizer; decoding and re-encoding round-trips for all 26 rows.
95
+ - `n_tokens`, `n_loss_tokens` — counts of `input_ids` and of `labels != -100`.
96
+ - `target_index`, `replicate`, `uid` — provenance of the row in the export.
97
+
98
+ ## Training
99
+
100
+ Load with ms-swift. Data-format details and the exact per-stage commands (including the
101
+ turn-level masking and the pretokenized stage-3 loader) are in the `posttraining/` directory of
102
+ https://github.com/jxtse/retrace. Stage 1 and 2 are plain `messages` JSONL with
103
+ `chat_template_kwargs`; stage 3 is already tokenized and should be consumed as pretokenized rows
104
+ (`input_ids` / `labels`), not re-rendered through a chat template.
105
+
106
+ ## Sanitization
107
+
108
+ Two stage-2 tool results contained an internal serving URL with a local port; the URL was replaced
109
+ with a neutral placeholder in the tool result (never in supervised text). No hostnames, private IP
110
+ addresses, absolute file paths, credentials or personal identifiers remain in any released text, and
111
+ the stage-3 token arrays were not modified. Internal stock/pricing service labels
112
+ (`Zinc_Fix-stock`, `BioNav-stock`, `ChemPrice`) do occur in tool output and in some supervised turns;
113
+ they are database availability labels, not vendor catalogue entries or prices, and were left as-is so
114
+ the supervised signal is not altered.
115
+
116
+ ## Provenance and rights
117
+
118
+ - **Stage 1** reactions are derived from USPTO patent reactions (public-domain US patents via the
119
+ commonly used USPTO extraction). Assistant reasoning text was generated by the base model (Qwen3.8-27B)
120
+ in the authors' pipeline; `screen_verdict` is the authors' screening grade.
121
+ - **Stage 2** assistant turns were generated by a third-party LLM (GPT-6 Astra) and selected using
122
+ LLM-judge verdicts from the Claude Opus family. Their providers' terms continue to apply to that
123
+ generated content; it is shared here for non-commercial research reproducibility, not as a grant of
124
+ rights the authors do not hold.
125
+ - **Stages 2 and 3** targets are from Retro*-190 (Chen et al., 2020, MIT). Please follow the
126
+ original dataset's terms when reusing those targets.
127
+ - Dataset compilation and annotations by the authors are released for non-commercial research use;
128
+ see `LICENSE.md`. No warranty is given.
129
+
130
+ ## Evaluation hygiene
131
+
132
+ No target from the 40 held-out evaluation targets (`Test40`) is included. Every stage-1 product (819/819) and every
133
+ stage-2 and stage-3 target (167/167 and 26/26) was compared against the 40 `test40_eval` targets of
134
+ the 130/20/40 Retro*-190 split after RDKit canonicalization: zero matches, by canonical SMILES and by
135
+ raw string.
136
+
137
+ ## Not included
138
+
139
+ Model outputs on evaluation sets, audit verdict prose, raw conversation transcripts beyond the
140
+ training rows above, and internal file paths are deliberately excluded.
STATS.json ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "generated": "2026-11-19T09:29:40+08:00",
3
+ "dataset": "jxtse/ReTRACE-train-data (private staging; not uploaded)",
4
+ "files": {
5
+ "LICENSE.md": {
6
+ "bytes": 1323,
7
+ "sha256": "1f4fb7ed6eacb469ef7d0521bd2e2c235616a3e5adb8ed87f50a3c02c330d93f"
8
+ },
9
+ "README.md": {
10
+ "bytes": 7544,
11
+ "sha256": "6b7dd1ebed4fa3fb5c6c43b4480f199ab4476698756f67c59ea50b5bfb9fcdc1"
12
+ },
13
+ "stage1_critique/train.jsonl": {
14
+ "bytes": 7166303,
15
+ "sha256": "c4db3af83433b222ffb391aa7b1eadcb838ce5196d49bcd445546d8040bb373b"
16
+ },
17
+ "stage2_teacher_trajectories/train.jsonl": {
18
+ "bytes": 32190438,
19
+ "sha256": "daea5e9de33b11148b7d7d5fa6956060d92c979acbe9aecde902b03d5248227b"
20
+ },
21
+ "stage3_self_refinement/train.jsonl": {
22
+ "bytes": 21908248,
23
+ "sha256": "989dd9da3675883e0db2048ab90e71fcdeb9dafbe54d88bf35ec7976b14f9f06"
24
+ }
25
+ },
26
+ "rows": {
27
+ "stage1_critique": 819,
28
+ "stage2_teacher_trajectories": 167,
29
+ "stage3_self_refinement": 26
30
+ },
31
+ "stage1": {
32
+ "rows": 819,
33
+ "distinct_questions": 804,
34
+ "distinct_products": 708,
35
+ "source_counts": {
36
+ "self_distillation": 788,
37
+ "rejection_sampling": 31
38
+ },
39
+ "verdict_counts": {
40
+ "pass": 131,
41
+ "minor": 688
42
+ },
43
+ "chat_template_kwargs": {
44
+ "enable_thinking": true,
45
+ "reasoning_effort": "medium",
46
+ "preserve_thinking": true
47
+ },
48
+ "text_chars": 6749153,
49
+ "tokens_reported_by_build": 2561666,
50
+ "loss_tokens_reported_by_build": 2384539,
51
+ "assistant_tokens_p50_p90_max": [
52
+ 2485,
53
+ 5377,
54
+ 11895
55
+ ],
56
+ "rows_bytes_identical_to_raw": 819,
57
+ "sanitized_rows": []
58
+ },
59
+ "stage2": {
60
+ "rows": 167,
61
+ "distinct_targets": 71,
62
+ "target_roles": {
63
+ "train_stage2": 167
64
+ },
65
+ "messages": 23822,
66
+ "assistant_turns": 6513,
67
+ "assistant_turns_loss_true": 5537,
68
+ "assistant_turns_loss_false": 976,
69
+ "tool_results": 16744,
70
+ "tool_schemas": 9,
71
+ "tool_names": [
72
+ "save_best_route",
73
+ "list_best_routes",
74
+ "validate_smiles",
75
+ "analyze_molecule",
76
+ "suggest_templates",
77
+ "check_buyability",
78
+ "score_route",
79
+ "explore_branches",
80
+ "neural_retro"
81
+ ],
82
+ "chat_template_kwargs": {
83
+ "enable_thinking": true,
84
+ "reasoning_effort": "medium"
85
+ },
86
+ "tokens_reported_by_conversion_report": 12833284,
87
+ "loss_tokens_reported_by_conversion_report": 2488244,
88
+ "text_chars": 20651483,
89
+ "rows_bytes_identical_to_raw": 165,
90
+ "sanitized_rows": [
91
+ 138,
92
+ 157
93
+ ]
94
+ },
95
+ "stage3": {
96
+ "rows": 26,
97
+ "distinct_targets": 22,
98
+ "target_roles": {
99
+ "train_stage2": 26
100
+ },
101
+ "full_tokens": 1094003,
102
+ "selected_tokens": 49040,
103
+ "loss_tokens": 49040,
104
+ "eligible_tokens": 332573,
105
+ "labels_eq_selected_mask": true,
106
+ "decoded_chars": 2948250,
107
+ "decode_roundtrip_rows": 26,
108
+ "decode_roundtrip_failures": [],
109
+ "tokenizer": "Qwen/Qwen3.8-27B tokenizer.json / vocab.json / merges.txt (tokenizer files only)",
110
+ "token_arrays_identical_to_raw": true
111
+ },
112
+ "raw_inputs": {
113
+ "raw/stage1/train_s1v2_swift.jsonl": {
114
+ "sha256": "c7149ea7f697d43bd364cbe7911deba30167d419ae003748e57ae1fa3d405320",
115
+ "expected": "c7149ea7f697d43bd364cbe7911deba30167d419ae003748e57ae1fa3d405320",
116
+ "match": true
117
+ },
118
+ "raw/stage2/train_a1_medium.jsonl": {
119
+ "sha256": "4c81029b48c55bd1ef3e78fc47fea29ee25ef1651427c8ee50c91933b9a2a165",
120
+ "expected": "4c81029b48c55bd1ef3e78fc47fea29ee25ef1651427c8ee50c91933b9a2a165",
121
+ "match": true
122
+ },
123
+ "raw/stage3/FINAL_SELECTED_MANIFEST.json": {
124
+ "sha256": "bf9c4c6e584d4364b76fc7eac013c380a43bc47416de143f9eaaca5d06582bae",
125
+ "expected": "bf9c4c6e584d4364b76fc7eac013c380a43bc47416de143f9eaaca5d06582bae",
126
+ "match": true
127
+ }
128
+ },
129
+ "test40_disjointness": {
130
+ "split_csv": "retrace-release-20261118/.../posttraining-test40-v1/split/test40_targets.csv",
131
+ "test40_targets": 40,
132
+ "role_counts": {
133
+ "train_stage2": 130,
134
+ "dev": 20,
135
+ "test40_eval": 40
136
+ },
137
+ "method": "RDKit canonical SMILES membership, stage-1 products and stage-2/3 targets",
138
+ "stage1_rows_checked": 819,
139
+ "stage1_matches": 0,
140
+ "stage2_rows_checked": 167,
141
+ "stage2_matches": 0,
142
+ "stage3_rows_checked": 26,
143
+ "stage3_matches": 0,
144
+ "status": "PASS (zero overlap)"
145
+ },
146
+ "load_dataset": {
147
+ "stage1_critique": {
148
+ "rows": 819,
149
+ "columns": [
150
+ "messages",
151
+ "chat_template_kwargs",
152
+ "id",
153
+ "source",
154
+ "screen_verdict"
155
+ ]
156
+ },
157
+ "stage2_teacher_trajectories": {
158
+ "rows": 167,
159
+ "columns": [
160
+ "messages",
161
+ "tools",
162
+ "chat_template_kwargs",
163
+ "id",
164
+ "target_index",
165
+ "replicate"
166
+ ]
167
+ },
168
+ "stage3_self_refinement": {
169
+ "rows": 26,
170
+ "columns": [
171
+ "id",
172
+ "uid",
173
+ "source_key",
174
+ "target_index",
175
+ "replicate",
176
+ "n_tokens",
177
+ "n_loss_tokens",
178
+ "text",
179
+ "input_ids",
180
+ "labels",
181
+ "selected_mask",
182
+ "eligible_mask"
183
+ ]
184
+ }
185
+ },
186
+ "stage3_parquet_roundtrip": true,
187
+ "stage3_features": {
188
+ "id": "Value('string')",
189
+ "uid": "Value('string')",
190
+ "source_key": "Value('string')",
191
+ "target_index": "Value('int64')",
192
+ "replicate": "Value('int64')",
193
+ "n_tokens": "Value('int64')",
194
+ "n_loss_tokens": "Value('int64')",
195
+ "text": "Value('string')",
196
+ "input_ids": "List(Value('int64'))",
197
+ "labels": "List(Value('int64'))",
198
+ "selected_mask": "List(Value('int64'))",
199
+ "eligible_mask": "List(Value('int64'))"
200
+ },
201
+ "sanitization_report": "../SANITIZATION.md",
202
+ "files_note": "own sha256 of STATS.json is recorded in MANIFEST.sha256"
203
+ }
stage1_critique/train.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
stage2_teacher_trajectories/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:daea5e9de33b11148b7d7d5fa6956060d92c979acbe9aecde902b03d5248227b
3
+ size 32190438
stage3_self_refinement/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:989dd9da3675883e0db2048ab90e71fcdeb9dafbe54d88bf35ec7976b14f9f06
3
+ size 21908248