ReTRACE-train-data / README.md
jxtse's picture
Dataset card: add paper, code and model links and citation
086e4d1 verified
|
Raw History Blame Contribute Delete
8.24 kB
metadata
license: other
license_name: retrace-research-data
pretty_name: ReTRACE post-training curriculum
task_categories:
  - text-generation
tags:
  - chemistry
  - retrosynthesis
  - agents
  - tool-use
configs:
  - config_name: stage1_critique
    data_files:
      - split: train
        path: stage1_critique/train.jsonl
  - config_name: stage2_teacher_trajectories
    data_files:
      - split: train
        path: stage2_teacher_trajectories/train.jsonl
  - config_name: stage3_self_refinement
    data_files:
      - split: train
        path: stage3_self_refinement/train.jsonl

ReTRACE post-training curriculum

Paper: arXiv:2610.24744 · Code: github.com/jxtse/retrace · Model: jxtse/ReTRACE-27B-latest

Training data for ReTRACE, a retrosynthesis planning agent. The dataset is the three-stage post-training curriculum of the released checkpoint jxtse/ReTRACE-27B-latest (tag s3-v1), a LoRA adapter set trained on Qwen/Qwen3.8-27B.

Each subset is one stage of the curriculum and is a separate config, so you can load them independently and train them in order:

from datasets import load_dataset
s1 = load_dataset("jxtse/ReTRACE-train-data", "stage1_critique", split="train")        # 819 rows
s2 = load_dataset("jxtse/ReTRACE-train-data", "stage2_teacher_trajectories", split="train")  # 167 rows
s3 = load_dataset("jxtse/ReTRACE-train-data", "stage3_self_refinement", split="train")  # 26 rows

What the three stages are

Stage 1 — reference-guided critique (819 rows, 804 distinct questions). The model is shown a product SMILES and a few single-step precursor proposals and must screen them (keep / reject) with reasoning. Each row is user → assistant, where the assistant turn is <think> reasoning followed by the answer. The training text is the student-visible form only: the reference explanation that guided generation is not part of any row. 788 rows are reference-conditioned self-distillation of the base model, 31 are rejection sampling from the base model that passed the answer-accuracy gates. Reactions behind the questions are USPTO patent reactions. screen_verdict is the audit grade of the row (pass, minor) — not the model's own keep/reject labels.

Stage 2 — teacher agent trajectories (167 rows, 71 targets). Full tool-use trajectories of the ReTRACE agent harness on Retro*-190 training targets, generated by a teacher LLM (GPT-6 Astra) and admitted only when the final route was audited VALID. Turn-level loss masks are applied: 5,537 of 6,513 assistant turns are supervised and 976 are not. Tool results are never supervised. No teacher reasoning text is present in the rows (the teacher's thinking was not exported), so what is supervised is the model's own tool calls and short natural-language turns. The same 167 rows were also used for the teacher-SFT arm reported in the paper. 9 tool schemas are in the tools field.

Stage 3 — self-refinement (26 rows, 22 targets). The stage-2 student's own trajectories on training targets, admitted by the route audit and then masked at turn level. These rows ship as authoritative token arrays, exactly as trained: 1,094,003 total tokens, of which 49,040 are selected for loss (332,573 tokens were turn-level eligible). labels is -100 on every non-selected position, i.e. labels != -100 is exactly the selected_mask. A decoded text copy is provided for readability; the token arrays, not the text, are the training truth.

Order of use: stage 1 → stage 2 → stage 3, each continuing from the previous adapter.

Fields

Common: id (row identifier).

stage1_critique

  • messages — ms-swift conversation: user (product + numbered candidates + screening instruction), assistant (<think> reasoning + verdicts). Text is byte-identical to the text that was trained.
  • chat_template_kwargs — {"enable_thinking": true, "preserve_thinking": true, "reasoning_effort": "medium"}.
  • source — self_distillation or rejection_sampling.
  • screen_verdict — pass or minor (audit grade).

stage2_teacher_trajectories

  • messages — system / user / assistant / tool turns; assistant turns carry loss: true|false and tool_calls; tool turns carry tool_call_id.
  • tools — 9 function schemas.
  • chat_template_kwargs — {"enable_thinking": true, "reasoning_effort": "medium"}.
  • target_index — index of the Retro*-190 target in the 130/20/40 split (all rows are train_stage2 targets).
  • replicate — 1-based replicate index of that trajectory within its target, by file order (derived; the source export has no explicit replicate id).

stage3_self_refinement

  • input_ids, labels, selected_mask, eligible_mask — token arrays exactly as trained (do not re-tokenize).
  • 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.
  • n_tokens, n_loss_tokens — counts of input_ids and of labels != -100.
  • target_index, replicate, uid — provenance of the row in the export.

Training

Load with ms-swift. Data-format details and the exact per-stage commands (including the turn-level masking and the pretokenized stage-3 loader) are in the posttraining/ directory of https://github.com/jxtse/retrace. Stage 1 and 2 are plain messages JSONL with chat_template_kwargs; stage 3 is already tokenized and should be consumed as pretokenized rows (input_ids / labels), not re-rendered through a chat template.

Sanitization

Two stage-2 tool results contained an internal serving URL with a local port; the URL was replaced with a neutral placeholder in the tool result (never in supervised text). No hostnames, private IP addresses, absolute file paths, credentials or personal identifiers remain in any released text, and the stage-3 token arrays were not modified. Internal stock/pricing service labels (Zinc_Fix-stock, BioNav-stock, ChemPrice) do occur in tool output and in some supervised turns; they are database availability labels, not vendor catalogue entries or prices, and were left as-is so the supervised signal is not altered.

Provenance and rights

  • Stage 1 reactions are derived from USPTO patent reactions (public-domain US patents via the commonly used USPTO extraction). Assistant reasoning text was generated by the base model (Qwen3.8-27B) in the authors' pipeline; screen_verdict is the authors' screening grade.
  • Stage 2 assistant turns were generated by a third-party LLM (GPT-6 Astra) and selected using LLM-judge verdicts from the Claude Opus family. Their providers' terms continue to apply to that generated content; it is shared here for non-commercial research reproducibility, not as a grant of rights the authors do not hold.
  • Stages 2 and 3 targets are from Retro*-190 (Chen et al., 2020, MIT). Please follow the original dataset's terms when reusing those targets.
  • Dataset compilation and annotations by the authors are released for non-commercial research use; see LICENSE.md. No warranty is given.

Evaluation hygiene

No target from the 40 held-out evaluation targets (Test40) is included. Every stage-1 product (819/819) and every stage-2 and stage-3 target (167/167 and 26/26) was compared against the 40 test40_eval targets of the 130/20/40 Retro*-190 split after RDKit canonicalization: zero matches, by canonical SMILES and by raw string.

Not included

Model outputs on evaluation sets, audit verdict prose, raw conversation transcripts beyond the training rows above, and internal file paths are deliberately excluded.

Citation

@misc{xie2026retrace,
  title         = {ReTRACE: Feedback-Guided LLM Agent in a Chemistry Harness for Retrosynthesis Planning},
  author        = {Jinxiang Xie and Yijian Zhang and Qingyuan Yi and Jianyi Wang and Hao Dong},
  year          = {2026},
  eprint        = {2610.24744},
  archivePrefix = {arXiv},
  primaryClass  = {cs.AI},
  url           = {https://arxiv.org/abs/2610.24744}
}