WorksComputer Science
TextSeal2: Distortion-Free LLM Watermarking with Copula Mixing and Memoryless Races
Abstract
We present TextSeal2, a distortion-free watermark for large language models that keeps its signal under speculative decoding: tokens that replace rejected drafts remain watermarked with the same keys, and the acceptance rate is unchanged. It also preserves output diversity and adds no measurable inference latency. Its predecessor, TextSeal, restores diversity in the Gumbel-max scheme by routing each token to one of two keys via a coin flip. This is suboptimal because the detector averages the scores from both keys without knowing which key was used. TextSeal2 instead merges two or more keys into a single virtual key and couples it to fresh noise through AutoMark's Gaussian copula. Any number of keys, including publicly shared keys, can be merged this way without diluting detection. Under speculative decoding, TextSeal2 verifies keyed drafts with one more exponential race, run on the leftovers of the draft races. By memorylessness, this race reproduces block verification, so the output follows the target model exactly. We evaluate TextSeal2 on three LLMs. At equal output token diversity, TextSeal2 detects 8 to 22 percentage points more 100-token answers than TextSeal at a false-positive rate of , and is comparable to textGrain while requiring no post-logits optimization. Under speculative decoding, it detects 18 and 22 percentage points more 200-token answers than TextSeal and textGrain, respectively, at the same acceptance rate.
Introduction
Identifying AI-generated text helps prevent misuse, from fabricated news ([34, 5]) to model distillation by malicious actors ([28]). An LLM watermark embeds a keyed statistical signal at generation time: each token is sampled from the model’s next-token distribution through a coupling with pseudo-random values derived from a secret key and the preceding tokens. The detector recomputes these values from the key and the text and tests whether the tokens are statistically aligned with them. The EU AI Act requires providers to mark AI-generated content ([8]), and watermarking is deployed at scale: SynthID-Text runs in Gemini ([7]), Anthropic marks Claude outputs ([2]), OpenAI deploys textGrain ([24]), and we released TextSeal ([29]).
We argue that a deployed watermark should meet four requirements: it should (i) preserve the model’s output distribution; (ii) keep answers diverse under a fixed watermark key; (iii) add minimal latency to decoding; and (iv) preserve the acceptance rate of speculative decoding ([20, 3, 30]). Schemes whose next-token distribution, averaged over all possible keys, equals the model’s are called distortion-free. The earliest such scheme applies the Gumbel-max trick to keyed pseudo-random values ([1]); later ones achieve the same property with other samplers ([4, 16, 32, 19]). Distortionary schemes such as the green list ([17]) instead shift token probabilities, trading quality for detectability; we focus on distortion-free schemes.
Every distortion-free watermark couples the sampled token to key-derived randomness ([23, 33, 26, 31, 13, 12]). If the key fully determines the token, detection is strongest but repeated generations with the same context never vary; if the token is independent of the key, sampling is unchanged but carries no signal. Put differently, watermarking removes a fraction of each token’s entropy, which is the budget formulation of textGrain ([24]). Schemes differ in how they trade diversity against detectability. TextSeal routes each token to one of two keys by a coin flip ([29]); textGrain samples from a regularized optimal-transport coupling solved at every decoding step ([24]); SynthID-Text selects among randomly sampled candidates by tournament ([7]); and AutoMark blends its Gumbel values with freshly drawn noise through a Gaussian copula ([12]). Other couplings rely on reweighting ([16, 32]), inverse-transform sampling ([19]), or maximal couplings ([33, 26, 31]). Dual-key constructions such as TextSeal also support tampering detection ([9]) and public detection, with one key public and the other private ([27]). Among these, textGrain detects the most watermarked text at a given diversity, but its optimal transport adds post-logits latency and its speculative variant lowers acceptance, violating our requirements and presented above.
We present TextSeal2, which retains TextSeal’s two keys, meets all four requirements, and matches the state of the art in detectability. Our starting point is a diagnosis of the gap between TextSeal, textGrain, and AutoMark. In TextSeal, each token is generated under one key, but the detector does not know which key, and must average the scores from both keys. This halves the signal and reduces the signal-to-noise ratio by . AutoMark and textGrain do not suffer from this loss because they use a single key, which the detector scores on every token, and draw their diversity from fresh randomness.
TextSeal2 makes three contributions to reach the state of the art (Table 1, Figure 1):
| Method | Speculative decoding | Acceptance kept | Extra post-logits work | |
| SynthID-Text (tournament) | ||||
| TextSeal (coin flip) | none | |||
| AutoMark copula | none | |||
| textGrain | Sinkhorn, | |||
| textGrain, own speculative-decoding recipe | ( tokens/round) | Sinkhorn, | ||
| TextSeal2 (ours) | none |
Table 1. Detection on Qwen3.5-9B (ELI5, temperature 1, top-p 0.95), at fixed diversity: % of 200-token answers detected at a false-positive rate (FPR) of . Gray: half-width of the 95% bootstrap interval; bold: best; underlined: second best, per column. Speculative decoding: Qwen3.5-0.8B drafts 8 tokens per round, with block verification; TextSeal2 uses the residual race, the baselines use block verification’s native stopping rule with the last token of each round drawn under an independent key, and textGrain’s own recipe verifies the watermarked distributions. Acceptance is kept when tokens per round do not drop below those of unwatermarked block verification (2.74; paired over 480 prompts, Figure 11 in Appendix § 13). : Sinkhorn iterations on a table (1–3 ms per token, Appendix § 9); : tournament layers over candidates . TextSeal2 equals AutoMark’s copula in distribution; their gap under speculative decoding is the residual race.
Figure 1. Diversity–detection trade-off on Qwen3.5-9B at 100 tokens at FPR=, (a) without and (b) with speculative decoding (8 drafts per round, block verification). In (a), TextSeal2 coincides with AutoMark’s single-key copula as expected since it behaves like a single-key copula. In (b), TextSeal2 uses the residual race, and the baselines use block verification’s native stopping rule with the last token of each round drawn under an independent key. Diversity is measured by Self-BLEU (lower is more diverse).
Copula mixing (subsection 3.1). We merge the two keys’ Gaussian values into a single virtual key and apply AutoMark’s copula on it. Each key retains its role (e.g., one can be published to allow for public detection), and additional keys can be merged without diluting detection.
The residual race for speculative decoding (subsection 3.2). Gumbel-max sampling, used for the keyed drafts, is an exponential race. By memorylessness, the losers’ leftovers are fresh exponentials. We use this property to run one more race on them, and with block verification (Sun et al., [30]), we decide the first draft token to be rejected, and the bonus token. The output is exactly distortion-free, acceptance is that of block verification (Proposition 1), and detection gains 28 to 33 percentage points over drawing the last token of each round under an independent key.
A calibrated strength parameter (subsection 3.3). The coupling strength plays the role of textGrain’s entropy budget : the entropy it removes from a token of positive entropy increases strictly with (Theorem 1). No distortion-free scheme can obtain more detection evidence per token than the entropy it removes, and the copula comes close to this bound (Proposition 3).
Background & Related work
Gumbel-max watermarking (Aaronson and Kirchner, [1]). At step , the model outputs a distribution over the vocabulary , after temperature scaling and top- truncation (we drop the superscript when no confusion arises). A pseudo-random function (PRF) seeded by the secret key and the watermark context window – the last tokens – assigns to each candidate token a value , and the watermarked sampler emits:
The right-hand form is an exponential race: if the are i.i.d. uniform, then the are i.i.d. , each is , and the arg min is distributed exactly according to . In this race, candidate runs a lane of length at speed , and the first to finish is emitted (Figure 2). For detection, each observed token receives the score , where is recomputed from the key and the token’s window. Under the null hypothesis (unwatermarked text, or the wrong key), the scores are and their sum follows a Gamma distribution, giving a simple sum test; watermarked text, whose tokens tend to win their races with unusually large , produces stochastically larger scores.
Figure 2. TextSeal2 generates one token (subsection 3.1). (a) The model’s forward pass gives the probabilities , and the last tokens form the window . (b) The keys’ values at are merged into the virtual key , which the copula (4) blends with the noise into ; the Gumbel-max choice is . (c) The Gumbel-max choice can be seen as a race (1): candidate runs a lane of length at speed , and the token that finishes first is chosen.
Repeated windows. A sampler is single-token distortion-free if, in expectation over the key, every token retains its model probability given the prefix (Dhathatri et al., 2024). It is single-sequence distortion-free if the distribution of the entire answer is likewise preserved. Windows repeat often in code and long reasoning traces. Reusing a window’s keyed values re-runs the same race, so the text is single-token but not single-sequence distortion-free. Repeated context masking draws fresh values at the later occurrences of a window, i.e. plain sampling there (Dhathatri et al., 2024). AutoMark’s ResidualRace instead continues the window’s race from its leftovers (Gloaguen et al., [12]). Both make the text single-sequence distortion-free (Appendix § 6.§ 5). At detection, each (window, token) pair is scored once, to avoid biasing the detection test (Fernandez et al., [10]).
TextSeal Sander et al., [29]. Plain Gumbel-max is deterministic given the key, so TextSeal randomises the race (1) with two keys and , producing values and : at each step it uses with probability and with probability . The detector does not know which key generated a given token, so it fuses the two per-key scores, with . Optionally, each score is weighted by the entropy of the next-token distribution under an auxiliary language model: low-entropy tokens are nearly forced by the context and carry little watermark signal, so down-weighting them improves detection; the weighted sum is then tested against a Gamma distribution with matched mean and variance. The two keys also serve speculative decoding and public detection. Under speculative decoding, TextSeal routes each draft to one of its two keys as usual and generates a replacement token with the other key. For public detection, is published so anyone can run a weaker test, while stays secret for full verification Milis et al., [27].
Gaussian copula. AutoMark Gloaguen et al., [12] randomises differently: it draws independent noise at every position and replaces by
where is the standard normal CDF. The parameter interpolates between unwatermarked sampling (, no dependence on the key) and plain Gumbel-max (, deterministic given the key), while remains uniform – hence the race distortion-free – for every .
textGrain Li et al., [24]. At each decoding step, it uses the key and the window to partition the vocabulary into blocks and to draw a table of keyed Gumbel costs. Sinkhorn iterations then solve an entropy-regularised optimal-transport problem between the block probabilities and columns, calibrated so that the key removes a prescribed fraction of the token’s entropy; a keyed column is selected, and the block and token are sampled from the resulting coupling with freshly drawn randomness. Only the key-only computations can overlap the model’s forward pass: the Sinkhorn iterations require the next-token distribution, and the following step requires the sampled token, so this work lies on the critical path of decoding. Better kernels can shorten it but not remove it (1–3 ms per token in our implementation, 0.2–0.4 ms in a minimal version; Appendix § 9).
Speculative decoding. Write for the target model’s distribution and for the (smaller) draft model’s. In each round, the drafter proposes a block of tokens, and the target evaluates the whole block in one forward pass. Token-level verification tests the drafts in order. A draft token is accepted with probability , the raw acceptance test on the unwatermarked distributions and . At the first rejection, the target emits a replacement token from the residual distribution:
and discards the later drafts; if every draft is accepted, it emits a bonus token from its next distribution. The output follows at acceptance rate Leviathan et al., [20]; Chen et al. [3]. Block verification Sun et al., [30] instead decides on all the block jointly, so it can keep a longer prefix even when a shorter one fails its per-token test (closed forms in Appendix § 6.§ 3). Sun et al. [30] prove that repeating such rounds also generates the target’s law, and that after any number of rounds block verification has decoded at least as many tokens in expectation as any other verification procedure with this guarantee, so it is never worse than token-level verification. They report wall-clock speedups of 5–8% over token-level verification across tasks and datasets.
The TextSeal2 watermark
TextSeal2 retains TextSeal’s two keys, Gumbel-max sampling (1), and detector. It changes how the keys enter the sampler (subsection 3.1), how speculative decoding chooses the tokens it emits (subsection 3.2), and how the strength is calibrated (subsection 3.3). It handles repeated windows as in § 2, and under speculative decoding every window raced in a round counts as used, whether or not its position is kept (Appendix § 6.§ 5). Figure 2 shows one generation step, Figure 3 one round of speculative decoding, and Figure 4 the detection of one text; Algorithm 1 is the pseudocode.
Figure 3. Block verification checks the drafts against the target as a block, keeps those before a stop position , and emits one token at . (a) The drafter proposes “the mat” with keyed races. (b) One target pass then gives the probability that and . One more race on the leftovers picks and : “floor” wins, so the round keeps “the” and emits “floor” at . TextSeal2 preserves the target’s distribution and block verification’s acceptance rate (Proposition 1). Algorithm 1 in the appendix gives more details.
Figure 4. TextSeal2 detects the text “The cat sat on the floor and fell asleep in the sun.” (subsection 3.4). (a) Each token and its window ; the highlighted row is the token of Figure 2. (b) For “floor”, the key’s values are merged into as in (4), without the noise, and give the score ; key alone gives the public score . (c) The scores sum to , and the tail beyond (box) is .
Copula mixing of the two keys
For each key , map its values to Gaussian space by , which is standard normal when is uniform. Instead of running the exponential race on or , chosen at random as in TextSeal, TextSeal2 runs the race (1) on the merged values
Since the two keys are independent, is standard normal; it depends only on and is independent across candidate tokens (and across positions whose window has not been used before; see § 2). Equation (4) is therefore exactly AutoMark’s copula (2) applied to a virtual key with values . In particular, the are i.i.d. uniform and the race is distortion-free for every (Lemma 2). Detection uses the matched score – the usual score of the virtual key – which is -distributed under . The two-key scheme thus has exactly the diversity and detection power of AutoMark’s single-key copula at the same . The construction extends to keys: remains a single standard normal per candidate, so the full detector loses no signal as keys are added, e.g. one publishable key per verifier. (Each key’s correlation with the race input, and hence a single-key test’s power, shrinks as .)
Why the coin flip loses signal. With the coin flip at , each token is generated under one key, but the detector does not know which and must score . Only the key that generated the token carries signal, so averaging halves the expected excess of the score over its null mean of 1. The two scores are independent under the null, so averaging also halves the variance – hence the standard deviation falls only by . The signal-to-noise ratio is therefore reduced by a factor . Copula mixing has no such loss: every token is generated from , which the detector scores.
Optional public detection. By default, detection uses both keys through . can be published for anyone to compute single-key scores . This test is weaker: has correlation only with the race input , while supports full-strength
verification and exposes manipulations of the public signal [27]. SAC-Copula [21] and AutoMark’s Gaussian direction mix keyed Gaussians, without a public key.
Speculative decoding through memoryless races
Speculative decoding poses a specific problem for watermarking: the token that verification emits after the kept drafts must follow a residual distribution, such as (3), and must itself carry the watermark. Prior approaches each give up something. Re-running the race with weights on the same keyed values distorts the output, because the draft’s win shifts the remaining values (Remark 1). Replacing from fresh noise [15] or from a second key [29, 7] keeps the acceptance rate, but the replaced tokens, about a third of the text in our experiments, then lose the watermark or split it across keys. Verifying between the watermarked distributions keeps the watermark but accepts fewer drafts [15, 24, 7] (Proposition 2). He et al. [14] let the detector guess which key made each token, and Liu et al. [25] use several drafts per position. TextSeal2 keeps both the keys and the acceptance of block verification, with two races on the same keyed values.
Keyed drafts and their leftovers. A round has drafts at positions and a bonus position , with drafter laws and target laws from one target pass. Position reads the lane lengths from (4) at its window , which ends with for , and the drafter runs the race at its own speeds:
When finishes, lane has covered the distance , and is its leftover. By memorylessness, the leftovers are fresh (proof in Appendix § 6.§ 2):
Lemma 1 (Leftovers of an exponential race; AutoMark). If the are i.i.d. and is a probability vector, the race , with time , emits with probability , and given the leftovers , , are again i.i.d. .
Block verification and the relay race. Given the drafts, block verification (§ 2) stops at a position , keeps , and emits a token at position , with law . Here is a residual law at position , with , and depends on all the drafts, since a
later success can override an earlier failure; Appendix § 6.§ 3 gives both in closed form. TextSeal2 draws this outcome with one more race, on the leftovers of all positions:
with at the bonus position, which has no draft race. Each lane resumes where its draft race left it and runs its leftover at speed , as in a relay (Figure 3), and the round emits without drawing an accept coin. We call (6) the residual race: a single race on the leftovers of the draft races picks the stopping position and the last token together. Kept drafts carry the signal of their draft races and the last token that of the relay, so the detector is unchanged: it sums the scores and does not need to locate the ends of rounds. AutoMark’s ResidualRace continues the race of a repeated window, and exponential races (Li and Anantharam [22]) also couple drafter and target in unwatermarked speculative sampling (Kobus and Gündüz [18]; Daliri et al. [6]); to our knowledge, racing block verification’s outcome on the leftovers of keyed drafts is new.
Proposition 1 (Speculative decoding with the residual race). Suppose that every round reads i.i.d. uniform keyed values at its windows, independent across positions and of earlier rounds, and independent copula noise. (i) Given the drafts, has law , so the number of tokens per round, and hence acceptance, is that of block verification. (ii) The generated text follows the target’s law. (iii) The window rule (Appendix § 6.§ 5) meets this condition: the text is distortion-free over keys.
This proposition says that the residual race preserves the output distribution and the acceptance of block verification. Appendix § 6.§ 4 proves Proposition 1 in three steps: memorylessness makes the leftovers fresh given the drafts, block verification gives each draft’s own lane zero mass (Lemma 3), and Sun et al. [30] turn block verification’s law into the target’s. It also derives the lane length of each emitted token, which is what the detector reads, and shows that racing on the raw lane lengths instead of the leftovers is biased (Remark 1). Appendix § 6.6 proves that no scheme with a single draft accepts more often while keeping the output distribution (Proposition 2), a bound that the residual race attains for , and compares it with the optimality of block verification for . Remark 2 gives a coin-free token-level variant, and Algorithm 1 one round in pseudocode.
Controlling the entropy removed
Under a fixed key, the diversity that remains is exactly the entropy the key does not remove: whatever randomness the independent noise still contributes. textGrain calibrates its strength directly in these terms, removing a prescribed fraction of each token’s entropy (Li et al. [24]). In TextSeal2, the coupling strength plays the same role. For a token of positive entropy, the entropy removed is a strictly increasing function of , from none at to the token’s full entropy at (Theorem 1), so any target budget can be met by a unique , token by token if desired. In practice this calibration is unnecessary: a fixed removes nearly the same fraction of a token’s entropy – , and remove about 30%, 50% and 70% respectively, across a range of many-token distribution shapes (Appendix § 8). We therefore use a single constant throughout, with a per-token available when an exact budget guarantee is required.
Two results in Appendix § 7 indicate that little is lost by this simplicity. First, no distortion-free coupling can extract more detection evidence per token, measured as a Kullback–Leibler divergence, than the entropy it removes (Proposition 3). Second, the copula uses this budget near-optimally: on 5,169 real Qwen3.5-9B next-token distributions, it attains on average 97% of the optimal per-token signal-to-noise ratio in the weak-watermark limit with a Gaussian score, and 91–100% at , and on synthetic distributions. A per-token optimisation such as textGrain’s can therefore gain only a few percent in signal-to-noise ratio, which is consistent with the empirical parity in § 4.
Detection and localization
The detector scores each token at its window, with both keys through the virtual key (private score) or with the public key alone (public score, subsection 3.1):
Both scores are under for every , since they do not involve the coupling strength, so the detection machinery of TextSeal carries over unchanged ([29]). The sampler can also watermark existing text post hoc, by rephrasing it ([11]). Keys with windows of different lengths can be merged into at no cost to the full detector, and because edits break long windows first, the decay of the per-key scores with window length estimates the edit rate (Appendix § 11).
Detection tests. The private test sums the scores of the distinct (window, token) pairs, each at its first occurrence (§ 2, Figure 4):
where is the CDF of ; the public test is the same with . Two optional refinements come from TextSeal ([29]). Entropy weighting down-weights low-entropy tokens, which carry little signal, using the next-token entropy of an auxiliary model:
Under , has mean and variance , and the test compares it with the Gamma law of matched moments, of shape and scale . The weights do not use the key, so the test is valid for any auxiliary model. Localization finds watermarked spans in documents that mix human and generated text: it tests windows of dyadic lengths , slid at half-length offsets, about candidates, Bonferroni-corrected, and greedily extracts the most significant ones.
Experiments
We compare detection at equal diversity, first without and then with speculative decoding (subsection 4.3). Unless stated otherwise, all differences below are in percentage points of detected answers.
Setup
Generation. We generate answers to ELI5 questions with Llama-3.1-8B-Instruct, Qwen3.5-9B, and Qwen3.5-27B, at temperature 1 and top- 0.95, up to 200 new tokens, with watermark window size
Without speculative decoding
. For speculative decoding, Qwen3.5-0.8B drafts tokens per round for Qwen3.5-9B, and every scheme verifies the drafts by block verification [30]; Appendix § 11 repeats the comparison with and . All schemes, TextSeal2 included, follow the repeated-window rules of Appendix § 6.§ 5 (one use per window at generation; each (window, token) pair scored once); under speculative decoding, every window that a round reads counts as used, kept or not.
Metrics. Detection is the fraction of watermarked answers declared watermarked at a nominal false-positive rate of . Because no closed-form null is exact in practice, each detector’s threshold is the empirical quantile of its p-values on 10,000 unwatermarked answers scored under 10 keys ( null p-values; calibration in Figure 9). Detection is measured on the first 100 or 200 tokens, with key-only (unweighted) scores unless stated otherwise. We generate 3000 answers per configuration on Qwen3.5-9B, with or without speculative decoding, and 1000 on the other models. Diversity is measured as in TextSeal, by Self-BLEU among answers to the same question under a fixed key (mean BLEU over all pairs of answers; lower is more diverse), on 100 questions with 32 answers each, or 16 under speculative decoding. Measuring diversity by the share of distinct 4-grams instead leaves the conclusions unchanged, except that textGrain is then slightly ahead of the copulas without speculative decoding (Appendix § 11). To compare at equal diversity, each method’s detection is interpolated along its diversity–detection curve at TextSeal’s Self-BLEU; 95% intervals come from a bootstrap that resamples questions jointly across methods, so intervals for differences are paired.
Figure 9. Calibration: false-positive rate against the nominal p-value threshold for the detectors of Table 1 without speculative decoding, on 10 keys and 10,000 unwatermarked Qwen3.5-9B answers; grey: 95% binomial interval around the diagonal. At and above, every detector is within a factor 1.3 of nominal.
Methods. We evaluate TextSeal with (plus 0.8 and 0.95 on Qwen3.5-9B); AutoMark’s copula and TextSeal2 with (on Qwen3.5-9B also 0.5, 0.6, 0.975, 0.99 and 0.995, plus 0.85, 0.925 and 0.999 under speculative decoding), using a 53-bit PRF (Appendix § 10), with TextSeal2 scored by (or for the public-key test); our reimplementation of textGrain (, ); and, on Qwen3.5-9B, SynthID-Text with 2–30 tournament layers (2–20 under speculative decoding), using its official keyed coins and detection test (fused over its two keys under speculative decoding, Appendix § 13). Under speculative decoding, TextSeal2 uses the residual race (subsection 3.2). The baselines keep block verification’s native stopping rule on the unwatermarked laws and , as TextSeal and SynthID-Text do with token-level verification [29, 7]: each draft comes from the scheme’s sampler on , and the last token of the round from the same sampler under an independent key on the residual law , or from the scheme’s normal step on when it is the bonus token. TextSeal routes drafts and bonus tokens between its two keys as usual and uses the other key for the replacement token; textGrain, SynthID-Text and AutoMark’s copula, which has no speculative mode of its own, use their first key for drafts and bonus tokens and a second key for replacement tokens. TextSeal2 on its own recipe instead runs block verification between the watermarked distributions, as in its report [24].
Without speculative decoding
The copula dominates the coin flip. Interpolated at TextSeal’s Self-BLEU, TextSeal2 detects 10, 22 and 8 percentage points more 100-token answers than the coin flip [29] on Llama-3.1-8B, Qwen3.5-9B and Qwen3.5-27B respectively (paired 95% intervals [+4, +15], [+15, +25] and [+3, +12]; Figure 1a and Figure 7). Against textGrain, TextSeal2 is ahead on Llama-3.1-8B (+11 [+4, +17]), level on Qwen3.5-9B (+1 [−5, +8]), and behind on Qwen3.5-27B (−5 [−10, 0]). AutoMark’s copula, which coincides with TextSeal2 in distribution, stays within 3 points throughout, confirming that the gain over TextSeal comes from removing the coin flip rather than from implementation differences. With the public key alone, TextSeal2 still detects 27% / 67% of 100 / 200-token answers at ; merging four keys detects as much as merging two, so extra keys cost nothing (Appendix § 11).
Figure 7. Diversity (Self-BLEU; lower is more diverse) vs. detection of 100-token answers without speculative decoding, on three models (32 answers to each of 100 questions; copulas with the 53-bit PRF). Interpolated at TextSeal’s Self-BLEU, TextSeal2 gains 10, 22 and 8 percentage points over the coin flip on Llama-3.1-8B, Qwen3.5-9B and Qwen3.5-27B respectively, and AutoMark’s copula overlaps TextSeal2 throughout.
Entropy weighting. TextSeal’s entropy-weighted test improves every method by 4–23 points at 200 tokens, without changing the ranking (Figure 5, Table 6). On Qwen3.5-9B, TextSeal2 detects 78% / 97% of 100 / 200-token answers, against 74% / 97% for textGrain; under speculative decoding, 67% / 95%, against 48% / 87% for TextSeal and 36% / 76% for textGrain (Self-BLEU 18.9–20.1).
Figure 5. Entropy weighting improves detection for every watermark, including under speculative decoding. % of 100-token answers detected at a false-positive rate of with key-only scores (light bars) and with TextSeal’s entropy-weighted test (full bars), at comparable Self-BLEU. The gains are 4–18 percentage points at 100 tokens and 4–23 at 200 tokens (Table 6); without speculative decoding, TextSeal2 and AutoMark’s copula coincide in distribution and differ only within their 95% intervals, as expected.
| Model | Method | Self-BLEU | Key-only | Entropy-weighted |
| Llama-3.1-8B | TextSeal | 23.9 | 53 / 82 | 58 / 91 |
| Llama-3.1-8B | textGrain | 24.1 | 55 / 86 | 67 / 94 |
| Llama-3.1-8B | AutoMark copula | 23.9 | 63 / 90 | 71 / 95 |
| Llama-3.1-8B | TextSeal2 | 23.9 | 64 / 90 | 71 / 95 |
| Qwen3.5-9B | TextSeal | 20.6 | 42 / 82 | 59 / 93 |
| Qwen3.5-9B | textGrain | 20.9 | 65 / 91 | 74 / 97 |
| Qwen3.5-9B | SynthID-Text (10 layers) | 20.9 | 54 / 92 | 72 / 98 |
| Qwen3.5-9B | AutoMark copula | 20.9 | 64 / 93 | 77 / 97 |
| Qwen3.5-9B | TextSeal2 | 20.7 | 63 / 91 | 78 / 97 |
| Qwen3.5-27B | TextSeal | 26.5 | 21 / 53 | 32 / 76 |
| Qwen3.5-27B | textGrain | 27.2 | 37 / 71 | 44 / 84 |
| Qwen3.5-27B | AutoMark copula | 28.2 | 37 / 73 | 48 / 87 |
| Qwen3.5-27B | TextSeal2 | 28.5 | 36 / 71 | 47 / 87 |
| Qwen3.5-9B, spec. dec. | TextSeal | 20.1 | 31 / 71 | 48 / 87 |
| Qwen3.5-9B, spec. dec. | textGrain, second key | 18.9 | 24 / 59 | 36 / 76 |
| Qwen3.5-9B, spec. dec. | textGrain, own recipe* | 20.6 | 59 / 89 | 69 / 96 |
| Qwen3.5-9B, spec. dec. | SynthID-Text (10 layers) | 18.4 | 14 / 41 | 23 / 63 |
| Qwen3.5-9B, spec. dec. | AutoMark copula, second key | 19.0 | 23 / 55 | 36 / 78 |
| Qwen3.5-9B, spec. dec. | TextSeal2, residual race | 19.1 | 55 / 87 | 67 / 95 |
Table 6. Key-only vs. entropy-weighted detection (TextSeal’s weighted Gamma test): % of 100 / 200-token answers detected at a false-positive rate of , with thresholds calibrated per test over 10 keys and 10,000 unwatermarked answers. First 1000 answers per configuration without speculative decoding; last block: all 3000 answers with speculative decoding (8 drafts, block verification). Strengths: (TextSeal), (textGrain), (copulas, 53-bit PRF). For SynthID-Text, the key-only test is its official binomial test and the weighted test is the same Gamma test applied to twice its mean coin score. Self-BLEU over 32 answers to each of 100 questions. Weighting improves every method by 4–23 percentage points at 200 tokens, and the two copulas remain level without speculative decoding, as they must in distribution.
Robustness and cost. Under random word substitutions, TextSeal2 retains more detections than TextSeal and as many as textGrain, while paraphrasing by an LLM removes almost every watermark, as expected for token-level schemes (Table 7). The gains over the coin flip persist at temperature 0.7 (Appendix § 11). TextSeal2’s decoding step is within 0.6% of TextSeal’s once key-only work overlaps the forward pass (Table 5), and its post-logits work is one pass over the vocabulary (Appendix § 9).
| Batch | Plain sampling | TextSeal | TextSeal2 | TextSeal, overlapped | TextSeal2, overlapped |
| 1 | 50.44 | 50.85 | 51.08 | 50.69 | 50.87 |
| 8 | 52.39 | 52.54 | 52.64 | 52.52 | 52.79 |
| 64 | 56.46 | 58.43 | 61.34 | 56.81 | 56.93 |
Table 5. Table 5 Full decoding step (ms, median), Qwen3.5-9B; overlapped: key-only work on a side CUDA stream.
| Method | Clean | 10% subst. | 20% subst. | 30% var. | Paraphr. |
| TextSeal (coin flip, ) | 82 | 46 | 16 | 28 | 3 |
| textGrain () | 91 | 63 | 24 | 48 | 5 |
| AutoMark’s copula () | 92 | 66 | 26 | 48 | 5 |
| TextSeal2 () | 92 | 64 | 27 | 46 | 6 |
| TextSeal2 () | 94 | 71 | 31 | 51 | 7 |
Table 7. Robustness: % of 1000 200-token Qwen3.5-9B answers still detected after each attack, at the clean thresholds ( false-positive rate, 10 keys; paraphraser: Llama-3.2-3B-Instruct).
Code and long generations. On the 500 MBPP test problems (Table 12), TextSeal2 detects 55% of answers at 256 tokens, against 39% / 46% / 50% for TextSeal/ textGrain / SynthID-Text (AutoMark’s copula: 59%). In long thinking traces (up to 2048 tokens; Table 13), 16% of positions on ELI5 and 34% on MBPP repeat an earlier window. There, continuing each window’s race from its leftovers instead of using it once detects 3.8 [+2.1, +5.6] points more at 256 tokens on ELI5 and 7.6 [+2.4, +12.8] points more at 512 tokens on MBPP, and raises median -scores, without measurable distortion (Table 13).
| Method | Detected (128 / 256 / 512 tokens) |
| TextSeal (coin flip) | 30 / 39 / 42 |
| textGrain | 38 / 46 / 48 |
| SynthID-Text | 42 / 50 / 50 |
| AutoMark copula | 54 / 59 / 59 |
| TextSeal2, one use per window | 47 / 55 / 60 |
Table 12. Code: Qwen3.5-9B writing Python solutions to the 500 MBPP test problems, up to 512 new tokens (most answers end earlier, so detection saturates after 256 tokens). % of answers detected at 128 / 256 / 512 tokens, thresholds at a 1% false-positive rate over 10 keys and 2922 unwatermarked answers (all 974 MBPP problems, 3 seeds); same settings as on ELI5 (, , , 10 SynthID layers; the copulas use the 53-bit PRF), whose Qwen3.5-9B Self-BLEU is 20.6–20.9 for all five; one answer per problem, so code diversity is not measured. 11% of positions are a window’s second occurrence in the text.
| Repeated windows | ELI5 | MBPP | |||
| Detected @256 | Median z @256 / 1024 / 2048 | Detected @512 | Median z @1024 / 2048 | ||
| One use per window | 93.0 | 6.0 / 15.9 / 22.8 | 53.2 | 4.8 / 5.6 | |
| Leftover continuation | 96.8 | 6.5 / 16.9 / 23.9 | 60.8 | 5.2 / 5.7 | |
| leftover continuation | +3.8 [+2.1, +5.6] | +0.5 / +0.9 / +1.1 | +7.6 [+2.4, +12.8] | +0.3 / +0.4 |
Table 13. Repeated windows in long generations: Qwen3.5-9B with thinking traces, up to 2048 tokens (ELI5: 1024 prompts, MBPP: 500 problems; , 53-bit PRF). A window repeats at 16% of positions on ELI5 and 34% on MBPP. Detection at a false-positive rate of (thresholds over 10 keys and 2048 / 1000 unwatermarked traces) and median z-score of the key-only test; both rules use the same detector. : paired difference against one use per window, with 95% bootstrap interval over prompts. Distortion check, on 480 traces generated with one key per answer: the mean of at a window’s 2nd / 3rd+ occurrences is +3 [−6, +13] / −3 [−8, +2] millinats with leftover continuation, and −3 [−12, +7] / +2 [−3, +6] millinats without any watermark, so leftover continuation introduces no measurable distortion.
With speculative decoding
With block verification and 8 drafts, unwatermarked decoding emits 2.74 tokens per round, and every scheme but one keeps this number: paired over 480 prompts, TextSeal2’s residual race differs by +0.02 [−0.01, +0.05] tokens per round, as Proposition 1 predicts, and the baselines by at most 0.04 (Figure 11a in Appendix § 13). The exception is textGrain’s own recipe, which verifies the watermarked distributions and emits 5% fewer tokens per round (−0.14 [−0.17, −0.11]). Interpolated at TextSeal’s Self-BLEU, TextSeal2 detects 59% / 89% of 100 / 200-token answers, against 31% / 71% for TextSeal, 31% / 67% for textGrain, 25% / 60% for AutoMark’s copula, and 17% / 50% for SynthID-Text; all paired intervals against TextSeal2 exclude zero (Table 1, Figure 1b). textGrain’s own recipe comes closest (52% / 84%, paired differences +7 [−1, +15] / +5 [−1, +11] in favour of TextSeal2), at the cost of acceptance. With 4 and 16 drafts the ranking is the same, and TextSeal2 leads every baseline that keeps acceptance by 15–41 points at 200 tokens (Table 9); its lead over textGrain’s own recipe is significant with 4 drafts (+6 [+2, +10]) but not with 16 (+1 [−1, +7]). A second drafter–target pair from the Llama family gives the same ranking (Table 10). On AIME math problems, with answers of up to 8192 tokens, TextSeal2 also detects the most answers (41% at 2048 tokens, against 38% for textGrain’s own recipe and 7–22% for the other baselines), and accuracy is unchanged (Table 11); sweeping strengths, TextSeal2 also leads at equal diversity, with 30% detected at 2048 tokens at TextSeal’s Self-BLEU against 23% for the coin flip and 9–21% for the other baselines (Figure 8).
| Method | Tokens / round | Detected | Tokens / round | Detected | Tokens / round | Detected |
| No watermark | 2.44 | – | 2.74 | – | 2.85 | – |
| TextSeal (coin flip) | 2.46 | 34 / 73 | 2.77 | 31 / 71 | 2.87 | 30 / 68 |
| textGrain | 2.45 | 30 / 65 | 2.75 | 31 / 67 | 2.84 | 28 / 62 |
| textGrain, own recipe | 2.36 | 48 / 82 | 2.61 | 52 / 84 | 2.68 | 51 / 85 |
| SynthID-Text | 2.44 | 19 / 48 | 2.75 | 17 / 50 | 2.85 | 17 / 46 |
| AutoMark copula | 2.44 | 24 / 57 | 2.73 | 25 / 60 | 2.83 | 23 / 57 |
| TextSeal2, residual race | 2.44 | 58 / 88 | 2.74 | 59 / 89 | 2.85 | 53 / 86 |
Table 9. Number of drafts per round: Qwen3.5-0.8B drafting tokens for Qwen3.5-9B, block verification, every configuration generated separately for each (3000 answers for detection, 100 questions × 16 answers for Self-BLEU). Tokens per round: emitted tokens over target passes, at , , 10 layers and . Detected: % of 100 / 200-token answers at a false-positive rate of , interpolated at TextSeal’s Self-BLEU for the same (19.8 / 20.1 / 19.6). Paired over 480 prompts, only textGrain’s own recipe lowers the tokens per round (−0.08 / −0.14 / −0.18); the distortion tests of Figure 11 detect the raw-lane-length control at every , and no other scheme on the tests that apply to it, except that at the residual race and textGrain’s own recipe both sit 7 millinats below the same unwatermarked run in the all-token test (intervals [−13, −1]), which points to noise in that shared reference.
| Method | Tokens per round ( / ) | Detected, | Detected, |
| No watermark | 3.20 / 4.08 | – | – |
| TextSeal (coin flip, other key for the last token) | 3.21 / 4.09 | 36 / 72 | 37 / 62 |
| textGrain, other key for the last token | 3.21 / 4.14 | 20 / 51 | 18 / 43 |
| textGrain, own recipe (lowers acceptance) | 3.11 / 3.88 | 55 / 83 | 50 / 79 |
| TextSeal2, residual race | 3.20 / 4.11 | 63 / 87 | 55 / 81 |
Table 10. Second drafter–target pair: Llama-3.2-1B-Instruct drafting or 8 tokens per round for Llama-3.1-8B-Instruct, with block verification (ELI5, 240 prompts per row, , , , TextSeal’s 13-bit PRF for every scheme). Tokens per round: emitted tokens over target passes. Detected: % of 100 / 200-token answers at a false-positive rate of , thresholds over 10 keys and 10,000 unwatermarked Llama-3.1-8B-Instruct answers; 95% Wilson intervals are about ±6 points.
| Method | Tokens / round | Accuracy (%) | Self-BLEU | Finished (%) | 256 | 512 | 1024 | 2048 |
| No watermark | 5.42 | 71.1 | 44.8 | 68 | – | – | – | – |
| TextSeal (coin flip) | 5.43 | 69.2 | 46.1 | 66 | 1 | 5 | 13 | 22 |
| textGrain | 5.39 | 69.3 | 45.8 | 66 | 1 | 2 | 6 | 15 |
| textGrain, own recipe | 5.30 | 69.7 | 46.8 | 68 | 3 | 8 | 22 | 38 |
| SynthID-Text | 5.39 | 69.2 | 45.6 | 68 | 2 | 4 | 9 | 19 |
| AutoMark copula | 5.38 | 70.2 | 45.8 | 68 | 1 | 2 | 4 | 7 |
| TextSeal2, residual race | 5.39 | 70.6 | 46.5 | 68 | 4 | 11 | 24 | 41 |
Table 11. AIME under speculative decoding: Qwen3.5-0.8B drafting 8 tokens per round for Qwen3.5-9B with block verification, 16 answers to each of 100 AIME problems (thinking disabled, prompt asking for a answer, temperature 1, top- 0.95, up to 8192 tokens), at , , 10 layers and . Tokens per round: emitted tokens over target passes; only textGrain’s own recipe lowers it ( [, ], paired by problem with unwatermarked decoding). Accuracy: last answer; paired by problem, every scheme is within 2 points of unwatermarked decoding, all 95% intervals containing zero. Self-BLEU: over each problem’s 16 answers, first 1024 tokens. Finished: answers that end before 8192 tokens. Detected: % of answers detected at a false-positive rate of on their first 256 / 512 / 1024 / 2048 tokens, with each method’s detector; thresholds are the empirical quantile over the 1600 unwatermarked answers scored under 10 keys ( null -values; realised false-positive rates 0.05–0.15%); 95% Wilson intervals are at most ±2.4 points. Strengths are defaults, not diversity-matched; Self-BLEU varies by at most 2 points.
Figure 8. Diversity (Self-BLEU over each problem’s 16 answers, first 1024 tokens; lower is more diverse) vs. detection at a false-positive rate of on AIME under speculative decoding, on the first 1024 (a) and 2048 (b) tokens; same setup as Table 11, sweeping each method’s strength. Interpolated at TextSeal’s Self-BLEU (46.1), TextSeal2 detects 30% of answers at 2048 tokens, against 23% for the coin flip, 21% for SynthID-Text, 17% for textGrain and 9% for AutoMark’s copula; paired by problem, its lead is significant over all but the coin flip (+7.4 [, +19.5]). Error bars: 95% Wilson intervals.
Figure 11. Is speculative decoding with a watermark still distortion-free? Paired differences from unwatermarked block verification (8 drafts per round) on the same 480 prompts, with one key per answer (95% paired bootstrap intervals). (a) Tokens per round. (b) Mean of at the last token of each round, which has expectation zero when it follows block verification’s residual law (not shown for textGrain’s own recipe, whose last token follows the residual of the watermarked distributions). (c) Mean of over all tokens, which has expectation zero for any distortion-free scheme. Only the control (racing on raw lane lengths, Remark 1) deviates in (c), and only textGrain’s own recipe lowers tokens per round.
Memorylessness is what makes this work. AutoMark’s copula coincides with TextSeal2 in distribution, so the entire gap between them in Figure 1b (25% / 60% against 59% / 89%) comes from how the last token of each round is drawn: under an independent key, or by the residual race on the draft races’ leftovers. Independent keys waste signal twice over. The last tokens (37% of the text) carry only the second key’s signal, except at the bonus position (5% of rounds), and under the draft key they score 0.84 on average – below the null mean of 1, because a token drawn from block verification’s residual law lost its draft race – actively diluting the fused score. The residual race instead keeps the keyed values in play: last tokens score 1.34 under , against 1.42 for kept drafts (Appendix § 13).
Distortion. Proposition 1 guarantees the exactness of the residual race under an ideal PRF; we check the implementation. Generating with one key per answer (independent draws over keys) and reading the laws and used at generation, we test whether over all tokens and at the last token of each round have mean zero, as they must without distortion. TextSeal2 and the baselines are indistinguishable from unwatermarked block verification on both tests (textGrain’s own recipe on the all-token test, the only one that applies to it), whereas racing on the raw lane lengths fails the all-token test, by +11.7 [+5.8, +17.8] millinats per token (Figure 11).
Conclusion
TextSeal2 satisfies the four requirements we set out for a deployed watermark: it is exactly distortion-free, preserves diversity under a fixed key, stays within 0.9% of plain sampling when key-only work overlaps the forward pass, and maintains the acceptance rate of speculative decoding. Its detection is comparable to that of textGrain overall – ahead on Llama-3.1-8B, level on Qwen3.5-9B, and slightly behind on Qwen3.5-27B at 100 tokens – without textGrain’s per-token optimisation. Our analysis attributes the previous gap to TextSeal’s coin-flip routing rather than to the absence of optimal transport: merging the two keys into one virtual key removes the loss in signal-to-noise ratio, while still allowing one key to be published for public detection. For speculative decoding, drawing the drafts by keyed races and choosing block verification’s outcome by a race on their leftovers carries the watermark without lowering acceptance.
Limitations. Our evaluation covers three domains (open-ended ELI5 answers, MBPP code, and AIME math problems under speculative decoding) and three open-weight models, at temperatures 0.7–1. With block verification and 8 drafts, speculative decoding costs 2–4 percentage points of detection relative to standard decoding, and our speculative-decoding implementation is unbatched, so we do not measure wall-clock speedups. We do not analyse attacks that exploit knowledge of the public key beyond the private verification it enables ([27]). Finally, textGrain’s code is not public, so we use our reimplementation (Appendix § 13); its deployed parameters may differ.
Proofs
This appendix proves the results of § 3. Throughout, keyed values at an unused window are i.i.d. uniform (ideal PRF), and the copula noise and the values drawn afresh at used windows, the only other randomness, are independent of them.
Copula mixing
Lemma 2 (Distortion-free for every coupling). Let be i.i.d. uniform and i.i.d. , independent of them. For every , the values of (4) are i.i.d. uniform, so the race (1) on them emits with probability .
Proof. Each is , and the two keys are independent, so is . is a sum of independent centred Gaussians of variance . Distinct candidates use disjoint keyed values and noise, so the are i.i.d. , the are i.i.d. uniform, and the race emits with probability (§ 2).
Exponential races and their leftovers
Lemma 1 (restated). If the are i.i.d. and is a probability vector, the race , with time , emits with probability , and given the leftovers , , are again i.i.d. .
Proof. Each clock rings after an time, with density . The winner is the first clock to ring, and is its time. We compute the joint law of the winner, its time, and the losing clocks’ leftovers, and check that it factorises.
Fix a token , a time , and thresholds for . The event “ wins at time and every other leftover exceeds ” requires and for . The clocks are independent, so this probability is one density term times tail terms:
using .
The right side factorises in , , and the . Reading them off: has law , has density on and is hence , and each leftover has tail , so the leftovers are i.i.d. , independent of .
Tokens with never win, and their are left untouched.
Block verification
Fix a round with drafts , drafter laws and target laws . For , block verification (Sun et al. [30]) uses
with . By the retention identity of Sun et al. [30], is the probability that the round keeps , given its first drafts and averaged over the later ones. It drops when the target likes a draft less than the drafter does and recovers when later drafts are likelier under the target, so a likely later draft can rescue an unlikely earlier one. With , is the residual (3) of token-level verification. The success probabilities are
with when and both vanish. Native block verification tests each position with an independent uniform, which succeeds with probability , stops at the last success, or at position 1 if every test fails, and draws . Given the drafts, its outcome therefore has the law
whose total is , since . Sun et al. [30] index by the number of kept drafts: their , and are our , and , and their residual after kept drafts is . For it is token-level verification: , and is the residual (3).
Lemma 3 (Zero mass on the draft lanes). For every , , and if .
Proof. If , then : for because , and for because . The factor of then vanishes. If , then , so and ; otherwise . Either way, . If and , then and . If and , then for every , so , , and as above. □
So is needed only when .
Exactness of the residual race
Proposition 1 (restated). Suppose that every round reads i.i.d. uniform keyed values at its windows, independent across positions and of earlier rounds, and independent copula noise. (i) Given the drafts, has law , so the number of tokens per round, and hence acceptance, is that of block verification. (ii) The generated text follows the target’s law. (iii) The window rule (Appendix § 6.§ 5) meets this condition: the text is distortion-free over keys.
Proof. Fix everything before the round, and write for the lane lengths of position .
(i) Leftovers given the drafts. Fix a sequence of drafts. The windows and the laws , and are then fixed, and by assumption and Lemma 2, are independent families of i.i.d. variables. The event is the intersection of the events , , each of which involves only . So given , the families stay independent, keeps its law, and each , , has the law of i.i.d. variables conditioned on winning the race with weights . By Lemma 1, the leftovers , , are then i.i.d. and independent of ; tokens with keep as their leftover. Hence, given the drafts, the leftovers of all lanes but the drafts’ own, together with , are i.i.d. and independent of .
(i) Relay. A draft’s own lane has leftover , but by Lemma 3, so (6) reads only the leftovers above. It is then the race of Lemma 1 over the outcomes with , with these leftovers as values and the weights , which sum to 1. So , the law of block verification given the drafts, and the proof of Lemma 1 shows that the winning time is and independent of the winner. By Lemma 1, given , so has the law of a round of native block verification; in particular, acceptance is kept.
(ii) Output. Given everything before it, each round emits with the law of a native round, so by induction over rounds the text has the law of speculative decoding with block verification, which is the target’s law ([30 Theorem 1]).
(iii) Window rule. Let contain the emitted prefix and all randomness used to generate it. Under the rule of Appendix § 6.§ 5, position of a round reads either the keyed values of a window that was raced neither before the round nor at an earlier position of the round, or freshly drawn values. Keyed values at a window that no race has read are i.i.d. uniform and independent of the values at other windows and of , and the copula noise is drawn anew at every position. So the values read at positions are i.i.d. uniform and independent of , as (i) and (ii) require. □
What the detector reads. A kept draft , , has lane length , where is and independent of given the drafts, because the relay reads only leftovers. Kept drafts therefore carry the signal of their draft races. The last token has lane length , with the winning time of the relay, and carries the signal of the relay, which includes the choice of where to stop. Every emitted token is selected by a race on its own keyed values, so the detector is unchanged: it sums the scores and needs no round boundaries.
Remark 1 (Racing on raw lane lengths is biased). Racing on the raw lane lengths instead of the leftovers uses . The extra term penalises the tokens the drafter liked and the positions whose draft race ended late, while the bonus position has no such term. With one draft, , and the first token, the residual race stops at position 1 with probability and then emits the third token with probability . On the raw lane lengths, the race stops there with probability and emits the third token with probability . The same bias affects the single-position rule that re-runs the race with weights on the raw values after a rejection by a fresh coin: it picks the third token 86% of the time.
Remark 2 (Token-level verification). Token-level verification keeps draft with probability and, at the first rejection, emits a token from the residual of (3) at that position. Given the drafts, its outcome has the law
If , the factor vanishes; otherwise and . Either way, this law also vanishes on the draft lanes. The proof of Proposition 1 then applies with in place of , and with the validity of token-level verification (Leviathan et al., [20]; Chen et al., [3]) in place of that of block verification: the race (6) on keeps token-level verification’s law without a coin.
Repeated windows
The rules. At generation, a key’s values at a given window serve at most one emitted token per answer, and a position whose window was already used draws its values afresh, which is plain sampling (Appendix § 13). Under speculative decoding, a window counts as used once a round races it, whether or not its position is kept. The positions after are discarded, but their keyed values still shaped the outcome: the relay reads the leftovers of every position, and depends on the later drafts. A position whose window was already raced, earlier in the text or earlier in the same round, therefore uses freshly drawn values, so the positions of a round have independent values. A round races windows but emits only tokens, so more positions fall back to fresh values than without speculative decoding. Without speculative decoding, TextSeal2 can instead continue a window’s race at each later visit, as the ResidualRace of AutoMark does (Gloaguen et al., [12]): it keeps the leftovers of the window’s last race and gives the token that won it a freshly drawn exponential. At detection, each (window, token) pair is scored once, at its first occurrence.
The whole text is distortion-free. Reusing a window’s keyed values re-runs the same race: each token still follows the model given its prefix, averaged over keys, but tokens at repeated windows become dependent, so the law of the whole answer is not the model’s. Under the rules, each position reads keyed values that no earlier race has read, or freshly drawn values, which are independent of the prefix and of the randomness that produced it. Each token then follows the model given its prefix, and the chain rule over positions gives the model’s law for the whole answer; under speculative decoding, this is part (iii) of Proposition 1, whose proof uses exactly this independence. With leftover continuation, given the earlier visits of a window, the leftovers of its losing tokens are again i.i.d. Exp(1) by Lemma 1, and the winner’s fresh value is independent of them, so every visit is distortion-free given the past.
The detection tests stay valid. Under , the text does not depend on the key, so with an ideal PRF the scores (7) of distinct (window, token) pairs are i.i.d. Exp(1) given the text, while a repeated pair only repeats its score. Scoring each pair once leaves distinct pairs, so in (8) follows Gamma exactly, and distinct tokens at the same window still give independent scores. The score of a pair depends only on the key, the window and the token, so it is the same at every occurrence, under either generation rule. When cropping or editing changes which occurrence of a pair comes first, the detector therefore reads the same score for that pair.
Acceptance
For , it keeps the draft with probability , and no scheme with a single draft at a position does better while preserving the output distribution.
Proposition 2 (Acceptance bound). At one position, let a scheme draft and emit , and let and be their laws given the key, with and over keys. Then , and the second inequality is strict iff for some , takes both signs with positive probability. Verifying on watermarked laws (accepting with probability ) attains the first bound; the raw test with an independent coin, and the residual race with , attain the second.
Proof. We adapt the sum-over-min step and the expected-TV step from the proof of Hu and Huang [15], with the second step proved there through the dual form of TV. Fix the key, and take probabilities given it. An accepted draft is the emitted token, and is a coupling of and , so
Averaging over keys gives the first inequality.
For the second, let , so that and . Since is convex, Jensen’s inequality gives for each . Summing over gives the second inequality, which is strict iff one of these terms is. If takes both signs with positive probability, then on and on , so and the term is strict. Otherwise is almost surely or almost surely , and the term is an equality.
At a fixed key, verifying on the watermarked laws is speculative sampling with draft law and target law , which accepts with probability . The raw accept test with an independent coin accepts with probability , since the draft follows over keys. Given the draft, the residual race with keeps it with probability by Proposition 1, the same as the raw test. □
For , block verification decodes at least as many tokens in expectation as any valid draft verification algorithm [30 Theorem 2], and the residual race inherits it (Proposition 1).
Entropy removed
Let be the law of the emitted token given the keyed Gaussians, over the newly drawn noise. As in textGrain Li et al., [24], the entropy the key removes is
Theorem 1 (The coupling sets the entropy removed). *If , then is continuous and strictly increasing on , from to . Hence for every target $\delta\in
there is a unique with , and running the race with removes exactly at every previously unused window, keeps the token law , and leaves the detector unchanged.
Under speculative decoding, may depend on the draft distribution but not on the target distribution : the drafter fixes its race inputs , and hence , before the target computes .
Proof. Write , , and .
Step 1: endpoints. At , is independent of , so depends only on and . At , , so is a function of and , since (Lemma 2).
Step 2: monotone. Take and let . Draw an independent and form the degraded key , which is standard Gaussian. Run the race at coupling on , giving . Since
and the last two terms form a Gaussian of variance independent of , the pair has the law of at coupling , while has the law at coupling . As is a Markov chain, data processing gives .
Step 3: strict. The chain rule gives . It vanishes only if the law of given depends on alone. Given , still has a density that is positive everywhere, so this law would have to be constant in . It is not: for a token with , sending drives the race input to , so wins almost surely, and since the same holds for a second token with . Hence and the inequality is strict.
Step 4: continuous. Write , with fixed. For almost every , the race inputs move continuously with , and the argmax is almost surely unique, so the conditional law moves continuously. Entropy is continuous and bounded by , so dominated convergence makes the expectation, hence , continuous.
Conclusion. is a continuous strictly increasing bijection from onto . Every in range is therefore hit by exactly one . A prefix-dependent keeps the token law by Lemma 2, applied given the prefix, and the scores do not involve , so the detector is unchanged.
Near-optimality of the copula race
Setup. Fix a next-token distribution and a detection score applied to the emitted token’s keyed Gaussian, with mean and standard deviation under the null (unwatermarked sampling). A coupling between the keyed Gaussians and the emitted token is assessed by its per-token signal-to-noise ratio and its cost , the entropy removed ((12)).
An upper bound for every scheme.
Proposition 3 (No free evidence). For any distortion-free coupling of keyed Gaussians and token , let be the law of the emitted token’s Gaussian . Then , and the inequality is strict whenever .
The left-hand side is the expected log-likelihood ratio per token, i.e. the rate at which detection evidence accumulates, so each nat of entropy removed yields less than one nat of evidence.
Proof. Under , the KL to the product of its marginals is the mutual information: . The map reads off the emitted token’s Gaussian. It sends to , since every coordinate of is standard normal, and to . Data processing gives the bound.
For strictness, suppose equality holds with . Equality in data processing requires the likelihood ratio to be a function of the statistic: for some . Summing over gives for all . This is a sum of functions of separate independent coordinates, so each summand is constant: the variance of the sum is the sum of the variances, and it is zero. Hence each is constant, and makes it 1. Then and .
The best coupling. Maximising subject to and has the Lagrangian , maximised by
an exponential tilt, i.e. entropic optimal transport, which textGrain approximates per token.
Weak-watermark limit. Write with and . The first constraint keeps the token marginal at ; the second keeps normalized. To second order, the cost is . The signal is . The best perturbation is , with , and it gives, for every score,
Copula efficiency. For the copula, with , where is the mean maximum of standard normals, extended to real as the mean of the law with CDF . Its SNR is . Its efficiency, the ratio of its SNR to the bound, is
by Cauchy–Schwarz, with equality iff is increasing and affine in and is uniform on its support. Extending to non-integer is accurate: an exact computation from the score identity agrees with to within 0.001 on uniform, Zipf, and peaked distributions.
Numbers. For 8 equiprobable tokens, the copula achieves , 0.79 and 0.71 at , 0.8 and 0.95 respectively, against a weak-limit ceiling factor of . Over 5,169 positions of 60 Qwen3.5-9B answers with at least two candidates (after top-), the weak-limit efficiency with the Gaussian score averages 0.966 (0.971 when weighted by each position’s capacity ), with a 10th percentile of 0.94. Rescoring generated Qwen3.5-9B answers under the copula and TextSeal2 with the Gaussian score instead of TextSeal’s score changes detection by at most 2 percentage points. At finite strength, Table 2 compares the copula with the optimal coupling at equal (computed by Sinkhorn on 4000 sampled keys, a discretisation that favours the optimum): the copula attains 91–100% of the optimal signal-to-noise ratio at , 0.8 and 0.95.
| Next-token distribution | Gaussian score | TextSeal score |
| uniform over 8 tokens | 0.998 / 0.998 / 1.000 | 0.915 / 0.962 / 0.992 |
| Zipf(1.1) over 24 tokens | 0.982 / 0.988 / 0.993 | 0.908 / 0.960 / 0.989 |
| top token 0.5, Zipf tail | 0.966 / 0.978 / 0.987 | 0.911 / 0.959 / 0.990 |
| top token 0.8, Zipf tail | 0.929 / 0.938 / 0.942 | 0.908 / 0.952 / 0.973 |
Table 2. Copula race vs the best distortion-free coupling at equal entropy removed: ratio of per-token signal-to-noise ratios, for the Gaussian score and TextSeal’s score , at couplings (the fraction of each token’s entropy removed by the key is then about 0.16 / 0.45 / 0.72).
Entropy removed by a constant coupling
Table 3 reports the fraction of entropy removed, , computed by quadrature over the keyed Gaussians (640 sampled keys per value; exact for two tokens), for synthetic next-token distributions: uniform over tokens, a flat Zipf(0.8) law over 100 tokens, and a top token of probability with a Zipf(1.1) tail over 99 further tokens. The fraction depends only weakly on the shape: a fixed removes 0.47–0.49 of the entropy at and 0.63–0.65 at on the many-token shapes, and about 0.1 less in the extreme case of two equiprobable tokens. A single therefore removes a nearly shape-independent fraction of the entropy, as subsection 3.3 uses.
| Shape | (nats) | |||||
| uniform over 2 | 0.69 | 0.125 | 0.272 | 0.385 | 0.550 | 0.677 |
| uniform over 8 | 2.08 | 0.147 | 0.308 | 0.426 | 0.590 | 0.712 |
| uniform over 64 | 4.16 | 0.173 | 0.353 | 0.477 | 0.640 | 0.754 |
| flat Zipf(0.8) | 4.07 | 0.173 | 0.354 | 0.479 | 0.641 | 0.750 |
| 2.42 | 0.170 | 0.350 | 0.475 | 0.638 | 0.750 | |
| 0.37 | 0.183 | 0.370 | 0.493 | 0.652 | 0.757 |
Table 3. Fraction of each token’s entropy removed at a fixed coupling , on synthetic distributions.
These fractions are characterised on synthetic shapes; on real Qwen3.5-9B distributions we instead measure the copula’s efficiency directly (Appendix § 7), which is the quantity that enters detection.
Algorithm and latency
One round in pseudocode
Algorithm 1 implements one round of speculative decoding with the residual race (subsection 3.2); its last line gives decoding without speculation.
Algorithm 1 One round of TextSeal2 with speculative decoding ( drafts)
Require: prefix , keys , , coupling , drafter and target, number of drafts , set of windows raced so far
for do
last tokens of
if then
freshly drawn values ▷ window already raced
else
at ; ▷ key-only
end if
;
if then
drafter’s law after
; ▷ draft race ((5))
end if
end for
target’s laws after , in one forward pass
from ((11)); for ▷ block verification
, with ▷ residual race ((6))
return
Without speculative decoding: return at the window of the next position.
In Algorithm 1, the masses vanish in exact arithmetic (Lemma 3) but are set to 0 explicitly: the leftover of a draft’s own lane is 0, so a rounding residue in its mass would make it win the race. The key-only work of position needs the draft , so it runs alongside the drafter’s forward pass; after the target pass, block verification’s law and the relay are linear in the round’s values.
Post-logits latency
Only work performed after the logits are known can add latency; key-only work (PRF evaluation, forming and , and textGrain’s keyed cost table) depends only on the key and the window, and can therefore run concurrently with the model’s forward pass. Table 4 accordingly times the post-logits work of each sampler on the Qwen3.5 vocabulary, with every method except our full textGrain implementation captured in a CUDA graph. TextSeal2 costs the same as TextSeal: a single pass over the vocabulary, cheaper than the top- filtering that every method (watermarked or not) requires. For textGrain we time three variants: a minimal version with only the core post-logits work (block masses, a fixed number of Sinkhorn iterations, keyed column selection, and two sampling draws), without calibrating the regularisation to the entropy budget; our implementation of its Algorithm A.1 with 10–30 Sinkhorn iterations; and the same implementation with the regularisation calibrated per token so that the budget is met. Any faithful implementation does at least the minimal version’s work. At batch size 1, our implementation of Algorithm A.1 takes 1.1–3.0 ms per step (2–6% of a 50 ms Qwen3.5-9B decoding step, Table 5), and 2.3–4.1 ms with calibration. Even the minimal version (0.2–0.4 ms at batch 1) does 8–22 times TextSeal2’s post-logits work (Table 4).
| Batch | Top-p (all) | TextSeal | TextSeal2 | textGrain minimal | A.1, 10 / 20 / 30 it. | A.1 calibrated, |
| 1 | 0.16 | 0.020 | 0.018 | 0.22–0.40 | 1.1 / 2.1 / 3.0 | 2.3 / 4.1 |
| 8 | 0.72 | 0.030 | 0.025 | 0.28–0.50 | 1.4 / 2.6 / 3.8 | 2.4 / 4.5 |
| 64 | 2.14 | 0.15 | 0.12 | 0.98–1.24 | 3.8 / 6.7 / 9.5 | 2.7 / 4.8 |
Table 4. Table 4 Post-logits latency per decoding step (ms, median of 200 CUDA-graph replays, or 50 eager runs for calibrated textGrain, whose calibration loop has data-dependent control flow; one H200, vocabulary of 248,320 tokens, synthetic high-entropy logits). Top- filtering is shared by all methods. The minimal textGrain version uses 5–20 Sinkhorn iterations on the 256 × 256 kernel without calibrating .
Comparison with TextSeal. TextSeal2 needs both keys’ PRF values and their Gaussian transforms at every token, whereas TextSeal needs a single key’s PRF values. Table 5 times full Qwen3.5-9B decoding steps (Hugging Face forward pass, one H200, real logits). If the extra key-only work is run sequentially after the forward pass, it costs 0.2 ms at batch size 1 and 2.9 ms (5%) at batch size 64; overlapped on a side CUDA stream during the forward pass, TextSeal2 is within 0.3 ms (0.6%) of TextSeal and within 0.9% of plain unwatermarked sampling.
PRF resolution
TextSeal’s PRF returns , i.e. values quantised to 13 bits. The largest attainable value is then 8190/8191, so is bounded away from zero. A rare token can win the race only if its is extremely small relative to , and is therefore emitted slightly too rarely: the quantisation measurably distorts the entropy. Simulating the race at all 8059 positions of 60 Qwen3.5-9B answers, the mean of is millinats per token with continuous (unquantised) uniform values, against millinats with the 13-bit PRF. The bias concentrates at high-entropy positions: it is millinats at positions with 2–10 candidates after top- (52% of positions), but millinats at positions with 101–1000 candidates (0.9%). TextSeal2 therefore uses a 53-bit PRF. With the 53-bit PRF (splitmix64; uniformity checked by a Kolmogorov–Smirnov test), TextSeal2 under speculative decoding passes both distortion tests of Figure 11. The 13-bit PRF also induces a slight correlation between the two keys’ values ( on random windows and tokens, and on unwatermarked answers, against for splitmix64), so that has variance – rather than 1. With 13 bits, TextSeal2’s mean per-token score was 1.2–1.6% below the single-key copula’s on the two Qwen models at ; with the 53-bit PRF the two agree on all three models at and 0.9 (differences of per-answer mean scores from to , every 95% interval containing zero), as they must, since the two samplers coincide in distribution.
Additional results
Four keys. With TextSeal’s (13-bit) PRF, merging four keys detects 63% / 91% of 100 / 200-token answers, against 60% / 92% for two keys: additional keys (e.g. one publishable key per verifier) cost the full detector no detection power, as subsection 3.1 predicts.
Temperature 0.7. At the lower entropies induced by temperature 0.7, TextSeal2 detects 22% / 56% of 100 / 200-token answers, against 9% / 37% for TextSeal at a similar Self-BLEU (26.3 vs. 25.4); textGrain detects 22% / 55% at a Self-BLEU of 27.3. (For this experiment, Self-BLEU uses 16 answers to each of 25 questions, and thresholds are calibrated on 6000 unwatermarked answers.)
Keys with different windows. The virtual key can merge keys seeded by windows of different lengths. Let be the set of keys whose window at position has not been used before in the answer; then is still standard normal, so the race remains distortion-free with any such mix. This enables edit-rate estimation without access to the original text: under token substitutions at rate , a window of length and the token it seeds survive intact with probability about ([27]), so the mean excess score of the length- key decays geometrically in , at a rate that identifies ; the least-squares slope of the log excess against estimates . This application needs merging. Under TextSeal’s coin-flip routing, each of keys generates only a share of the tokens, and detection collapses as keys are added: a ladder of window lengths detects just 22% of 400-token Llama-3.1-8B-Instruct answers. Merged into , each key instead retains a correlation with every token’s race, and the same ladder detects 98%; on Qwen3.5-9B, multi-window variants match two-key TextSeal2 at equal Self-BLEU on clean text (Table 8). Pooled over a corpus, the resulting estimate of is unbiased up to 20% token substitutions; for a single 200-token answer it remains informative up to about 5%. The cost is robustness: long windows are broken by edits first, and under 8–12% substitutions the ladder’s detection falls by 15–27 percentage points relative to fixed short windows.
| Windows | Clean | Estimate at | Estimate at | |||
| (3, 3) | 68 / 92 | 83 | 58 | 27 | – | – |
| (2, 10) | 70 / 94 | 74 | 31 | 10 | 0.045 / 0.043 | 0.116 / 0.087 |
| ladder | 67 / 94 | 75 | 33 | 9 | 0.045 / 0.037 | 0.117 / 0.059 |
Table 8. Keys with different window lengths merged in the virtual key (Qwen3.5-9B, ELI5, 200 tokens; for the robustness and estimation columns; 53-bit PRF). Rows: standard two-key TextSeal2 with windows (3, 3); two windows (2, 10); and a six-key ladder (2, 3, 4, 6, 8, 10). Clean: % of 100 / 200-token answers detected at a false-positive rate of , interpolated at Self-BLEU 21.5. Substitution columns: % of 200-token answers still detected, at the clean thresholds, after a fraction of tokens is replaced uniformly at random. Estimate columns: edit rate fitted from the decay of per-key scores with window length, reported as (pooled fit over 1000 answers) / (median of per-answer fits).
Repeated windows in long answers. In long-form prose, repeated windows are rare: on 1024-token Qwen3.5-9B answers (prompts requesting at least 800 words; 300 answers per scheme; thresholds calibrated on 2000 unwatermarked long answers), only 2.3% of positions are a window’s second occurrence. Every scheme (TextSeal, TextSeal2 with one use per window, and AutoMark’s copula) then detects 98–100% of answers within 256 tokens and 100% from 512 tokens (at a 1% false-positive rate),
Experimental details
so the repeated-window rule does not matter there. Windows repeat far more often in code (11% of positions, Table 12) and in thinking traces (16–34%, Table 13), where leftover continuation helps.
Experimental details
Generation. Prompts are ELI5 questions (a version without math questions, 267,901 rows), taken in order and formatted with each model’s chat template with thinking disabled; decoding uses temperature 1, top- 0.95, and at most 200 new tokens, with watermark window size . The copulas (TextSeal2 and AutoMark’s) use the 53-bit PRF of Appendix § 10 in Table 1, Figure 1, Figure 7, Figure 6 and Figure 10, and Table 6, Table 12 and Table 13, as well as in every speculative-decoding experiment on Qwen3.5-9B; the remaining experiments (robustness, four keys, and the Llama drafter–target pair of Table 10) use TextSeal’s 13-bit PRF, which slightly understates TextSeal2 (Appendix § 10). Detection runs use 3000 answers per configuration on Qwen3.5-9B (rows 0–2999, one answer each), with or without speculative decoding, and 1000 on the other models (rows 0–999); null calibration uses 10,000 unwatermarked answers from the same model (rows 0–9999; rows 100,000–109,999 for the speculative-decoding experiments, with the target model). Key values follow TextSeal’s derivation: and ; textGrain uses and keys 42 and 4242. For null calibration, adding to every key, , gives ten keys, being the generation key.
Figure 6. The diversity–detection trade-off of Figure 1 at 200 tokens instead of 100; same protocol and conventions, including the speculative panel (b).
Figure 10. Figure 1 with diversity measured by the share of distinct 4-grams (higher is more diverse), including the speculative panel (b).
Speculative decoding. In each round, Qwen3.5-0.8B proposes drafts, one at a time, from its own distribution (after temperature and top-) through the scheme’s sampler; Qwen3.5-9B then evaluates in a single forward pass, and the round emits the kept drafts and one more token, by block verification [30] with the closed forms of Appendix § 6.§ 3. A draft that is an end-of-sequence token ends the round’s drafting, so the round then has fewer than drafts. TextSeal2 follows Algorithm 1: drafts by the race (5), then the residual race (6), with the copula noise drawn once per position and read by both races. The unwatermarked reference is native block verification with freshly drawn randomness. is the main setting; Table 9 reports and 16, for which every configuration was generated again. During generation, each answer tracks the (window, key) pairs whose values have been used, and every pair that a round reads counts as used, kept or not, for every scheme (Appendix § 6.§ 5). When a window has already been used, TextSeal and SynthID-Text fall back to their other key and then to fresh randomness, and textGrain and the copulas directly to fresh randomness (for TextSeal2, freshly drawn lane lengths, on which the draft race and the residual race still run). Both models keep a key–value cache that is rolled back to the kept prefix after each round; on 40 random rounds, the logits after a rollback match a recomputation without cache as closely as those of a cache without rollback (bfloat16 noise).
Detection. Under speculative decoding with 8 drafts, the last token of each round makes up 36–37% of the text (first 1000 answers at and ). Scored under the draft key, AutoMark’s last tokens, drawn under an independent key except at the bonus position (5% of rounds), average 0.84 (below the null mean of 1, because a token drawn from block verification’s residual law lost its draft race) against 1.42 for its kept drafts; TextSeal2’s last tokens average 1.34 under , against 1.42 for its kept drafts (all ). Positions whose window was already used get fresh values: 9% of TextSeal2’s tokens, against 6% of AutoMark’s. For every detector, each (window, token) pair is scored once, at its first occurrence. Entropy-weighted test. Each scored position is assigned the entropy of the next-token distribution of an auxiliary model (here the generating model itself, the target model under speculative decoding, evaluated on the answer under examination) and the weight , where and range over the scored positions of the text. With per-position scores of null mean and null variance ( for single-key scores, for two-key fused scores ), the weighted sum is compared with the Gamma distribution of the same mean and variance (shape , scale ). Since all decision thresholds are empirical (below), this moment matching affects power but not validity. The threshold for each detector and answer length is the empirical quantile of its -values on the 10,000 unwatermarked answers scored under 10 keys. Keys are interchangeable on unwatermarked text, so this pools null -values, about 100 of which fall below the threshold; a single key would give only about 10, and hence a much noisier threshold. At the nominal level, realised false-positive rates are 0.08–0.13% for the detectors of Figure 9 and 0.07–0.15% for those used under speculative decoding (two-key fusions with the measured shares, and the Llama pair), so the Gamma and binomial tail approximations are already accurate, and the empirical thresholds absorb the remaining deviation. Under speculative decoding, TextSeal, textGrain, SynthID-Text and AutoMark’s copula fuse both keys’ scores, weighted by their measured shares of emitted tokens (as TextSeal does for its coin flip); textGrain’s own recipe uses a single key; TextSeal2 uses (private) and (public) exactly as without speculative decoding (subsection 3.1).
Diversity. The Self-BLEU of a question is the mean sentence-level BLEU (sacrebleu) over all ordered pairs of its answers generated under the fixed key, decoded from their first 200 tokens. This is TextSeal’s two-generation diversity estimator averaged over all answer pairs; we report the mean over questions. Intervals for values interpolated at TextSeal’s Self-BLEU resample the 100 questions jointly for all methods (and detection outcomes binomially within questions), so that question-level variation common to all methods cancels in paired comparisons. Figure 10 repeats Figure 1 with diversity measured by the share of distinct 4-grams among a question’s answers. The copulas still dominate the coin flip, and TextSeal2 still leads under speculative decoding; without speculative decoding, textGrain is slightly ahead of the copulas under this metric (66% vs. 62% detected at TextSeal’s distinct-4 level), whereas it is level with TextSeal2 under Self-BLEU.
Distortion tests. Answers used for acceptance and distortion measurements are generated with a fresh key for prompt (textGrain: this key and the key plus 4200), so that answers are independent draws over keys, the regime in which distortion-freeness is defined; 480 prompts per scheme and draft length. The tests read the laws used at generation: for every emitted token, and come from the target pass of its round, and for the last token of each round, is block verification’s residual law at its position, computed from these and . All intervals are 95% bootstrap intervals over answers. Figure 11 reports the acceptance and distortion measurements for , and Table 9 summarises them for and 16. As a simulation control, the decisions were run on fixed toy laws with fresh values for every round ( drafts). The outcome of the residual race follows block verification’s law ( test over rounds and 5 tokens, ), whereas racing on the raw lane lengths (Remark 1) does not ( on 401 degrees of freedom). For the baselines ( rounds over 12 tokens), the first emitted token follows the target’s law and the number of kept drafts follows native block verification (), except that textGrain’s own recipe keeps fewer drafts, as it verifies the watermarked laws.
Compute. Each generation job uses one H200 GPU. Our speculative-decoding implementation (Hugging Face models with a key–value cache) is unbatched and unoptimised: with it takes about 0.11 s per token on one GPU, three times slower than plain decoding with the target, because the drafter is called once per draft; this affects only experimental throughput, not any reported rate, since block verification is exact. Under it, the residual race’s decision takes 0.33 ms per token, against 0.38 ms for native block verification, and computing the keyed lane lengths of the drafted positions takes 2.4 ms per token more than sampling the drafts without a key; this key-only work can run concurrently with the drafter’s forward pass (Appendix § 9).
textGrain reimplementation. The textGrain report Li et al., [24] releases no code, so we implemented its Algorithms 1 and A.1 from the text: a keyed partition of the vocabulary into blocks derived from the key and the window; a table of standardised keyed Gumbel costs with columns (the report fixes neither nor ); the log-domain Sinkhorn updates with marginal correction and the regularisation update of its Eq. (A.4); selection of a keyed column; and independent sampling of the block and then of the token within it. Detection follows its Section 3.2 (Gamma(, 1) null), except that, as for every method in this paper, we score the first occurrence of each (window, token) pair rather than each window’s first occurrence, which adds about 1% more scored positions. We validated the GPU kernels against a direct (unoptimised) implementation of the algorithm on random inputs, and verified on toy distributions that the emitted-token distribution is unbiased and that the entropy removed respects the budget . The speculative recipe implements its Appendix B with block verification between the watermarked distributions. OpenAI’s implementation and hyperparameters may differ from ours, and our textGrain numbers carry that caveat.
Reproducibility. Generation and evaluation scripts, including fixed seeds, key derivations, prompt lists (ELI5 rows; MBPP problems) and threshold calibration, together with the per-answer outputs underlying every reported number, will be released with the paper.
Broader impact. Watermarks give providers, platforms and the public one signal for tracing AI-generated text. They are not robust to paraphrasing (Table 7), can in principle be spoofed or removed by determined adversaries, and should therefore be combined with complementary provenance signals rather than treated as proof of origin. Publishing a detection key enables independent public verification, but also gives adversaries a target signal to attack; retaining a private key allows such manipulation to be detected Milis et al., [27].
References
- [1]Scott Aaronson and Hendrik Kirchner. Watermarking GPT outputs, 2023.
- [2]Anthropic. How Claude marks AI-generated content, 2026. Accessed: 2026-08-13.
- [3]Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper. Accelerating large language model decoding with speculative sampling. In arXiv preprint arXiv:2302.01318, 2023.arxiv.org/abs/2302.01318
- [4]Miranda Christ, Sam Gunn, and Or Zamir. Undetectable watermarks for language models. Cryptology ePrint Archive, 2023.arxiv.org/abs/2306.09194
- [5]Evan Crothers, Nathalie Japkowicz, and Herna Viktor. Machine generated text: A comprehensive survey of threat models and detection methods. arXiv preprint arXiv:2210.07321, 2022.arxiv.org/abs/2210.07321
- [6]Majid Daliri, Christopher Musco, and Ananda Theertha Suresh. Coupling without communication and drafter-invariant speculative decoding, 2024.arxiv.org/abs/2408.07978
- [7]Sumanth Dathathri, Abigail See, Sumedh Ghaisas, Po-Sen Huang, Rob McAdam, Johannes Welbl, Vandana Bachani, Alex Kaskasoli, Robert Stanfordth, Tatiana Matejovicova, et al. Scalable watermarking for identifying large language model outputs. Nature, 634(8035):818–823, 2024.DOI
- [8]European Union. Regulation (EU) 2024/1689 of the European Parliament and of the Council laying down harmonised rules on artificial intelligence (AI Act), 2024.
- [9]Xiaoyan Feng, Yanjun Zhang, He Zhang, Leo Yu Zhang, and Shirui Pan. Tracing provenance and detecting tampering with complementary llm watermarks. arXiv preprint arXiv:2608.12713, 2026.arxiv.org/abs/2608.12713
- [10]Pierre Fernandez, Antoine Chaffin, Karim Tit, Vivien Chapellier, and Teddy Furon. Three bricks to consolidate watermarks for large language models. 2023 IEEE International Workshop on Information Forensics and Security (WIFS), 2023.arxiv.org/abs/2308.00113
- [11]Pierre Fernandez, Tom Sander, Hady Elsahar, Hongyan Chang, Tomáš Souček, Valeriu Lacatusu, Tuan Tran, Sylvestre-Alvise Rebuffi, and Alexandre Mourachko. How good is post-hoc watermarking with language model rephrasing? arXiv preprint arXiv:2512.16904, 2025.arxiv.org/abs/2512.16904
- [12]Thibaud Gloaguen, Robin Staab, and Martin Vechev. AutoMark: Enabling autoresearch to discover better LLM watermarks, 2026.
- [13]Haiyun He, Yepeng Liu, Ziqiao Wang, Yongyi Mao, and Yuheng Bu. Theoretically grounded framework for LLM watermarking: A distribution-adaptive approach. In Advances in Neural Information Processing Systems, pages 114528–114564, 2025.arxiv.org/abs/2410.02890
- [14]Weiqing He, Xiang Li, Li Shen, Weijie Su, and Qi Long. Improving the trade-off between watermark strength and speculative sampling efficiency for language models. In ICLR, 2026. arXiv:2602.01428.arxiv.org/abs/2602.01428
- [15]Zhengmian Hu and Heng Huang. Inevitable trade-off between watermark strength and speculative sampling efficiency for language models, 2024.arxiv.org/abs/2410.20418
- [16]Zhengmian Hu, Lichang Chen, Xidong Wu, Yihan Wu, Hongyang Zhang, and Heng Huang. Unbiased watermark for large language models. arXiv preprint arXiv:2310.10669, 2023.arxiv.org/abs/2310.10669
- [17]John Kirchenbauer, Jonas Geiping, Yuxin Wen, Jonathan Katz, Ian Miers, and Tom Goldstein. A watermark for large language models. arXiv preprint arXiv:2301.10226, 2023.arxiv.org/abs/2301.10226
- [18]Szymon Kobus and Deniz Gündüz. Speculative sampling via exponential races, 2025.arxiv.org/abs/2504.15475
- [19]Rohith Kuditipudi, John Thickstun, Tatsunori Hashimoto, and Percy Liang. Robust distortion-free watermarks for language models. arXiv preprint arXiv:2307.15593, 2023.arxiv.org/abs/2307.15593
- [20]Yaniv Leviathan, Matan Kalman, and Yossi Matias. Fast inference from transformers via speculative decoding. In ICML, 2023.arxiv.org/abs/2211.17192
- [21]Baixin Li and Haiyun He. SAC-Copula: Quality-preserving watermarking for diffusion language models via smooth correlated Gumbel fields, 2026.arxiv.org/abs/2608.20839
- [22]Cheuk Ting Li and Venkat Anantharam. A unified framework for one-shot achievability via the Poisson matching lemma, 2018.
- [23]Xiang Li, Feng Ruan, Huiyuan Wang, Qi Long, and Weijie J. Su. A statistical framework of watermarks for large language models: Pivot, detection efficiency and optimal rules. The Annals of Statistics, 53(1): 322–351, 2025.DOI
- [24]Xiang Li, Garrett Wen, Xiaohong Chen, Qi Long, Arzav Jain, Florent Joly, Mike Lam, Qingquan Song, and Weijie Su. textGrain: Entropy-calibrated watermarking for language model text. Technical report accompanying OpenAI’s October 5th blog post, OpenAI, 2026.
- [25]Yanxiao Liu, Sicheng Wan, Zhan Gao, and Deniz Gündüz. Watermarkable multi-draft speculative sampling via Poisson processes, 2026.arxiv.org/abs/2609.21858
- [26]Carol Xuan Long, Dor Tsur, Claudio Mayrink Verdun, Hsiang Hsu, Haim Permuter, and Flavio P. Calmon. Optimized couplings for watermarking large language models. In IEEE International Symposium on Information Theory (ISIT), pages 1–6, 2025.arxiv.org/abs/2505.08878
- [27]Georgios Milis, Tom Sander, Tomáš Souček, Heng Huang, and Pierre Fernandez. Could LLM watermark detection be public? arXiv preprint arXiv:2610.12106, 2026.arxiv.org/abs/2610.12106
- [28]Tom Sander, Pierre Fernandez, Alain Durmus, Matthijs Douze, and Teddy Furon. Watermarking makes language models radioactive. NeurIPS, 2024.arxiv.org/abs/2402.14904
- [29]Tom Sander, Hongyan Chang, Sylvestre-Alvise Rebuffi, Tomáš Souček, Tuan Tran, Valeriu Lacatusu, Alexandre Mourachko, Surya Parimi, Christophe Ropers, Rashel Moritz, Vanessa Stark, Hady Elsahar, and Pierre Fernandez. TextSeal: A localized LLM watermark for provenance & distillation protection, 2026.arxiv.org/abs/2605.12456
- [30]Ziteng Sun, Uri Mendlovic, Yaniv Levithan, Asaf Aharoni, Jae Hun Ro, Ahmad Beirami, and Ananda Theertha Suresh. Block verification accelerates speculative decoding. In International Conference on Learning Representations, 2025.arxiv.org/abs/2403.10444
- [31]Dor Tsur, Carol Long, Claudio Mayrink Verdun, Sajani Vithana, Hsiang Hsu, Richard Chen, Haim Permuter, and Flavio Calmon. HeavyWater and SimplexWater: Distortion-free LLM watermarks for low-entropy distributions. In Advances in Neural Information Processing Systems, 2025.DOI
- [32]Yihan Wu, Zhengmian Hu, Hongyang Zhang, and Heng Huang. DiPmark: A stealthy, efficient and resilient watermark for large language models. arXiv preprint arXiv:2310.07710, 2023.
- [33]Yangxinyu Xie, Xiang Li, Tanwi Mallick, Weijie Su, and Ruixun Zhang. Debiasing watermarks for large language models via maximal coupling. Journal of the American Statistical Association, 120(551):1424–1436, 2025.arxiv.org/abs/2411.11203
- [34]Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. Defending against neural fake news. Advances in neural information processing systems, 32, 2019.arxiv.org/abs/1905.12616










