<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SynthID on Yenslife's Blog</title><link>https://blog.yenslife.top/en/tags/synthid/</link><description>Recent content in SynthID on Yenslife's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Tue, 22 Sep 2026 11:15:51 +0800</lastBuildDate><atom:link href="https://blog.yenslife.top/en/tags/synthid/index.xml" rel="self" type="application/rss+xml"/><item><title>SynthID-Text Paper Notes: Scalable watermarking for identifying large language model outputs</title><link>https://blog.yenslife.top/en/post/synthid-text-paper-note/</link><pubDate>Tue, 22 Sep 2026 11:15:51 +0800</pubDate><guid>https://blog.yenslife.top/en/post/synthid-text-paper-note/</guid><description>&lt;img src="https://blog.yenslife.top/post/synthid-text-paper-note/fig2-bottom-tournament.png" alt="Featured image of post SynthID-Text Paper Notes: Scalable watermarking for identifying large language model outputs" /&gt;&lt;h1 id="scalable-watermarking-for-identifying-large-language-model-outputs"&gt;Scalable watermarking for identifying large language model outputs
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;The original SynthID-Text paper&lt;/li&gt;
&lt;li&gt;Published online: 23 October 2024 in Nature&lt;/li&gt;
&lt;/ul&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: These are my personal notes written while preparing a seminar presentation. They exist mainly to help me understand the paper and are not a rigorous paper review. There may be misunderstandings or imprecise statements, and the math derivations are my own re-derived versions. If you spot a mistake, feel free to point it out in the comments. I recommend reading this alongside the &lt;a class="link" href="https://www.nature.com/articles/s41586-024-08025-4" target="_blank" rel="noopener"
 &gt;original paper&lt;/a&gt;.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;LLMs can already synthesize high-quality text, and sometimes it is hard to tell apart from what humans write. AI slop like this flooding the internet could have a huge impact on the whole information and knowledge ecosystem. It would be great if we could trace where text came from (Provenance), which is why watermarking matters. We want to know what the source of a piece of text actually is, and watermarking is a handy tool for that, for both text and images.&lt;/p&gt;
&lt;p&gt;The reason I looked at SynthID Image and SynthID Text is that both are Google papers, and rather than papers they feel more like products backed by academic theory. Anthropic has also announced that text generated by their models now carries a watermark (&lt;a class="link" href="https://www.anthropic.com/news/claude-text-watermark" target="_blank" rel="noopener"
 &gt;official announcement&lt;/a&gt;). Maybe I can find some ideas here for my master&amp;rsquo;s thesis, using watermarking as a tool.&lt;/p&gt;
