--- license: cc-by-4.0 base_model: weidawang/Chem-R-8B tags: - chemistry - chain-of-thought - reasoning-faithfulness - grpo library_name: transformers --- # Chem-R-Faithful Chem-R-8B continued with GRPO under a **verification-grounded process reward**: the accuracy term is paid only when the reasoning trace is clean, i.e. when every functional-group claim it makes is supported by the input, the predicted molecule, or the reference. The point is not accuracy. An answer-level reward cannot distinguish a correct answer reached through a faithful trace from the same answer reached through a fabricating one, because the reward does not depend on the trace at all. Gating it on a structural check of the trace makes those two cases score differently. ## What it changes Measured over twelve generative task variants (ChEBI-20 caption↔molecule, USPTO-50k retrosynthesis, nine S²-Bench subtasks), against the Chem-R checkpoint it was trained from. All four rows below are **unweighted means over the twelve task variants** (each variant has weight 1/12), calculated from the per-task values in sheet `Diagnosis_model_task` of the repository's [Source Data](https://github.com/phenixace/MolReHallu/blob/0c951962d69f79c92b759b52c28d0144f6cb3ab3/data/source_data.xlsx). This uses the same task-averaging convention as the paper's Fig. 1d and its mean ER across tasks; the task sizes do not determine their weights in this table. Specifically, task performance, mean ER and clean-trace rate average the `perf`, `ER` and `pct_er0` columns, respectively. Per-claim fabrication rate averages `100 - cp` over tasks, where `cp` is the percentage of verified claims among verified plus fabricated specific functional-group claims within each task; the six generic group names excluded by the evaluation code are excluded from both counts. These are means of per-task claim rates, not a single claim rate pooled across tasks. | | Chem-R | Chem-R-Faithful | |---|---|---| | per-claim fabrication rate | 22.56% | **4.35%** | | mean ER (fabrication score, 0–100) | 10.63 | **2.39** | | clean-trace rate (ER = 0) | 45.45% | **87.58%** | | task performance (0–100) | 58.91 | **61.48** | Values here are shown to two decimal places. Rounded directly from the underlying values to the paper's display precision, performance is 59 / 61 (Fig. 1d), and Chem-R-Faithful has mean ER 2.4 and per-claim fabrication rate 4.3%. **Aggregation update:** Earlier versions of this card took performance, mean ER and clean-trace rate from `R1_stage_ladder`, which weights these metrics by the number of responses (16,107 per model: 3,300 for each ChEBI-20 task, 5,007 for retrosynthesis and 500 for each of the nine S²-Bench subtasks). Those response-weighted summaries gave performance 50.09 / 51.45 and Chem-R-Faithful mean ER 1.73. The table above now uses equal task weights to align with the paper; the model checkpoints, evaluation records and per-task results are unchanged. Per-claim fabrication rate was already task-averaged and is unchanged. Fabrication drops roughly five-fold and the clean-trace rate nearly doubles, with task performance slightly up rather than traded away. ## Usage ```python from transformers import AutoModelForCausalLM, AutoTokenizer m = AutoModelForCausalLM.from_pretrained("phenixace/Chem-R-Faithful", torch_dtype="bfloat16") t = AutoTokenizer.from_pretrained("phenixace/Chem-R-Faithful") ``` It answers in `……` form. The answer span is what should be parsed; the trace span is what the detector audits. ## Training GRPO, 936 steps on 4×H200 (~26.6 h). Reward `0.1·format + 0.4·accuracy + 0.4·(1 − hallucination) + 0.2·grounded`, with the accuracy term gated on ER = 0. Config, launcher, the exact training parquets, and the EasyR1/verl patch the per-task reward dispatch requires are in the code repository. ## Code, data, and the detector https://github.com/phenixace/MolReHallu — the structural claim detector, the evaluation pipeline, the released model responses and per-claim diagnosis records, and the training recipe. The detector and the reward gate can both be exercised on a CPU in under a minute. ## Limitations The verifier decides functional groups, ring systems and molecular classes from the molecular graph. It does not certify a complete chemical argument, and ER is a fabrication rate over the explicit, structurally decidable claims it recovers rather than a recall-complete audit of the reasoning. Fabrication is reduced, not eliminated. ## License CC BY 4.0. Derived from `weidawang/Chem-R-8B`, which remains subject to its own license.