Keyrings and TextOrca: distortion‑free watermarking with strong detection and speculative decoding support

TL;DR

Mistral AI released Keyrings, a distortion‑free watermark that preserves generation diversity by sampling from a bank of hidden keys, and TextOrca, a detector that computes a mathematically‑grounded p‑value without calibration. Both run efficiently under autoregressive and speculative decoding, achieving 91–95% detection at a 0.1% false‑positive rate while keeping quality and throughput comparable to unwatermarked models.


1. Why a new watermark matters

Existing watermarks either bias model logits (reducing quality) or collapse diversity when the same prompt is issued repeatedly. They also struggle to integrate with speculative decoding, which is now the dominant serving technique for large language models (LLMs). Keyrings solves these three problems simultaneously: it leaves the per‑step token distribution untouched, restores diversity across repeated prompts, and fits naturally into a shared‑noise speculative decoding relay.


2. Keyrings: diversity‑preserving sampling

2.1 Core mechanism – keyed Gumbel‑max

Keyrings builds on the Gumbel‑max trick, which samples a token (v^* = \arg\max_v \bigl(\log p_v + G_v\bigr)) where (G_v) are independent Gumbel noises. Instead of fresh random draws, each (G_v) is generated by a pseudorandom function (PRF) keyed on the previous tokens. Because the PRF output is uniformly distributed, the resulting token distribution is exactly (p_v); no logits are re‑weighted.

2.2 Bank of hidden keyrings

Keyrings stores (L) keyrings, each containing (m) content keys. For a request, a keyring index (\ell) is sampled uniformly, then a routing key selects one of the (m) content keys for the current context. This hidden selection means two identical prompts almost always use different keys, producing independent Gumbel noise streams and thus diverse completions.

2.3 Optional Gaussian‑copula mixing

When two requests happen to draw the same keyring, they would otherwise generate identical tokens. To mitigate this, Keyrings + Copula mixes the keyed Gaussian noise with independent private Gaussian noise at correlation (\rho). The mixture remains standard normal, so the resulting Gumbel noise stays correctly distributed, but the private component breaks token‑level collisions, increasing diversity at a modest detection cost.

2.4 Guarantees on diversity

Diversity is measured with ΔSelf‑BLEU@256 (the increase in Self‑BLEU compared to an unwatermarked baseline). Experiments on the ML4 model show that increasing (L) reduces ΔSelf‑BLEU, while the number of content keys (m) has negligible impact. With (L=16) and (m=8), Keyrings adds only +3.3 ΔSelf‑BLEU points, a level the authors consider “matched distortion”.


3. TextOrca: a closed‑form, conservative detector

3.1 Per‑token Aaronson scores

For each observed token the detector recomputes the keyed uniform draw (U_t) and maps it to a score (s_t = -\log(1-U_t)). Under the null (no watermark) (U_t\sim\text{Uniform}(0,1)) so (s_t\sim\text{Exp}(1)). When the text is watermarked, (U_t) is biased toward 1, producing larger scores. The expected excess evidence per token is (H_{1/p}-1), where (p) is the token’s model probability.

3.2 Probability‑stratified weighting

TextOrca bins tokens by their proxy probability (\hat p_t) into five intervals (e.g., ([0,0.5),[0.5,0.7),\dots)). Fixed weights (w = (1,0.4,0.2,0.03,0)) down‑weight near‑certain tokens, which contribute little evidence but add variance. The weighted sum (R_\ell) for each hidden keyring (\ell) follows a mixture of Gamma distributions, giving an exact closed‑form tail probability (q_\ell).

3.3 Bonferroni‑corrected p‑value

Because the detector does not know which of the (L) hidden keyrings generated the text, it evaluates all (L) candidates and returns [ p_{\text{Orca}} = \min\bigl(1,; L\cdot \min_{\ell}, q_\ell\bigr). ] This Bonferroni correction guarantees that the false‑positive rate never exceeds the target, regardless of the number of keyrings.

3.4 Compatibility with existing watermarks

TextOrca’s formula depends only on the per‑token (U_t) values, not on the specific sampler. Consequently it can be applied to TextSeal outputs, where it outperforms TextSeal’s official entropy‑weighted detector in 17 of 18 ML4 settings and in all 18 settings when compared to TextSeal’s unweighted detector.


4. Integration with speculative decoding

Speculative decoding drafts tokens with a fast model (q) and verifies them against the target model (p). If the draft and target use independent randomness, acceptance rates drop dramatically. Keyrings solves this by sharing the same keyed Gumbel noise field between draft and target (a shared‑noise Gumbel‑max relay). The draft selects tokens using the shared noise; the target either accepts the draft or resolves a residual choice with a single Gumbel‑max draw over the remaining noise. This preserves the exact target‑model distribution and carries the watermark signal into every accepted token.


5. Empirical results

5.1 Detection vs. diversity

Model / decoding Setting TPR @ 0.1% FPR ΔSelf‑BLEU@256
ML4 AR Keyrings m8/L16 94.2% +1.9
Keyrings + Copula m8/L4 95.1% +1.9
Keyrings + Copula m8/L16 91.3% +0.3
ML4 DSpark Keyrings m8/L16 88.4% +2.2
Keyrings + Copula m8/L4 90.3% +2.5
Qwen3.6‑27B AR (256 tokens) Keyrings + Copula m8/L4 33.2% +5.6
Qwen3.5‑9B AR Keyrings m8/L16 95.8% +1.6