&lt;p&gt;What makes SynthID nice is that it does not change the LLM training pipeline at all; it only modifies the sampling step of the LLM. The idea should be similar to KGW&amp;rsquo;s red/green tokens, but it seems to add some enhancements. To make watermarking deployable at scale, SynthID-Text adopts a strategy compatible with speculative sampling, which is an LLM inference acceleration technique (the idea of predicting the tokens that are about to come out).&lt;/p&gt;
&lt;p&gt;The authors found experimentally that SynthID does not even degrade the original LLM&amp;rsquo;s capabilities. They ran a live experiment analyzing user feedback on nearly 20 million Gemini responses to see whether the watermark preserves text quality (though Gemini&amp;rsquo;s reputation has not been great lately, so I guess they are running experiments again, haha).&lt;/p&gt;
&lt;p&gt;The wording in the introduction here is &amp;ldquo;identification and attribution of LLM text is critical to ensure safe and responsible use of the technology&amp;rdquo;, rather than Provenance.&lt;/p&gt;
&lt;p&gt;There are currently a few ways to achieve this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;retrieval-based approach: keep a record of all generated text and compare the text under inspection against it. But there are privacy concerns, because every interaction with the LLM has to be stored.&lt;/li&gt;
&lt;li&gt;post hoc detection: use the statistical features of the text itself, or train an additional classifier. The advantage is that no generation records need to be kept; the downside is potentially high computational cost and unstable performance, with poor results on out-of-domain data (data outside the training distribution) and high false positives.&lt;/li&gt;
&lt;li&gt;text watermarking: insert marks into the generated text that are invisible to the naked eye, which can be further divided into three approaches
&lt;ul&gt;
&lt;li&gt;generative watermarking: add the watermark during generation&lt;/li&gt;
&lt;li&gt;edit-based watermarking: add the watermark to text after it has been generated&lt;/li&gt;
&lt;li&gt;data-driven watermarking: modify the LLM&amp;rsquo;s training data&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Edit-based watermarking relies on rule-based text transformations such as synonym substitution or inserting invisible Unicode characters (probably something like ASCII smuggling).&lt;/p&gt;
&lt;p&gt;Data-driven watermarking uses a trigger phrase during training; the LLM only outputs watermarked content when it sees this trigger, which feels like planting a watermark backdoor.&lt;/p&gt;
&lt;p&gt;So SynthID uses generative watermarking, because one of the requirements is that Google wants fine-grained control over the effect on text even at large scale while keeping computational cost low. The authors also say that no perfectly reliable text detection method exists.&lt;/p&gt;
&lt;p&gt;SynthID-Text is actually built on existing watermarking components, but it adopts a new sampling method called Tournament Sampling. SynthID-Text can be configured in two modes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;non-distortionary: aims to preserve text quality&lt;/li&gt;
&lt;li&gt;distortionary: degrades text quality but makes the watermark easier to detect&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="watermarking-with-synthid-text"&gt;Watermarking with SynthID-Text
&lt;/h2&gt;&lt;p&gt;Here x is an input text sequence containing &lt;span class="math math-inline"&gt;$t - 1$&lt;/span&gt; tokens from vocabulary &lt;span class="math math-inline"&gt;$V$&lt;/span&gt;
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$x_{&amp;lt;t} = x_1, \dots, x_{t-1},$$&lt;/div&gt;&lt;p&gt;
The LLM computes the probability distribution of the next token based on &lt;span class="math math-inline"&gt;$x_{&amp;lt;t}$&lt;/span&gt;
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$p_{\text{LM}}(\cdot \mid x_{&amp;lt;t}).$$&lt;/div&gt;&lt;p&gt;This process is shown in the top half of figure 1.&lt;/p&gt;
&lt;p&gt;&lt;img alt="figure1" class="gallery-image" data-flex-basis="466px" data-flex-grow="194" height="1302" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/fig1-generative-watermark.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/fig1-generative-watermark_hu_5a4287f8d0e06e5.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/fig1-generative-watermark_hu_65952a71426e28bc.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/fig1-generative-watermark_hu_2895cbe5a8f82afa.png 2400w, https://blog.yenslife.top/post/synthid-text-paper-note/fig1-generative-watermark.png 2530w" width="2530"&gt;&lt;/p&gt;
&lt;p&gt;Such a generative watermark can be broken into three components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;random seed generator&lt;/li&gt;
&lt;li&gt;sampling algorithm&lt;/li&gt;
&lt;li&gt;scoring function&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As shown in the bottom half of figure 1, at each step &lt;span class="math math-inline"&gt;$t$&lt;/span&gt; the random seed generator produces a random seed &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt;, which may be derived from the preceding text plus a key. The sampling algorithm then samples the next token based on &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$P_{LM}(\cdot | x_{&amp;lt;t})$&lt;/span&gt;. The key point is that this sampling algorithm creates correlations between &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt;, so the output text carries a statistical signal and becomes watermarked text.&lt;/p&gt;
&lt;p&gt;A sliding window is used to take the most recent &lt;span class="math math-inline"&gt;$H$&lt;/span&gt; tokens and hash them together with the key to get &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt;. This is shown in the top half of figure 2, and the formula below uses &lt;span class="math math-inline"&gt;$H=4$&lt;/span&gt;. That said, a sliding window is not strictly required. Everything up to this point is the same as KGW; the only difference is the tournament sampling method mentioned earlier, which we will get to shortly.&lt;/p&gt;
&lt;div class="math math-block"&gt;$$r_t = \text{Hash}(x_{t-4}, x_{t-3}, x_{t-2}, x_{t-1}, k),$$&lt;/div&gt;&lt;p&gt;&lt;img alt="figure 2 top half" class="gallery-image" data-flex-basis="708px" data-flex-grow="295" height="728" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/fig2-top-seed-generator.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/fig2-top-seed-generator_hu_939942cd49dd54a9.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/fig2-top-seed-generator_hu_8da926ba318b68ff.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/fig2-top-seed-generator.png 2150w" width="2150"&gt;&lt;/p&gt;
&lt;h3 id="synthid-texts-tournament-sampling-approach"&gt;SynthID-Text’s Tournament sampling approach
&lt;/h3&gt;&lt;p&gt;A Tournament means letting candidate tokens compete against each other. First we define the number &lt;span class="math math-inline"&gt;$m$&lt;/span&gt; of watermark functions g to be used. On the right side of the top half of figure 2 there are &lt;span class="math math-inline"&gt;$m=3$&lt;/span&gt; functions &lt;span class="math math-inline"&gt;$g_1$&lt;/span&gt; &lt;span class="math math-inline"&gt;$g_2$&lt;/span&gt; &lt;span class="math math-inline"&gt;$g_3$&lt;/span&gt;, which are independent pseudorandom number functions.&lt;/p&gt;
&lt;p&gt;Each function g gives a score, written as &lt;span class="math math-inline"&gt;$g_{l}(x_t, r_t)$&lt;/span&gt;; in the figure 2 example the output is only 0 or 1. In other words, the same token may get different outputs under different watermark functions. From here on I will refer to the score produced by function g as the &lt;code&gt;g-score&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The bottom half of figure 2 shows the tournament process. We first define the number of candidates to sample, &lt;span class="math math-inline"&gt;$m$&lt;/span&gt;, and sample &lt;span class="math math-inline"&gt;$M=2^m$&lt;/span&gt; tokens from the LLM&amp;rsquo;s output distribution; the same token may be picked multiple times. In the figure below &lt;span class="math math-inline"&gt;$m$&lt;/span&gt; is 3, so there are eight candidates, four of which are duplicates. &lt;span class="math math-inline"&gt;$m=3$&lt;/span&gt; means there will be 3 rounds of competition. In each round the higher score wins, ties are broken randomly, and the final winner becomes &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="figure2 bottom half" class="gallery-image" data-flex-basis="494px" data-flex-grow="205" height="934" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/fig2-bottom-tournament.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/fig2-bottom-tournament_hu_92f240108ec417fc.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/fig2-bottom-tournament_hu_b8de37d119afc8d9.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/fig2-bottom-tournament.png 1924w" width="1924"&gt;&lt;/p&gt;
&lt;p&gt;The authors mentioned earlier that this method can be used when you do not have access to the LLM weights. At first I thought, doesn&amp;rsquo;t this still require access to the probability distribution? Then I remembered that the &lt;code&gt;openai-python&lt;/code&gt; package has a parameter &lt;code&gt;n&lt;/code&gt; that generates multiple independent completions, but that is not per-token, so&amp;hellip; I am not sure how this would work in a fully black-box setting. Wait, I wonder whether this is something I could try, but it would be similar to what &lt;a class="link" href="https://arxiv.org/abs/2410.02099" target="_blank" rel="noopener"
 &gt;A Watermark for Black-Box Language Models&lt;/a&gt; describes, with a very large inference cost.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The purpose of the n parameter of create in the openai-python source code; it still cannot sample token by token, probably because that would drag down the server’s inference speed significantly" class="gallery-image" data-flex-basis="1318px" data-flex-grow="549" height="344" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/openai-python-n-param.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/openai-python-n-param_hu_925a06acf843894b.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/openai-python-n-param_hu_79c85d33e25e5c97.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/openai-python-n-param.png 1890w" width="1890"&gt;&lt;/p&gt;
