AivexaNewsSearch
AI news for builders and product teamsChecked every hour

How Claude Watermarks AI-Generated Text

Collected Sep 30, 2026

Anthropic recently announced that it will watermark the text output of its Claude models. Sebastian Raschka, author of the Ahead of AI newsletter and of the books Build a Large Language Model From Scratch and Build a Reasoning Model From Scratch, followed with a short social media post on the mechanism, and then expanded that explanation into a video lecture of roughly 48 minutes with more than 50 slides, accompanied by a transcript, slides and a YouTube version.

The motivation, as Raschka describes it, is attribution: when text appears somewhere on the internet, Anthropic wants to be able to say whether a given Claude model, such as Claude Opus 4.8, produced it. The mark is intended to be invisible to users, and only the company can decode it and check whether a piece of text carries its watermark. He dates Anthropic's announcement article to August 14, and notes that it is conceptual rather than mechanistic, with no figures and a link to one very technical paper, which is part of why the walkthrough goes back to basics.

The lecture's core claim is that watermarking is not an expensive add-on on top of generation but a small change inside the ordinary next-token loop. To show why, Raschka steps through how a model like a Claude or ChatGPT-style assistant produces a reply. The prompt is tokenized into token IDs outside the model, passed through the network, and the output is a vector of logits: raw scores, spanning roughly -8 or -9 up to 20 in his simplified example, one for every entry in the vocabulary. Modern models have on the order of 250,000 possible tokens, so the plotted distribution is truncated to a narrow index range for readability.

In his running example the prompt is "the capital of Germany is," and the top-scoring vocabulary index, 19,846, corresponds to Berlin. Greedy decoding would always take that highest score, but most production systems instead convert the logits with a softmax so the scores form a probability distribution summing to one, then draw a sample weighted by those probabilities. For a prompt with one obvious answer, Berlin's probability is so close to one that sampling returns it essentially every time. Top-k or top-p filtering is typically applied first so that only the highest-scoring candidates are eligible, which keeps nonsense tokens from slipping through.

Variation becomes visible when two continuations are both plausible. Raschka switches the example to "today's weather is cold," where gray and overcast have similar scores and no clear winner; repeated sampling lands on each of them about half the time. That is the familiar reason the same prompt can return slightly different answers, and each early choice propagates into everything generated afterward.

Sampling is driven by a pseudo-random number generator. Without a fixed seed it produces a different sequence on each run; with the seed set, for instance to 123, the sequence is still random-looking but reproducible run to run. This is the hinge of the whole technique. Because the draw is deterministic given the seed and the candidate scores, a party that knows the secret can recompute which tokens the sampler would have favored at each position. Watermarking, on this account, biases the choice among near-equally likely candidates in a way keyed to a secret, so the resulting text splits the difference invisibly between gray and overcast while an outsider without the key sees nothing unusual.

Raschka also spends time on why only Anthropic can read the mark, and on how watermarking can fail or be removed at all, topics he flags early as part of the lecture's scope. He frames the wider debate in practical terms: people worry that watermarking will degrade output quality, and users want to know what benefit it brings, so understanding the mechanism lets readers judge the trade-offs themselves.

A secondary thread is pedagogy. Raschka argues that coding a small language model from scratch, even now that LLMs write much of the code, is still how you learn where inside the pipeline an intervention like a watermark actually lands and what follows from placing it there. Looking at source rather than stacked abstractions, in his view, supports both learning and transparent research, and figures from his earlier from-scratch material reappear in these slides.

In practice, the design has familiar consequences for anyone building on Claude. Keys can leak, text can be paraphrased or rewritten by another system, and short passages offer few sampling decisions to inspect, so detection is likely to be a probabilistic signal rather than a proof; that inference follows from the sampling mechanics rather than from anything Anthropic has said here. For product teams, the practical question is provenance: generated copy may now carry an invisible, company-readable label, and downstream tooling that rewrites or restructures output could interact with it in ways worth testing before launch.

Why it matters: developers and product teams shipping Claude-generated text now work with a system whose sampling step may be keyed, and Raschka's explainer gives them the mental model to reason about quality effects, detection, and removal. Teams that route model output through paraphrasers, summarizers or human editing should treat provenance as an open design question rather than a solved one. Expect interest in watermark-aware pipelines to grow, though whether detection holds up under heavy rewriting is, by inference, still an empirical matter.

Read at Ahead of AI

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

A 48-minute video walkthrough of token sampling, watermark detection, and removal