Across all three models, Keyrings and Keyrings + Copula dominate prior watermarks (SynthID‑Text, textGrain, TextSeal‑2) by 29–75 percentage points at comparable diversity costs.

5.2 False‑positive control

Audits on 100 independent key banks (11 000 control responses per bank) show:

  • Mean FPR ≈ 0.098 % for Keyrings m8/L16 (median 0.091 %).
  • Mean FPR ≈ 0.104 % for Keyrings + Copula m8/L4.
  • No statistically significant excess over the 0.1 % target. In contrast, TextSeal‑2’s official entropy‑weighted detector exhibits a heavy right tail, with a worst‑case bank false‑positive rate of 5.34 %.

5.3 Quality and agentic benchmarks

On GPQA, MMLU‑Pro, HealthBench, and IFEval, the watermarked models differ from the unwatermarked control by ±2 points or less, with all Holm‑adjusted p‑values equal to 1.0. Agentic suites (Terminal‑Bench 4, DeepSWE v1.1, BrowseComp) show no significant degradation; the largest observed gap is a non‑significant ‑8.3 % on Terminal‑Bench for Keyrings + Copula m8/L16.

5.4 Serving throughput

Configuration Throughput relative to stock vLLM (AR) Throughput relative to stock vLLM (DSpark)
Keyrings / Keyrings + Copula (AR) 0.90× (single request) → 0.82× (max concurrency)
TextSeal‑2 ρ=0.95 (AR) 0.89× → 0.16×
SynthID‑Text d30 (AR) 0.66× → 0.40×
textGrain β0.9/β1 (AR) 0.52× / 0.31× → 0.21× / 0.17×
Keyrings / Keyrings + Copula (DSpark) 0.74–0.76× → 0.33×
TextSeal‑2 ρ=0.95 (DSpark) 0.56× → 0.10×

The watermark itself adds <5 % overhead at low concurrency and ≈15 % at peak concurrency for AR, while speculative decoding overhead is dominated by the relay engine rather than the watermark.


6. Formal guarantees

All probabilistic claims (exact per‑step sampling, p‑value validity, Bonferroni correction) are machine‑checked in Lean 4 + Mathlib. This provides a verifiable foundation that the watermark does not distort the model distribution and that the detector’s false‑positive bound holds under the random‑function assumption.


7. Implications and future directions

  • Deployability: Keyrings offers a drop‑in watermark for any decoder that supports Gumbel‑max sampling, with negligible impact on latency or quality, making it practical for production LLM services.
  • Robustness: The exact p‑value eliminates the need for heuristic calibration, reducing the risk of adversarial evasion.
  • Speculative decoding: The shared‑noise relay demonstrates that watermarking can coexist with the fastest serving stacks, preserving draft acceptance rates.
  • Open questions: Extending the copula mixing to higher correlations ((\rho<0.95)) could further improve diversity; integrating TextOrca with other detection pipelines (e.g., ensemble of entropy‑based detectors) may yield even higher true‑positive rates.

8. Related work

Keyrings extends distortion‑free Gumbel‑max watermarks (Aaronson 2023; Kuditipudi et al. 2024) by adding a bank of hidden keys and optional Gaussian copula mixing. TextOrca builds on per‑token Aaronson scores and replaces heuristic entropy‑based thresholds (Lee et al. 2024; Lu et al. 2024) with an exact closed‑form tail. Both contributions complement prior systems such as TextSeal 2 (Sander et al. 2026), SynthID‑Text (Dathathri et al. 2024), and textGrain (Li et al. 2026), and they address the speculative decoding trade‑off highlighted by Hu & Huang 2024.


9. References

  • Aaronson, S. (2023). Watermarking of Large Language Models.
  • Bonferroni, C. E. (1936). Teoria statistica delle classi e calcolo delle probabilità.
  • Dathathri, S. et al. (2024). Scalable Watermarking for Identifying Large Language Model Outputs (SynthID‑Text).
  • Fu, J. et al. (2024). GumbelSoft: Diversified Language Model Watermarking via the Gumbel‑Max trick.
  • Gloaguen, T., Staab, R., & Vechev, M. (2026). AutoMark: Enabling Autoresearch to Discover Better LLM Watermarks.
  • Hu, Z., & Huang, H. (2024). Inevitable Trade‑off between Watermark Strength and Speculative Sampling Efficiency for Language Models.
  • Kuditipudi, R. et al. (2024). Robust Distortion‑free Watermarks for Language Models.
  • Lee, T. et al. (2024). Who Wrote this Code? Watermarking for Code Generation (SWEET).
  • Leviathan, Y., Kalman, M., & Matias, Y. (2023). Fast Inference from Transformers via Speculative Decoding.
  • Li, X. et al. (2026). textGrain: Entropy‑Calibrated Watermarking for Language Model Text.
  • Lu, Y. et al. (2024). An Entropy‑based Text Watermarking Detection Method (EWD).
  • Maddison, C. J., Tarlow, D., & Minka, T. (2014). A Sampling*.
  • Sander, T. et al. (2026). TextSeal: A Localized LLM Watermark for Provenance & Distillation Protection.
  • Sander, T. et al. (2026). TextSeal2: Distortion‑Free LLM Watermarking with Copula Mixing and Memoryless Races.
  • Sun, Z. et al. (2024). Block Verification Accelerates Speculative Decoding.
  • Zhu, Y. et al. (2018). Texygen: A Benchmarking Platform for Text Generation Models.

All figures referenced are reproduced from the original Mistral AI post.

Sources