&lt;p&gt;By now it is easy to see that the biggest difference between SynthID-Text and KGW is that SynthID-Text does not need to modify the logits (see the figure below, which I captured from step 4 of algorithm 2 in the original KGW paper). KGW directly treats the LLM output after modifying the logits as the watermarked text; SynthID instead samples more candidates and lets the one with the higher g function value win (and it has to win every round). Modifying logits the way KGW does can easily affect output quality, whereas SynthID is less likely to, which will be covered in a later section.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Captured from step 4 of algorithm 2 in the original KGW paper, showing what modifying logits means" class="gallery-image" data-flex-basis="551px" data-flex-grow="229" height="654" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/kgw-algorithm2-step4.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/kgw-algorithm2-step4_hu_4f61e67a13717c36.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/kgw-algorithm2-step4.png 1504w" width="1504"&gt;&lt;/p&gt;
&lt;h3 id="watermark-detection"&gt;Watermark detection
&lt;/h3&gt;&lt;p&gt;Detection is very simple: just compute the &lt;code&gt;g-score&lt;/code&gt; of the suspicious text, because the sampling favors tokens with high &lt;code&gt;g-score&lt;/code&gt;. The formula is:
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$\text{Score}(x) = \frac{1}{mT} \sum_{t=1}^{T} \sum_{\ell=1}^{m} g_\ell(x_t, r_t).$$&lt;/div&gt;&lt;p&gt;Here m is the number of g functions and T is the number of tokens; it is simply the average of the scores of every token in every round. If the Score is abnormally high, the text is very likely SynthID-Text output.&lt;/p&gt;
&lt;p&gt;Two factors affect watermark detection performance. One is text length: the longer the text, the more accurate the detection. The other is entropy, meaning how certain the model is about the next token. If the LLM distribution has very low entropy, the model gets almost the same response every time it samples. An intuitive example: if I tell ChatGPT to generate 100 a&amp;rsquo;s, how could it possibly produce a b? How do you watermark those 100 a&amp;rsquo;s? Conversely, if you ask it to write a novel, the possibilities are extremely diverse and the text is long. This is exactly the same problem other watermarking methods face.&lt;/p&gt;
&lt;p&gt;The authors mention that many factors affect the entropy of the LLM distribution. Larger models are more confident about their outputs, so entropy is lower. RLHF may also reduce entropy, a phenomenon also known as mode collapse (a term often used with GAN models). The prompt, as in my earlier example, matters too, as does temperature, and many other things.&lt;/p&gt;
&lt;p&gt;Increasing the number of Tournament layers m lets each token provide more watermark evidence while reducing the variance of the Score formula. But detection ability does not grow indefinitely with more layers (intuitively, later layers have little diversity left to choose from, since earlier layers have already made many selections).&lt;/p&gt;
&lt;p&gt;Unless otherwise stated, &lt;span class="math math-inline"&gt;$m$&lt;/span&gt; is set to &lt;span class="math math-inline"&gt;$30$&lt;/span&gt; in this paper&amp;rsquo;s experiments.&lt;/p&gt;
&lt;h3 id="preserving-the-quality-of-generative-text"&gt;Preserving the quality of generative text
&lt;/h3&gt;&lt;p&gt;A term worth mentioning here is &amp;ldquo;non-distortionary&amp;rdquo;. This term has been somewhat confusing in past literature, so the authors define text distortion in several levels from weakest to strongest. The weakest is single-token non-distortionary: when we average over the random seed &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt;, the distribution sampled by the watermark sampling algorithm must equal the distribution sampled from &lt;span class="math math-inline"&gt;$P_{LM}(\cdot|x_{&amp;lt;t})$&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;I did not quite get it at first, but once I thought carefully about how one would verify this it clicked: you just generate many different &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt;, run the sampling algorithm with each of these &lt;span class="math math-inline"&gt;$r_t$&lt;/span&gt;, and average the resulting text.&lt;/p&gt;
&lt;p&gt;Stronger non-distortionary definitions extend to longer spans of tokens rather than a single token, possibly the whole sequence. That is, going from &lt;span class="math math-inline"&gt;$P(x_t)$&lt;/span&gt; to requiring that &lt;span class="math math-inline"&gt;$P(x_1, x_2, ..., x_t)$&lt;/span&gt; all match the LLM&amp;rsquo;s distribution. (This is actually the distortion-free concept mentioned in &lt;a class="link" href="https://arxiv.org/abs/2410.02099" target="_blank" rel="noopener"
 &gt;A Watermark for Black-Box Language Models&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;As for why SynthID-Text can achieve single-token non-distortion, Supplementary Information Section G.1 proves that when each match in the tournament has exactly two competitors, it has the single-token non-distortionary property. With more than two, it cannot be non-distortionary.&lt;/p&gt;
&lt;h4 id="proof-that-more-than-2-competitors-cannot-be-non-distortionary"&gt;Proof that more than 2 competitors cannot be non-distortionary:
&lt;/h4&gt;&lt;p&gt;Suppose the LLM samples &lt;span class="math math-inline"&gt;$N$&lt;/span&gt; times from a vocabulary with only two tokens, &lt;span class="math math-inline"&gt;$V=\{a,b\}$&lt;/span&gt;, where &lt;span class="math math-inline"&gt;$a$&lt;/span&gt; has probability &lt;span class="math math-inline"&gt;$p$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$b$&lt;/span&gt; has probability &lt;span class="math math-inline"&gt;$1-p$&lt;/span&gt;. Among the &lt;span class="math math-inline"&gt;$N$&lt;/span&gt; samples, the number of times &lt;span class="math math-inline"&gt;$a$&lt;/span&gt; appears, &lt;span class="math math-inline"&gt;$i$&lt;/span&gt;, follows a binomial distribution &lt;span class="math math-inline"&gt;$Binomial(N,p)$&lt;/span&gt;. What we want to compute is the probability &lt;span class="math math-inline"&gt;$p_{wm}(a)$&lt;/span&gt; that &lt;span class="math math-inline"&gt;$a$&lt;/span&gt; is ultimately selected as &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt;, and after taking the expectation over &lt;span class="math math-inline"&gt;$r$&lt;/span&gt; we hope it equals &lt;span class="math math-inline"&gt;$p$&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Consider three cases&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a is picked 0 times, i.e. &lt;span class="math math-inline"&gt;$(1-p)^N \times 0=0$&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;a is picked N times, i.e. &lt;span class="math math-inline"&gt;$p^N\times 1=p^N$&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;both a and b are picked, which is the binomial expression that follows; the part after it is the g function value, and in case of a tie it is simply &lt;span class="math math-inline"&gt;$\frac{i}{N}$&lt;/span&gt; because the winner is picked at random.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Take the expectation over r.&lt;/strong&gt; Since &lt;span class="math math-inline"&gt;$p^N$&lt;/span&gt; and the binomial part have nothing to do with r, they can be pulled out, so we are effectively taking the expectation of the last term. Here &lt;span class="math math-inline"&gt;$C_{f_g}$&lt;/span&gt; is the Collision probability (the probability of a tie). Using indicator functions, the expectation of an indicator function is exactly the probability of that event, which is where &lt;span class="math math-inline"&gt;$\frac{1-C_{f_g}}{2}$&lt;/span&gt; comes from: subtracting &lt;span class="math math-inline"&gt;$C_{f_g}$&lt;/span&gt; from 1 leaves the probability &lt;span class="math math-inline"&gt;$P(g_1(a) &amp;gt; g_1(b))&amp;#43;P(g_1(a) &amp;lt; g_1(b))$&lt;/span&gt;, and the hash function is designed to be fair, so we can divide by two directly.
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$\begin{aligned}
\mathbb{E}_r \left[ p_{\mathrm{wm}}(a \mid p_{\mathrm{LM}}, r, f_g, N, 1) \right] 
&amp;amp;= \mathbb{E}_r \left[ p^N &amp;#43; \sum_{i=1}^{N-1} \binom{N}{i} p^i (1-p)^{N-i} \left[ \mathbb{1}_{g_1(a, r) &amp;gt; g_1(b, r)} &amp;#43; \mathbb{1}_{g_1(a, r) = g_1(b, r)} \frac{i}{N} \right] \right] \\
&amp;amp;= p^N &amp;#43; \sum_{i=1}^{N-1} \binom{N}{i} p^i (1-p)^{N-i} \left[ \frac{1 - C_{f_g}}{2} &amp;#43; C_{f_g} \frac{i}{N} \right]
\end{aligned}$$&lt;/div&gt;&lt;p&gt;
When expanded, this expectation looks like &lt;span class="math math-inline"&gt;$c_0\cdot p^0 &amp;#43; c_1\cdot p^1 &amp;#43; ...c_N \cdot p^N$&lt;/span&gt;, and this thing must be identically equal (Identically Equal, holding for all possible values of the variable) to &lt;span class="math math-inline"&gt;$p$&lt;/span&gt; (that is, &lt;span class="math math-inline"&gt;$1\cdot p^1$&lt;/span&gt;) to satisfy the non-distortionary requirement. In other words, for this to hold, by the Polynomial Identity Theorem, &lt;span class="math math-inline"&gt;$c_1$&lt;/span&gt; must be 1 and all other coefficients must be 0. If we can find any other coefficient that is non-zero, we have a contradiction.&lt;/p&gt;
&lt;p&gt;Expanding and computing the &lt;span class="math math-inline"&gt;$p^2$&lt;/span&gt; coefficient: here &lt;span class="math math-inline"&gt;$N&amp;gt;2$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$C_{f_g} \neq 1$&lt;/span&gt;, so it is non-zero, which is a contradiction.&lt;/p&gt;
&lt;div class="math math-block"&gt;$$\begin{aligned} &amp;amp;\sum_{i=1}^{2} \binom{N}{i} \binom{N-i}{2-i} (-1)^{2-i} \left[ \frac{1 - C_{f_g}}{2} &amp;#43; C_{f_g} \frac{i}{N} \right] \\ &amp;amp;= - N(N-1) \left[ \frac{1 - C_{f_g}}{2} &amp;#43; C_{f_g} \frac{1}{N} \right] &amp;#43; \frac{N(N-1)}{2} \left[ \frac{1 - C_{f_g}}{2} &amp;#43; C_{f_g} \frac{2}{N} \right] \\ &amp;amp;= \frac{N(N-1)}{4} \left[ C_{f_g} - 1 \right] \end{aligned}$$&lt;/div&gt;&lt;h4 id="proof-that-a-layer-with-two-competing-samples-is-always-non-distortionary"&gt;Proof that a layer with two competing samples is always non-distortionary:
&lt;/h4&gt;&lt;p&gt;This is the definition of &lt;span class="math math-inline"&gt;$p_{wm}$&lt;/span&gt; for a single layer (&lt;span class="math math-inline"&gt;$m=1$&lt;/span&gt;). The numerator is &amp;ldquo;the probability that, among &lt;span class="math math-inline"&gt;$N$&lt;/span&gt; samples, every sample&amp;rsquo;s score is less than or equal to that of &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt;&amp;rdquo; minus &amp;ldquo;the probability that, among &lt;span class="math math-inline"&gt;$N$&lt;/span&gt; samples, every sample&amp;rsquo;s score is strictly less than that of &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt; (meaning the maximum score is lower than &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt;&amp;rsquo;s)&amp;rdquo;. Their difference is the probability that the maximum score is exactly &lt;span class="math math-inline"&gt;$g_1(x_t, r)$&lt;/span&gt;. The denominator is the total probability of all tokens with the same g-value as &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt; (including &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt; itself).&lt;/p&gt;
&lt;div class="math math-block"&gt;$$p_{wm}(x_t \mid p, r, f_g, N, 1) = \begin{cases}
p(x_t) \left( \frac{p(V \le g_1(x_t, r))^N - p(V &amp;lt; g_1(x_t, r))^N}{p(V = g_1(x_t, r))} \right) &amp;amp; \text{if } p(x_t) \neq 0 \\
0 &amp;amp; \text{if } p(x_t) = 0.
\end{cases}$$&lt;/div&gt;&lt;p&gt;
It can also be thought of as:&lt;/p&gt;
&lt;div class="math math-block"&gt;$$p_{\mathrm{wm}}(x_t) = \underbrace{\left[ p\left(V^{\le g_1(x_t,r)}\right)^N - p\left(V^{&amp;lt; g_1(x_t,r)}\right)^N \right]}_{\text{probability that the max score is exactly } g_1(x_t, r)} \times \underbrace{\frac{p(x_t)}{p\left(V^{= g_1(x_t,r)}\right)}}_{\text{probability that } x_t \text{ wins among the tied tokens}}$$&lt;/div&gt;&lt;p&gt;Substituting &lt;span class="math math-inline"&gt;$N=2$&lt;/span&gt;, it can be written as follows: the original LLM probability multiplied by &amp;ldquo;the probability of tokens in the Vocabulary whose score equals that of &lt;span class="math math-inline"&gt;$x_t$&lt;/span&gt;&amp;rdquo; + &amp;ldquo;the probability of tokens whose score is greater or smaller&amp;rdquo;. The reason we can directly write &lt;span class="math math-inline"&gt;$2p(V^{g_1(x_t,r)})$&lt;/span&gt; is that this factor of 2 comes purely from algebra: &lt;span class="math math-inline"&gt;$\le$&lt;/span&gt; can be split into &lt;span class="math math-inline"&gt;$&amp;lt;$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$=$&lt;/span&gt;, so &lt;span class="math math-inline"&gt;$A&amp;#43;B = (B &amp;#43; p(V^{=})) &amp;#43; B$&lt;/span&gt; yields an extra copy of &lt;span class="math math-inline"&gt;$p(V^{&amp;lt;g_1(x_t,r)})$&lt;/span&gt;. This step has not yet used any property of the hash function. Probabilities can be rewritten as sums of indicator functions, which gives the final expression.&lt;/p&gt;
&lt;p&gt;Difference of squares:
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$ A^2 - B^2 = (A - B)(A &amp;#43; B) $$&lt;/div&gt;&lt;p&gt;Then &amp;ldquo;&lt;span class="math math-inline"&gt;$\le$&lt;/span&gt;&amp;rdquo; can be split into &amp;ldquo;&lt;span class="math math-inline"&gt;$&amp;lt;$&lt;/span&gt;&amp;rdquo; and &amp;ldquo;&lt;span class="math math-inline"&gt;$=$&lt;/span&gt;&amp;rdquo;, &lt;span class="math math-inline"&gt;$A = B &amp;#43; p\left(V^{= g_1(x_t, r)}\right)$&lt;/span&gt;:
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$ A - B = p\left(V^{= g_1(x_t, r)}\right), \quad A &amp;#43; B = p\left(V^{= g_1(x_t, r)}\right) &amp;#43; 2p\left(V^{&amp;lt; g_1(x_t, r)}\right) $$&lt;/div&gt;&lt;p&gt;Substitute back and cancel:
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$ p_{\text{wm}}(x_t) = \underbrace{(A - B)}_{p\left(V^{= g_1}\right)} (A &amp;#43; B) \times \frac{p(x_t)}{\underbrace{p\left(V^{= g_1(x_t, r)}\right)}_{\text{cancels}}} = p(x_t) \left[ p\left(V^{= g_1}\right) &amp;#43; 2p\left(V^{&amp;lt; g_1}\right) \right] $$&lt;/div&gt;&lt;p&gt;The probability can then be written as follows, restoring it to a sum of indicator functions:
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$\begin{aligned}
p_{\mathrm{wm}}(x_t \mid p, r, f_g, 2, 1) 
&amp;amp;= p(x_t) \left( p(V^{= g_1(x_t, r)}) &amp;#43; 2 p(V^{&amp;lt; g_1(x_t, r)}) \right) \quad \\
&amp;amp;= p(x_t) \left( \sum_{x \in V} p(x) \left[ \mathbb{1}_{g_1(x, r) = g_1(x_t, r)} &amp;#43; 2 \mathbb{1}_{g_1(x, r) &amp;lt; g_1(x_t, r)} \right] \right) \quad 
\end{aligned}$$&lt;/div&gt;&lt;p&gt;
Then we take the expectation over r, &lt;span class="math math-inline"&gt;$\mathbb{E}_r[p_{wm}]$&lt;/span&gt;, which only requires computing the following. Notice that this is where the hash function property is used, namely splitting &lt;span class="math math-inline"&gt;$2\mathbb{E}[\mathbb{1}_&amp;lt;]$&lt;/span&gt; into &lt;span class="math math-inline"&gt;$\mathbb{E}[\mathbb{1}_&amp;lt;] &amp;#43; \mathbb{E}[\mathbb{1}_&amp;gt;]$&lt;/span&gt;:
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$\begin{aligned}
&amp;amp;\mathbb{E}_r \left[ \mathbb{1}_{g_1(x, r) = g_1(x_t, r)} \right] &amp;#43; 2 \mathbb{E}_r \left[ \mathbb{1}_{g_1(x, r) &amp;lt; g_1(x_t, r)} \right] \\
&amp;amp;= \mathbb{E}_r \left[ \mathbb{1}_{g_1(x, r) = g_1(x_t, r)} \right] &amp;#43; \mathbb{E}_r \left[ \mathbb{1}_{g_1(x, r) &amp;lt; g_1(x_t, r)} \right] &amp;#43; \mathbb{E}_r \left[ \mathbb{1}_{g_1(x, r) &amp;gt; g_1(x_t, r)} \right] \quad \text{(by Methods Def 4)} \\
&amp;amp;= \mathbb{E}_r \left[ \mathbb{1}_{g_1(x, r) = g_1(x_t, r)} &amp;#43; \mathbb{1}_{g_1(x, r) &amp;lt; g_1(x_t, r)} &amp;#43; \mathbb{1}_{g_1(x, r) &amp;gt; g_1(x_t, r)} \right] \\
&amp;amp;= \mathbb{E}_r [1] \\
&amp;amp;= 1.
\end{aligned}$$&lt;/div&gt;&lt;p&gt;Substitute back, and there it is. (The multi-layer case is proven to give the same result.)
&lt;/p&gt;
&lt;div class="math math-block"&gt;$$\begin{aligned}
\mathbb{E}_r \left[ p_{\mathrm{wm}}(x_t \mid p, r, f_g, 2, 1) \right] 
&amp;amp;= p(x_t) \left( \sum_{x \in V} p(x) \right) \\
&amp;amp;= p(x_t).
\end{aligned}$$&lt;/div&gt;&lt;p&gt;Section G.2 then describes in detail the proof that repeated context masking achieves non-distortion for one or more sequences. The idea is to avoid applying the same watermark bias again when the same context reappears. I will leave that for you to read yourselves; anyway, I believe them, and it is definitely not that I was too lazy to read it.&lt;/p&gt;
&lt;p&gt;The Supplementary Information of this paper is basically a textbook, starting from the basics. Well worth a read, but I am a bit tired.&lt;/p&gt;
&lt;h3 id="ensuring-computational-scalability"&gt;Ensuring computational scalability
&lt;/h3&gt;&lt;p&gt;Because only the sampling layer is modified, the LLM itself is not re-run, so the added computational cost is negligible. The g-values of the candidate tokens can also be computed in parallel, which is well suited to vectorization.&lt;/p&gt;
&lt;p&gt;One thing to note is that production systems are usually not a plain autoregressive loop. For example, production may use speculative sampling, a method that uses a smaller, faster model to predict tokens so the LLM can run faster. The target LLM then verifies these predicted tokens, so it does not have to waste time on a forward pass every single step, and the extra predicted tokens can be processed in parallel.&lt;/p&gt;
&lt;p&gt;Below is the speculative sampling algorithm, where q is the target LLM and p is the small model&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Lines 4 to 6: let the small model draft K candidate tokens&lt;/li&gt;
&lt;li&gt;Line 7: the large model takes these K tokens as input together, so the logits can be computed in parallel&lt;/li&gt;
&lt;li&gt;Lines 8 to 15: the verification step. For each drafted token &lt;span class="math math-inline"&gt;$\tilde{x_t}$&lt;/span&gt;, draw a uniform random number &lt;span class="math math-inline"&gt;$r \sim U[0,1]$&lt;/span&gt;. If &lt;span class="math math-inline"&gt;$r &amp;lt; min(1, \frac{q(\tilde{x_t})}{p(\tilde{x_t})})$&lt;/span&gt;, accept the small model q&amp;rsquo;s token into the final result. Otherwise, immediately stop this round of verification and resample the correct token from the residual distribution as a replacement&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The reject case is worth noting: the point is to avoid inflating the probability of the rejected token, which is why this formula subtracts the two probability distributions. As for how they compare, they divide the target model&amp;rsquo;s probability by the small LLM&amp;rsquo;s probability; the closer to 1 or even &amp;gt; 1, the more likely it is accepted, so it is essentially comparing how much the large and small models agree on this token. A Uniform distribution is used here because the small model&amp;rsquo;s probability multiplied by this accept rate is exactly the target LLM&amp;rsquo;s probability. This way the sampling distribution does not deviate from the target LLM, generation quality is not affected, and it is fair.
&lt;img alt="The speculative sampling algorithm (algorithm 4) captured from the supplementary information" class="gallery-image" data-flex-basis="261px" data-flex-grow="109" height="976" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/algorithm4-speculative-sampling.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/algorithm4-speculative-sampling_hu_3b5376cd52f6a632.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/algorithm4-speculative-sampling.png 1065w" width="1065"&gt;&lt;/p&gt;
&lt;p&gt;The + symbol in the bottom right denotes the &amp;ldquo;Positive Part Operator / Rectified Unit&amp;rdquo;, which has the same effect as ReLU + L1 normalization&lt;/p&gt;
&lt;p&gt;&lt;img alt="Definition 34 defines an operator" class="gallery-image" data-flex-basis="1068px" data-flex-grow="445" height="166" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/definition34-positive-part-operator.png" width="739"&gt;&lt;/p&gt;
&lt;p&gt;Nobody had previously discussed how to combine generative watermarking with speculative sampling, which is one of their contributions. The authors propose two generative watermarking schemes with speculative sampling, in Supplementary Information Section I.4:&lt;/p&gt;
&lt;h4 id="high-detectability-watermarked-speculative-sampling"&gt;high-detectability watermarked speculative sampling
&lt;/h4&gt;&lt;p&gt;The goal is to preserve watermark detectability. It may reduce the efficiency of speculative sampling but does not sacrifice the watermark signal. I will not go into the algorithm (algorithm 5) in detail; it is the same as speculative sampling, except the target LLM&amp;rsquo;s probability distribution is replaced by the watermark sampling function&amp;rsquo;s distribution. It does increase cost, though, because the algorithm requires directly computing the &lt;span class="math math-inline"&gt;$p_{wm}$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$q_{wm}$&lt;/span&gt; distributions. The main slowdown is the high rejection probability, and after a rejection the watermark distribution over the whole Vocabulary has to be computed.&lt;/p&gt;
&lt;p&gt;&lt;img alt="algorithm5 high-detectability watermarked speculative sampling" class="gallery-image" data-flex-basis="315px" data-flex-grow="131" height="810" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/algorithm5-high-detectability.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/algorithm5-high-detectability_hu_7f839a29c33e9fca.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/algorithm5-high-detectability.png 1066w" width="1066"&gt;&lt;/p&gt;
&lt;h4 id="fast-watermarked-speculative-sampling"&gt;fast watermarked speculative sampling
&lt;/h4&gt;&lt;p&gt;This preserves the efficiency of speculative sampling, but detectability may drop. For this approach the authors propose a learned Bayesian scoring function to make the detector more effective.&lt;/p&gt;
&lt;p&gt;In the algorithm below, it does not need to compute probabilities like &lt;span class="math math-inline"&gt;$p_{wm}$&lt;/span&gt; or &lt;span class="math math-inline"&gt;$q_{wm}$&lt;/span&gt;; it only needs to be able to sample. There is also a two-key mechanism: the Draft key &lt;span class="math math-inline"&gt;$k^D$&lt;/span&gt; is used by the small model, and the Target Key &lt;span class="math math-inline"&gt;$k^T$&lt;/span&gt; is used by the large model.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Lines 4 to 6: again let the small model produce K draft tokens, using &lt;span class="math math-inline"&gt;$k^D$&lt;/span&gt; while generating them.&lt;/li&gt;
&lt;li&gt;Then the large model runs in parallel and computes the unwatermarked distributions at these K positions&lt;/li&gt;
&lt;li&gt;Then verify the draft tokens the same way as before
&lt;ol&gt;
&lt;li&gt;If it passes, it is accepted, but note that this token keeps the watermark from the small model&amp;rsquo;s key&lt;/li&gt;
&lt;li&gt;If it fails, the large model draws a token from the distribution using &lt;span class="math math-inline"&gt;$k^T$&lt;/span&gt; to fill in, then ends this round&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The reason it can be called fast is that the ratio on line 10 of algorithm 5 is &lt;span class="math math-inline"&gt;$\frac{q_{wm}(\tilde{x_t})}{p_{wm}(\tilde{x_t})}$&lt;/span&gt;, meaning the system has to push tens of thousands of tokens back through the watermark sampling function, whereas line 10 of algorithm 6 only needs &lt;span class="math math-inline"&gt;$\frac{q(\tilde{x_t})}{p(\tilde{x_t})}$&lt;/span&gt;. It is as fast as the original speculative sampling with no watermark at all. The two keys are used for probabilistic independence (&lt;span class="math math-inline"&gt;$k^D$&lt;/span&gt; and &lt;span class="math math-inline"&gt;$k^T$&lt;/span&gt; are sampled independently), which raises the probability that the target model accepts the draft model&amp;rsquo;s tokens, because in theory p and q are very similar, and the two keys effectively remove the interference from the watermark.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Fast watermarked speculative sampling algorithm 6" class="gallery-image" data-flex-basis="248px" data-flex-grow="103" height="1027" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/algorithm6-fast-watermarked.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/algorithm6-fast-watermarked_hu_d5c85b3ab2c78366.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/algorithm6-fast-watermarked.png 1062w" width="1062"&gt;&lt;/p&gt;
&lt;h2 id="evaluation"&gt;Evaluation
&lt;/h2&gt;&lt;p&gt;The authors ran many experiments; I will only pick the interesting ones.&lt;/p&gt;
&lt;p&gt;The baselines fall into two categories, non-distortionary and distortionary. For the former they chose the best method at the time, Gumbel sampling, and for the latter Soft Red List. For a fair (like-for-like) comparison, the authors focus on the sampling algorithm and keep everything else the same (random seed generator, scoring, and so on). For all baselines they use the same sliding window random seed generator and the same repeated context masking.&lt;/p&gt;
&lt;p&gt;They want to verify quality (text quality must not be affected) and scalability (cost must not be too high).&lt;/p&gt;
&lt;h3 id="synthid-text-preserves-quality-including-in-a-large-scale--production-system"&gt;SynthID-Text preserves quality including in a large-scale- production system
&lt;/h3&gt;&lt;p&gt;Back when Gemini was still called Bard, they ran an online test, routing half of user queries to watermarked sampling and half to unwatermarked, and let users rate responses via the 👍 and 👎 in the UI. The result was a thumbs-up rate difference of 0.01 (and a thumbs-down difference of 0.02), over 20 million samples, which means basically no difference, at least none that humans can perceive.&lt;/p&gt;
&lt;p&gt;To provide an experiment others can reproduce, the authors used Gemma 7B-IT (IT -&amp;gt; instruction-tuned) to answer 300 ELI5 questions (explain like I&amp;rsquo;m five, named after the well-known Reddit forum, full of complex, open-ended big questions), then had humans rate them in a side-by-side comparison (probably like LM-SYS) on the following aspects&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;grammaticality / coherence&lt;/li&gt;
&lt;li&gt;relevance&lt;/li&gt;
&lt;li&gt;correctness&lt;/li&gt;
&lt;li&gt;helpfulness&lt;/li&gt;
&lt;li&gt;overall quality&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The result was no statistically significant difference, see Extended Data Table 1&lt;/p&gt;
&lt;p&gt;&lt;img alt="Extended data table 1" class="gallery-image" data-flex-basis="668px" data-flex-grow="278" height="649" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-table1.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-table1_hu_eb22f892f23fa9cd.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-table1_hu_4576ae7feffc2835.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-table1.png 1808w" width="1808"&gt;&lt;/p&gt;
&lt;p&gt;They also measured perplexity and automated benchmark performance, and the conclusion is that non-distortionary SynthID-Text shows no significant difference from the unwatermarked model.&lt;/p&gt;
&lt;h3 id="synthid-text-provides-better-detectability-than-existing-watermarks"&gt;SynthID-Text provides better detectability than existing watermarks
&lt;/h3&gt;&lt;p&gt;&lt;img alt="figure3 detection performance of SynthID-Text" class="gallery-image" data-flex-basis="417px" data-flex-grow="173" height="979" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/fig3-detection-performance.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/fig3-detection-performance_hu_eedc951637b242d0.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/fig3-detection-performance_hu_9aa6bb92d18c7bf7.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/fig3-detection-performance.png 1702w" width="1702"&gt;
model:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gemma 2B-IT&lt;/li&gt;
&lt;li&gt;Gemma 7B-IT&lt;/li&gt;
&lt;li&gt;Mistral 7B-IT
The experiments use the ELI5 dataset, which consists of explanatory multi-sentence answers. I think the purpose is that such prompts make the output entropy high. Figure 3a is the non-distortionary category, where SynthID-Text indeed performs better than Gumbel sampling, and TPR clearly increases with more tokens. Note that the vertical axis is &lt;span class="math math-inline"&gt;$TPR\ @\ FPR = 1\%$&lt;/span&gt;, meaning the model&amp;rsquo;s TPR under the condition that FPR is at most 1% (think of it as the score threshold).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In scenarios that require a very low FPR, a selective prediction mechanism can be used, which simply refrains from judging samples the scoring function is not confident about (abstention). The system sets two score thresholds&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;High threshold &lt;span class="math math-inline"&gt;$\tau_{positive}$&lt;/span&gt;: computed from unwatermarked text; only above this threshold do we dare to declare a watermark present (controls FPR)&lt;/li&gt;
&lt;li&gt;Low threshold &lt;span class="math math-inline"&gt;$\tau_{negative}$&lt;/span&gt;: computed from watermarked text; only below this threshold do we dare to declare no watermark (controls FNR)
If &lt;span class="math math-inline"&gt;$\tau_{positive} &amp;lt; \tau_{negative}$&lt;/span&gt;, detection at the current length is very good and the requirement can be met without abstaining at all.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Figure 3b describes the case with the selective prediction mechanism; the vertical axis is the abstention rate, and the more tokens there are, the less the detector abstains.&lt;/p&gt;
&lt;p&gt;Figure 3c: the combination of low perplexity and high TPR is in the top left, and the closer to the top left the better. Compared with the Soft Red List method, SynthID-Text has lower perplexity, meaning less sentence quality is sacrificed.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Extended data fig4" class="gallery-image" data-flex-basis="466px" data-flex-grow="194" height="1316" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-fig4.png" srcset="https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-fig4_hu_4c9f452e6afc4904.png 800w, https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-fig4_hu_fb95c3e56fa710fc.png 1600w, https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-fig4_hu_25f19a90eeba13ff.png 2400w, https://blog.yenslife.top/post/synthid-text-paper-note/extended-data-fig4.png 2558w" width="2558"&gt;&lt;/p&gt;
&lt;p&gt;Extended data fig 4 uses a metric called Self-BLUE to measure text diversity; lower values mean higher diversity. SynthID-Text also has higher diversity than Gumbel sampling.&lt;/p&gt;
&lt;h3 id="synthid-text-has-minimal-computational-impact"&gt;SynthID-Text has minimal computational impact
&lt;/h3&gt;&lt;p&gt;The authors point out that Tournament sampling may indeed take longer than Gumbel and Soft Red List sampling, but these times are still far smaller than the LLM&amp;rsquo;s own inference time, so the impact on the overall system is comparatively small.&lt;/p&gt;
&lt;p&gt;In one experiment, with Gemma 7B-IT on 4 v5e TPUs, the original generation speed was 15.527 ms / token; with 30-layer tournament sampling it became 15.615 ms / token, a latency increase of only 0.57%. For comparison, Gumbel adds 0.26% latency and Soft Red List adds 0.28%. Basically no difference at all.&lt;/p&gt;
&lt;h2 id="discussion"&gt;Discussion
&lt;/h2&gt;&lt;h3 id="contribution"&gt;Contribution
&lt;/h3&gt;&lt;p&gt;Here are the contributions as I summarized them&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have introduced SynthID-Text, a method for watermarking LLM text.&lt;/li&gt;
&lt;li&gt;SynthID-Text uses certain elements introduced in previous work, but differs in the use of the sampling algorithm, Tournament sampling, which we find provides superior detectability compared with existing methods. It adopts some elements from prior research but adds a novel sampling method, tournament sampling, whose detectability beats existing methods.&lt;/li&gt;
&lt;li&gt;SynthID-Text comes with rigorous and customizable non-distortion properties that can be configured to guarantee text quality preservation. SynthID-Text has customizable non-distortionary properties (two aspects: one is how many competitors each tournament match has, where exactly two gives single-token non-distortion; the other is the K value of repeated context masking), ensuring text quality is preserved.&lt;/li&gt;
&lt;li&gt;We have also proposed an algorithm to combine generative watermarking with speculative sampling. They propose an algorithm combining generative watermarking with speculative sampling.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="limitations"&gt;Limitations
&lt;/h3&gt;&lt;p&gt;The advantage of this kind of generative watermark is high cross-language stability, and it beats post hoc detectors (because it does not suffer from unseen data). The more notable limitations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It requires the service provider&amp;rsquo;s cooperation; without it, a post hoc detector may be needed for verification. In other words, SynthID-Text is not a silver bullet.&lt;/li&gt;
&lt;li&gt;Open-source models are usually deployed in a decentralized way, and the official party cannot force everyone to run inference with the watermarking mechanism&lt;/li&gt;
&lt;li&gt;The watermark can still be stolen (stealing: inferring the watermark rules by observing large amounts of watermarked output), spoofed, or scrubbed&lt;/li&gt;
&lt;li&gt;Paraphrasing attacks (LLM paraphrasing): using another LLM to rewrite watermarked text can easily remove the watermark signal.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Oh, I thought of one more. For LLM application developers like us, we do not actually have access to the sampling internals, or rather we cannot manipulate the sampling process as finely as SynthID-Text does. So watermarking for black-box APIs is also a problem worth tackling.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion
&lt;/h3&gt;&lt;p&gt;This paper provides evidence that SynthID-Text is viable in the real world. To their knowledge, it is the first generative text watermark deployed at scale. (Though probably only Google can pull this off at this level XD)&lt;/p&gt;</description></item></channel></rss>