Lab
AI Text Watermarking Lab
Generate, detect, and edit a SynthID-style statistical watermark for AI text, entirely in your browser.
Research model, not a Claude detector
What this is
A keyed generation and detection experiment. The generator chooses among plausible words using the preceding context and your key. The detector recomputes those choices and asks whether the observed pattern is unlikely under a 50/50 null model.
What it demonstrates
- The matching key reveals a distributed statistical signal.
- A different key makes the same text look like ordinary noise.
- Editing and shortening reduce the amount of usable evidence.
Step 1
Choose the experiment key
The key stays in this browser tab and is not saved or transmitted.
Tournament depth: each layer doubles the candidate draws and adds another keyed knockout round. Three layers means 8 draws → 4 winners → 2 finalists → 1 selected word.
Step 2
Generate or edit a sample
Select a key, then generate a keyed or control sample.
Step 3
Detection result
Waiting for a sample
Generate or paste text and analyze it with the selected lab key.
Token evidence map
What the key does
A color is not permanently attached to a word. For every eligible word, the detector combines four inputs and computes one binary g-value per tournament layer:
Changing the key changes those bits, so the same passage gets a different color pattern. The preceding words matter too: the same word can be green in one sentence and red in another.
How to read the colors
- Green
- At least two-thirds of its keyed bits are 1.
- Amber
- Its keyed bits are mixed between 0 and 1.
- Red
- At most one-third of its keyed bits are 1.
- Gray
- Not scored: it is outside the lab vocabulary or repeats a context.
Red words are expected. The generator biases the whole passage toward candidates with more positive bits; it does not force every word to be green. Detection comes from the cumulative excess of positive bits across many eligible words, compared with the 50% null expectation.
Word inspector
hover · focus · tap
Select a colored word
Analyze a passage, then inspect a colored word to compare its alternatives.
Future integration
Claude production watermark
The adapter is intentionally unavailable until Anthropic publishes an official detector API and response contract.
How this generator works
At each flexible position, the generator has several plausible next words. It hashes your key, the preceding context, the candidate word, and a layer number to produce binary g-values. Candidates compete in pairs: a candidate with g = 1 defeats one with g = 0, while ties are resolved randomly. Each new round uses the next layer's g-value until one candidate remains. A control sample chooses from the same alternatives without consulting the key.
The detector repeats that calculation and tests the observed positive-g rate against an expected rate of 50%. Repeated contexts are counted only once. This is intentionally readable teaching code, not Google's or Anthropic's production implementation.
| Depth | Candidate draws | Knockout rounds | Bits scored per word |
|---|---|---|---|
| 1 layer | 2 | 1 | 1 |
| 2 layers | 4 | 2 | 2 |
| 3 layers | 8 | 3 | 3 |
| 4 layers | 16 | 4 | 4 |
More layers create stronger selection pressure and give the detector more keyed observations per eligible word. They do not mean extra writing passes or visible layers in the final text.
Try the key-swap experiment
- Generate a keyed sample and note its colors and z-score.
- Change one character in the key without changing the text.
- Analyze again: the colors reshuffle and the aggregate signal falls.
- Restore the original key and analyze once more to recover the signal.
Can I watermark text I already wrote?
Yes, but the watermark is added through word choice—not by attaching a hidden character or file marker. You need to rewrite enough flexible parts of the text using alternatives favored by your key.
- Choose a word or phrase that can change without changing the meaning.
- List several natural alternatives that fit the sentence.
- Score each alternative using the key, preceding context, candidate, and layer.
- Prefer a higher-scoring alternative that still sounds natural.
- Continue from left to right and periodically analyze the complete passage.
The team inspected the system.
In this hypothetical choice, the key favors “reviewed.” With another key or preceding context, the ranking would probably change.
Human judgment remains important: the highest-scoring replacement may be grammatically valid but wrong for the intended tone or meaning. This lab's generator already has curated alternatives; it does not currently create alternatives for arbitrary pasted prose.
Browse the lab's choice vocabulary
These are the generator's actual context-specific choice groups—not a general thesaurus. At each flexible position, the generator samples from one row and uses the key to favor candidates with stronger g-values.
54 choice groups · 189 unique words
review assessment analysis evaluation examined studied considered inspected service system platform application several multiple various some implicit unstated informal unverified mapped traced documented charted changed revised adjusted updated design plan model approach initial first early opening small limited compact focused inspect review examine study later subsequent follow-up second additional extra new further responded behaved performed reacted proof certainty confirmation fact chosen selected configured declared stronger clearer better greater many numerous repeated additional fewer limited scarcer reduced weaker harder uncertain fragile separate distinct isolated apart settings parameters configuration options returned fell moved settled expected ordinary baseline normal reduced weakened diluted lowered difficult hard unlikely impractical little minimal limited negligible characters spacing markup metadata usable eligible available meaningful interpret understand evaluate judge locally privately entirely directly retain store upload transmit simple small readable compact production provider commercial deployed supported documented stable verified calibrated interpreted reported validated disabled unavailable separate inactive simulation demonstration model prototype different new changed separate scores measurements values results visible concrete clear tangible sounds appears reads feels authorship style origin provenance keyed statistical configured watermark practical hands-on useful focused private secret production internal unusual strong notable elevated particular selected given specific observable interactive measurable accessible explicit visible documented clear multiple several different varied broad general strong confident reproduce repeat verify audit inputs parameters settings configuration Common questions about the signal
Is one green word evidence?
No. Any individual word can be green by chance. The evidence is the excess of positive bits accumulated over many eligible words.
Is there a secret list of green words?
No. Color depends on the key, preceding context, word, and layer. A word that is green here can be red somewhere else.
Where do the vocabulary and alternatives come from?
They are hand-curated in this lab's source code. Each flexible position
has a small choice(...) group of plausible alternatives, such as “review,”
“assessment,” “analysis,” and “evaluation.” The eligible vocabulary is the union
of those groups. The lab does not call a thesaurus or language model, and the alternatives
are context-specific rather than guaranteed synonyms everywhere.
Why does changing one word affect later words?
The preceding words are part of each calculation. An edit can change the context—and therefore the colors—for several following tokens.
How much text is enough?
This lab requires at least 80 scored observations. Observations are keyed bits, not total words, so the required passage length depends on how many words are eligible and how many layers you select.
What happens if I edit the text?
Formatting alone usually changes little here. Replacing or removing scored words can weaken or reshape the signal, while context-changing edits can affect later scores too. Reanalyze after each edit to measure the result.
Does the key need to stay secret?
Not for this teaching exercise. In a real provenance system, the embedding key would normally be controlled by the provider: anyone who has the key and algorithm could generate text that matches its signal.
Can the lab detect AI writing without the key?
No. It verifies agreement with this lab's key and vocabulary model. It does not estimate whether arbitrary prose was written by AI, Claude, or a person.
Reading the statistics
The z-score measures how far the observed positive-g rate sits above the null expectation in standard-error units. The one-sided p-value asks how often an unwatermarked sample would produce a score at least this large under this lab's simplified assumptions. The lab calls z ≥ 3 strong evidence and z ≥ 2 weak evidence; fewer than 80 observations is reported as insufficient.
Limits and privacy
- The eligible vocabulary is specific to this built-in research generator.
- A score on arbitrary pasted prose is not an AI-authorship judgment.
- The educational hash is deterministic but is not a cryptographic PRF.
- Your text, key, and results remain in the browser and are not persisted.
- The future Claude adapter currently sends no network request.