Retrosynthesis models are neural networks that propose which starting materials and reactions could produce a target molecule. They are trained on millions of patent reactions, are expensive to build, and can be copied: an adversary can query a licensed model and train a cheaper copy on its answers, a process called distillation. No mechanism exists today to prove that a copied chemistry planner came from a particular licensee. The obvious import from vision and text, trigger-set watermarks, does not transfer. These watermarks teach the model a secret response to secret inputs. In chemistry the secret response would be a deliberately wrong reaction, and wrong reactions can be dangerous to the people who run them. Trigger sets also fail under adaptive attacks in other domains.
This note proposes a different carrier and a code designed for it. The carrier is the model's preference among chemically valid alternatives. Retrosynthesis has many correct answers: human review of RetroXpert found that 90% of its "wrong" Top-1 predictions were valid alternative routes. A licensee-specific fingerprint can be written into which valid alternative the model ranks first, with a different direction of preference in each of $n$ "slots" of chemistry. Slots are defined by reaction class and product hash. The code is the second ingredient. An attacker who distills only the chemistry they care about, for example heterocycle formation, erases a contiguous block of slots. This is a burst, not scattered noise. Cyclic codes, built by choosing the roots of a generator polynomial, are the code family that provably recovers any contiguous burst of up to $n-k$ erased slots. Choosing those roots well also fixes the minimum distance needed against scattered flips. The claim is that the burst structure created by domain-restricted distillation should drive the choice of code, and that algebraic root selection beats the long-block LDPC and pseudorandom codes used by current watermarks in this short-length regime.
Core Claim
The fingerprint is a codeword $c \in \{0,1\}^n$ of a binary cyclic code. A cyclic code is a set of binary strings closed under cyclic rotation. Each codeword is a polynomial multiple of a generator $g(x)$ in the ring $\mathbb{F}_2[x]/(x^n-1)$, and the code is fully determined by which $n$-th roots of unity are roots of $g(x)$. Two properties make it fit this problem.
First, any $k$ cyclically consecutive positions of an $[n,k]$ cyclic code determine the whole codeword. So any erased burst of length at most $n-k$ is recoverable, provided chemically related slots are laid out contiguously on the cycle. The same algebra is why CRC hardware detects bursts, and why including the root $1$ (a factor $x+1$) forces even parity and catches any odd number of flips, as noted in Comparative Analysis of Hardware-Based CRC Implementations Using LFSR Designs.
Second, choosing the defining set as a union of cyclotomic cosets (groups of roots that must be included together) gives a guaranteed minimum distance through the BCH bound. This is the construction Cyclic and Negacyclic Codes With Optimal and Best Known Minimum Distances uses to reach optimal binary families, for example $T=C_0\cup C_1\cup C_3$ at $d=6$.
The design question is therefore a trade-off between burst length and scattered-error distance at fixed $n$ and licensee count $2^k$. That trade-off is set entirely by the root set.
Verification works as follows. The verifier queries the suspect model with held-out products in each slot. It measures whether the model prefers the "0" or "1" alternative, and records an erasure when there are too few queries or the preference margin is too small. It then decodes and names the licensee, or rejects. The decision rule is: accept licensee $j$ only if
$$\Pr\big[\text{an independent model's soft slot readout lies within distance } \tau \text{ of } c_j\big] \le \alpha,$$
where $\tau$ is the decoding radius and $\alpha$ the target false-accusation rate. The probability is estimated empirically from models trained without any watermark.
Relation to Prior Work
Three papers motivate the use of codes. They show that error-correcting structure is what lets watermarks survive degradation.
Watermarking Language Models with Error Correcting Codes encodes sliding-window messages with LDPC codes and samples tokens through a distortion-preserving correlated channel. An Undetectable Watermark for Generative Image Models writes pseudorandom codes into the signs of diffusion latents and survives ten image attacks. NSmark uses null-space invariance with spread-spectrum multi-bit marks. All three use generic or long-block codes against roughly i.i.d. noise. We target short codes ($n$ from 63 to 255) against structured burst erasure, which is where algebraic distance guarantees matter. We also borrow the "bias only among outputs the clean model already accepts" principle from the first paper's distortion-free sampling.
Two papers constrain the design.
Evaluating the Robustness of Trigger Set-Based Watermarks Embedded in Deep Neural Networks broke all 11 trigger-set schemes it tested with adaptive attacks. This rules out secret-input/secret-output designs and obliges us to test against an attacker who knows our scheme.
Certified Neural Network Watermarks with Randomized Smoothing certifies watermarks only under $\ell_2$ weight perturbations with white-box access. It reports a 0.1–3.3% accuracy cost. It says nothing about black-box distillation, which is our threat.
Merge-durability work, MergePrint and Making Open-Source Text LLM Watermarks Durable Against Merging, defines a collusion threat that linear codes are not designed for. We treat it as a stress test rather than claim resistance.
One-pot synthesis enters as a safety constraint, not a carrier we optimize. One-pot cascades put several steps in a single vessel and depend on reagents not interfering with each other. Examples are the six-step cascade of Bioinspired Total Synthesis of (+)-Kopsiyunnanine B, the four-component annulation of One-pot double annulations to confer diastereoselective spirooxindolepyrrolothiazoles, and in-situ byproduct reuse in Integrated redox-active reagents for photoinduced regio- and stereoselective fluorocarboborylation. The fragility of these cascades is exactly why a watermark must never push a planner toward a route the clean model would not already propose. A biased reagent choice that is harmless in isolation could become incompatible when a multi-step plan is run in one pot.
Research Program
We build three things.
The first is the carrier. For a trained single-step model (RetroXpert-style and GTA-style), we fine-tune with a small auxiliary loss. Within each slot, the loss swaps the relative order of two candidates that the clean model already places in its top-$k$ within a probability margin. Which of the two goes first is determined by the slot's codeword bit. Candidates outside the clean top-$k$ are never promoted, so the set of proposed reactions is unchanged and only their order among near-ties moves.
The second is the code designer. For each target $n \in \{63, 127, 255\}$ we enumerate unions of cyclotomic cosets as defining sets. For each we compute the guaranteed distance from the BCH bound, the true distance where feasible, and the burst-erasure length $n-k$. We pick the root set that maximizes identification accuracy under a measured attack channel, combining burst lengths and scattered flip rates estimated from pilot distillations. Grassl's best-known-codes tables serve as the reference for whether a chosen $[n,k,d]$ is near-optimal.
The third is the slot layout. Slots are ordered on the cycle by reaction class (USPTO-50k has ten classes) and by chemical similarity within a class, so that domain-restricted distillation produces contiguous erasures.
As an exploratory extension, we test the same carrier on multi-step plans, where the binary choice is between two valid orderings of a route. Every candidate is filtered so that no watermarked choice changes reagent co-presence relative to the clean plan. This keeps the one-pot compatibility risk at zero by construction.
Baselines
The naive reference point is the unwatermarked model. It fixes the accuracy we must preserve and gives the null distribution of slot readouts that sets the false-accusation rate. For context, the file reports Top-1 of 70.4% (class known) and 65.5% (unknown) on USPTO-50k for RetroXpert. It reports 51.1% Top-1 and 81.6% Top-10 on USPTO-50k, and 46.0% and 70.0% on USPTO-full, for GTA. Our target is a Top-1 and Top-10 drop of at most 0.5 points against our own reproduced clean numbers, which rules out promoting chemically wrong answers.
The strongest existing coded method is the LDPC approach of Watermarking Language Models with Error Correcting Codes. It reports an 80.4% detection rate at 150 tokens, against 30.5% for EXP-Edit and 85.8% for KGW with δ=2. That result is in text, and no reported result was found on Lacuna for watermarking or fingerprinting retrosynthesis models. We port it fairly. It uses the same carrier, the same slots, the same query budget and the same fine-tuning budget, with an LDPC code of matching $[n,k]$ tuned with an equal hyperparameter search. We also run the pseudorandom-code construction of An Undetectable Watermark for Generative Image Models at matching rate.
The zero-bit statistical baseline biases every slot the same way and runs a one-sided hypothesis test. It is the strongest competitor for plain ownership claims, and we report it there.
The classic model watermark is a trigger set of secret products mapped to secret reactant outputs, evaluated with the adaptive attacks in wm-eval-zoo.
The ablation that isolates the key ingredient keeps everything fixed and varies only the code. It compares three conditions:
- Designed cyclic. Root sets chosen by our designer.
- Random cyclic. Root sets drawn at random with the same $n$ and $k$.
- Interleaved random linear. A random linear code of the same $[n,k]$, interleaved across the cycle, which is the textbook way to buy burst tolerance without algebra.
The method beats the competitors if, at a false-accusation rate of $10^{-3}$, it identifies the correct licensee at a higher rate than LDPC and interleaved random codes under domain-restricted distillation. The margin must be at least 10 points at matched query budget, with no worse clean accuracy.
Why not just…?
Why not just use a zero-bit statistical test with no code at all? For proving that some copy of our model exists, this is probably as good as anything, and we expect it to win or tie on that task. It cannot say which licensee leaked. The proposal stands or falls on the multi-bit identification experiment. If a licensee registry is not needed in practice, the zero-bit test is the right tool and the code is unnecessary. We will report that outcome honestly.
Why not just use LDPC or a random code with interleaving? This is the real threat. Interleaving gives random codes burst tolerance on average. LDPC decoding is strong at long lengths but weak at $n \le 255$, where guaranteed distance matters most. The cyclic guarantee is worst-case: every burst of length up to $n-k$ is recovered. The ablation measures whether that worst-case edge shows up under realistic distillation. If interleaved random codes match designed cyclic codes, the contribution reduces to the carrier and the slot layout, and we would say so.
Why not just embed backdoor reactions as a trigger set? In other domains every trigger-set scheme tested fell to adaptive attacks (Evaluating the Robustness of Trigger Set-Based Watermarks). In chemistry the secret output is a wrong reaction a chemist might run. We include the trigger set as a baseline under the same attacks to measure both failures directly.
Why not just certify with randomized smoothing? The certificate of Certified Neural Network Watermarks with Randomized Smoothing needs white-box weights and covers only $\ell_2$ weight moves. A distilled copy shares no weights with the original, so the certificate does not apply to the threat we care about.
Proposed Experiments
We train on USPTO-50k and USPTO-full with ten licensee fingerprints per model. Attackers distill students from the watermarked teacher's top-ranked outputs under four regimes. In the full-domain regime the attacker queries products from all classes. In the domain-restricted regime the attacker queries one to three reaction classes, which produces bursts. The remaining two regimes apply fine-tuning or pruning after distillation. The adaptive regime assumes the attacker knows the scheme and re-ranks near-ties at random. We also run a merge regime that averages two licensees' students, as a collusion stress test.
The metrics are clean Top-1 and Top-10 accuracy, licensee identification accuracy, false-accusation rate on 20 independently trained clean models, and verifier queries per slot needed to reach a given identification accuracy.
Three checks decide whether the idea works. First, in the domain-restricted regime, designed cyclic codes must beat interleaved random and LDPC codes at matched $[n,k]$. Second, identification under bursts must track the predicted $n-k$ erasure threshold rather than degrade smoothly. That would show the algebraic guarantee is doing the work. Third, the adaptive re-ranking attack must cost the attacker measurable Top-1 accuracy before it erases the fingerprint. If the attacker can scrub near-tie preferences for free, the carrier fails regardless of the code, and the project should be judged on that result.
References
- RetroXpert: Decompose Retrosynthesis Prediction Like A Chemist
- Comparative Analysis of Hardware-Based CRC Implementations Using LFSR Designs
- Cyclic and Negacyclic Codes With Optimal and Best Known Minimum Distances
- Watermarking Language Models with Error Correcting Codes
- An Undetectable Watermark for Generative Image Models
- NSmark: Null Space Based Black-box Watermarking Defense Framework for Language Models
- Evaluating the Robustness of Trigger Set-Based Watermarks Embedded in Deep Neural Networks
- Certified Neural Network Watermarks with Randomized Smoothing
- MergePrint: Merge-Resistant Fingerprints for Robust Black-box Ownership Verification of Large Language Models
- Making Open-Source Text LLM Watermarks Durable Against Merging
- Bioinspired Total Synthesis of (+)-Kopsiyunnanine B
- One-pot double annulations to confer diastereoselective spirooxindolepyrrolothiazoles
- Integrated redox-active reagents for photoinduced regio- and stereoselective fluorocarboborylation
- GTA: Graph Truncated Attention for Retrosynthesis