Know the Design, Pick the Attack: Sentence-Keyed Watermarks for LLMs
Authors: Jon Carmona, Jon Irureta, Jon Imaz, Aizea Lojo, Juan Martínez-Romo, Lourdes Araujo
Organizations: J. Carmona, J. Irureta, J. Imaz and A. Lojo are with IKERLAN Technology Research Centre, Basque Research and Technology Alliance (BRTA), Arrasate-Mondragón, Spain. · J. Carmona, J. Martínez-Romo and L. Araujo are with Universidad Nacional de Educación a Distancia (UNED), Madrid, Spain.
A watermark lets the provider of a language model recognise the text its model wrote, which matters more as generated text becomes hard to tell from human writing: provenance underpins academic integrity, the fight against misinformation and new regulation. Providers have started to watermark the text of their models, and to explain how their watermarks work. Explaining a watermark, however, also tells an attacker how to break it, and there are two ways to do so: reword the text to erase the mark, or learn the mark and copy it onto text the model never wrote. Each attack has been studied on its own. We study an attacker that reads the published design to choose between them: it erases the watermarks that are hard to learn and forges the ones that survive rewording. Against it, every existing watermark we compare fails. We propose KeyedLex, which reads its secret key from the grammar of the previous sentence, which rewording changes little, and whose detector does not need to recover the key exactly. It outperforms every watermark we compare on both models we test, losing about half of its signal where the best alternative loses two thirds, at no extra cost in text quality over the best-known watermarks.
Figures & tables
Fig. 1: KeyedLex balances resistance to forgery and to paraphrase. (a) Each point is a watermark, placed by how often it is forged and how much of its signal a paraphrase erases; lower left is better, and no watermark beats KeyedLex on both axes. (b) The weaker axis of each watermark, in blue when erasure decides it and in grey when forgery does; lower is better, and the axis starts at 40%. OPT-1.3B.
Watermark
Key read from
Changes
Unigram [ 9 ]
None (fixed list)
Never
KGW-1 [ 7 ]
Previous token
Every token
KGW-4 [ 7 ]
Previous tokens
Every token
SynthID [ 4 ]
Previous tokens
Every token
DiPmark [ 11 ]
Previous tokens
Every token
SIR [ 10 ]
Meaning of the prefix
Every token
TABLE I: Where each watermark reads its key from, and how often the key changes
Watermark
Context
Forgery
Erasure
Unigram [ 9 ]
None (fixed list)
Count tokens
Adaptive paraphrase
KGW-1 [ 7 ]
Previous token
Count per context
Paraphrase
KGW-4 [ 7 ]
Previous tokens
Count per context
Paraphrase
SynthID [ 4 ]
Previous tokens
Count per context
Paraphrase
DiPmark [ 11 ]
Previous tokens
Count per context
Paraphrase
SIR [ 10 ]
Meaning of the prefix
Count per cluster
Paraphrase
TABLE II: Each watermark is attacked through its context
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Parameter
Value
What it does; how it was set
Cells k
4
Groups, one list each; swept from 2 to 16
Trimmed share ρ
0.4
Worst sentences set aside; compared with no trimming
Bias δ
2
Push towards the green list; usual value, not tuned
Green share γ
0.5
Vocabulary in each list; usual value, not tuned
Temperature τ
0.3
Trust in the grammatical hint; starting value, not tuned
Tagger
spaCy 3.8
Labels word classes; small English model ( en_core_web_sm )
As watermarking of LLM-generated text enters deployment, users increasingly need to check text whose source is unknown. Existing detectors read the watermark through a specific tokenizer or embedding pipeline, and even if all providers adopted the same watermarking method, differences in these representations would leave their watermarks incompatible, and the text alone does not reveal which representation produced it. We propose ByteMark, a unified watermarking scheme that defines its signal on the UTF-8 bytes of published text. Models with different tokenizers embed this signal under one public specification and key, and a single detector verifies the text from the text and key alone. When the tokenizer or embedding model of a baseline detector is replaced, its detection degrades sharply, whereas ByteMark, which uses neither, retains its detection rate; ByteMark also remains detectable when participating models continue or rewrite the text.
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 10−3, 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.
LLM fingerprinting via watermark distillation embeds a statistical watermark signal into model weights, enabling model owners to identify their models behind black-box APIs. Revisiting a recent protocol, we find that its utility evaluation understates text quality degradation in open-ended generation, favoring overly strong watermark teachers. Weakening the watermark improves text quality but sacrifices detectability. To move beyond this trade-off, we rethink whether text watermarks designed for verifying generated text are suitable distillation teachers for model fingerprinting. Such watermarks are typically designed to remain detectable from an individual output, limiting how sparse the watermark signal can be. In contrast, fingerprint verification can aggregate signal across queries, making sparser watermark signals viable. This raises a key question: where should the sparse signal be placed? We analyze signal placement through token surprisal and show that, even at comparable watermark strength, different placements can target tokens with different plausibility under the base model. This motivates near-tie restriction, which uses top-1-relative logit gaps to restrict the watermark bias to tokens close to the base model's top prediction. Across multiple models, near-tie improves detection--quality frontiers under deployment changes, preserves higher text quality across query budgets, and further improves existing watermarking schemes when combined with them.
Jeongyeon Hwang, Anshul Nasery, Sewoong Oh +1
Pohang University of Science and Technology · University of Washington