01 / One choice
The watermark changes one token choice at a time
A tokenizer splits text into tokens. Before the model picks each new token, a function uses the demo key and recent tokens to mark some candidates as preferred.
The model gives these candidates a small boost, then picks the next token in the usual way. “Preferred” only means that a token is in this group. It does not mean better, safer, or more accurate.Run your own passage next
Figure 1 · Token decision 47 / 96
What comes after “a longer”?
- G+ passage selected11.8%25.4%
- R time14.6%10.9%
- G+ sample6.9%15.1%
- R response8.2%6.1%
A logit is the model’s score for a possible next token. This first view is an example. A live run replaces it token by token.
02 / Generate
Start with ordinary prose
The watermark does not add a phrase, metadata field, or visible symbol. Instead, it makes preferred tokens slightly more likely across many choices.
The first run downloads a smaller, compressed version of the model. You need desktop Chromium with WebGPU. The browser then generates and checks the text locally. See how to read the score
Output specimen
Watermarked generation
A useful watermark does not hide a set phrase. It makes many small choices while a model generates text. A demo key marks some possible next tokens as preferred, and the model makes these tokens slightly more likely. Each word can still look ordinary. No single choice gives strong evidence. In a longer passage, preferred tokens appear more often than chance predicts. A detector with the same key and tokenizer can rebuild the groups and measure the pattern. Edits usually weaken the evidence instead of removing it at once.
There is no visible marker in this paragraph. The pattern comes from many choices that depend on the text before them.
03 / Accumulate
One choice is not evidence
The detector uses the same tokenizer and key to check each eligible position. It then counts how often the model chose a preferred token.
The z-score shows how far the result is above chance, measured in standard deviations. The p-value estimates how often text without this watermark would reach this score or higher. It is not the probability that AI wrote the text. Change the passage and score it again
Figure 3 · Running evidence
Signal across the passage
Consistent with this exact demo key, tokenizer, and method. This is not proof of authorship.
- Eligible positions
- 96
- Preferred tokens
- 41 of 96
- Expected by chance
- 24 at γ 25%
- z-score
- 4.01 z
- Approximate p-value
- p ≈ 3.0e−5
Illustrative example values. Generate text to replace them with an exact local result.
04 / Disturb
Now change the pattern
When you edit text, its tokens can change. The text that comes before later tokens can also change. Shortening the text removes some evidence. Rewriting can replace preferred tokens with other tokens.
This tests how well this demo watermark survives edits. It does not describe Claude’s method or provide a general tool for evading detection. Read the limits
Editable copy
Change the generated text
05 / Boundaries
What this result can—and cannot—say
The result is a measurement, not a final verdict. To interpret it, you need the model, demo key, tokenizer, minimum length, and decision threshold. You also need the no-watermark assumption used to calculate the p-value.
- 1Group
The demo key and recent tokens define a preferred group of candidates.
- 2Boost
The model adds a small amount, delta (δ), to each preferred token’s logit before it picks a token.
- 3Measure
The detector rebuilds the groups and compares the chosen tokens with the result expected by chance.
The result can say
Consistent with this setup
A strong score means the text is statistically consistent with this method, key, and tokenizer. Longer text usually gives more evidence.
The result cannot say
Who wrote the text
It cannot detect all AI text, identify every model, prove authorship, or guarantee detection after major edits. The threshold needs tests on real, unwatermarked text to measure false positives.
The trust boundary
You can inspect the browser key
The user can find any key that runs in a browser. A system that proves where text came from would need separate signing and a trusted way to generate the text.
Implementation record Expand
- Model
- SmolLM2 360M Instruct, compressed q4f16_1 browser build
- Watermark family
- Research-inspired keyed green-list logit bias
- Default parameters
- γ = 0.25, δ = 2; minimum 32 eligible positions; threshold z = 4
- Detector output
- Eligible positions, preferred tokens, expected tokens, z-score, and one-sided approximate p-value
- Data handling
- Static site; prompt, demo key, output, token splitting, and scoring stay in your browser