<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Paper-Notes on Yenslife's Blog</title><link>https://blog.yenslife.top/en/categories/paper-notes/</link><description>Recent content in Paper-Notes on Yenslife's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Tue, 22 Sep 2026 11:24:16 +0800</lastBuildDate><atom:link href="https://blog.yenslife.top/en/categories/paper-notes/index.xml" rel="self" type="application/rss+xml"/><item><title>SWAN Paper Notes: Semantic Watermarking with Abstract Meaning Representation</title><link>https://blog.yenslife.top/en/post/swan-semantic-watermark-paper-note/</link><pubDate>Tue, 22 Sep 2026 11:24:16 +0800</pubDate><guid>https://blog.yenslife.top/en/post/swan-semantic-watermark-paper-note/</guid><description>&lt;img src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig2-overview.png" alt="Featured image of post SWAN Paper Notes: Semantic Watermarking with Abstract Meaning Representation" /&gt;&lt;h1 id="swan-semantic-watermarking-with-abstract-meaning-representation"&gt;SWAN: Semantic Watermarking with Abstract Meaning Representation
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;ACL 2026 main&lt;/li&gt;
&lt;li&gt;Embeds the watermark signal in the semantic representation, so compared with token-level watermarks this approach is more robust to paraphrasing&lt;/li&gt;
&lt;li&gt;Produces text output carrying a semantic watermark signal by prompting the LLM with an AMR template&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. 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://aclanthology.org/2026.acl-long.1681/" target="_blank" rel="noopener"
 &gt;original paper&lt;/a&gt;.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;Existing watermarking methods such as SynthID-Text (or KGW-like token-level methods) and embedding-level methods are all vulnerable to paraphrasing attacks, where another LLM rewrites the watermarked text to wash out the watermark signal. This is not the first paper to embed a watermark signal using semantics, though. A problem with existing methods is that the rewritten text may have its embedding shifted, which still hurts detection performance.&lt;/p&gt;
&lt;p&gt;Actually, I have not read any embedding-level watermark papers, so I just asked ChatGPT. The gist is that the sentence embedding is used as the watermark signal; you can think of it as a different sampling granularity, not token by token.&lt;/p&gt;
&lt;p&gt;This paper uses AMR to represent sentences, but can it represent special formats like code or JSON? I wonder whether they considered this problem. And what about different languages? Let&amp;rsquo;s wait and see (TODO: come back and answer this after finishing the paper)&lt;/p&gt;
&lt;h2 id="background"&gt;Background
&lt;/h2&gt;&lt;p&gt;I only record the parts I had not seen before&lt;/p&gt;
&lt;h3 id="abstract-meaning-representation-amr"&gt;Abstract Meaning Representation (AMR)
&lt;/h3&gt;&lt;p&gt;AMR is a way of representing an abstracted sentence as a Graph, with the goal of abstracting away syntactic and lexical differences between sentences. An example makes it easier to understand. The following four sentences are constructed completely differently, yet their AMR is the same:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The boy desires the girl to believe him.&lt;/li&gt;
&lt;li&gt;The boy desires to be believed by the girl.&lt;/li&gt;
&lt;li&gt;The boy has a desire to be believed by the girl.&lt;/li&gt;
&lt;li&gt;The boy’s desire is for the girl to believe him.
You can think of all of them as: &amp;ldquo;boy wants (girl believes boy)&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="math math-block"&gt;$$\begin{align*}
1 \quad &amp;amp; (w \ / \ \text{want-01} \\
2 \quad &amp;amp; \quad :\text{ARG0} \ (b \ / \ \text{boy}) \\
3 \quad &amp;amp; \quad :\text{ARG1} \ (b2 \ / \ \text{believe-01} \\
4 \quad &amp;amp; \qquad\qquad :\text{ARG0} \ (g \ / \ \text{girl}) \\
5 \quad &amp;amp; \qquad\qquad :\text{ARG1} \ b))
\end{align*}$$&lt;/div&gt;&lt;p&gt;The AMR representation is shown in figure 1, where nodes are concepts and edges are semantic relations:
&lt;img alt="figure 1 AMR graph visualization" class="gallery-image" data-flex-basis="223px" data-flex-grow="93" height="1016" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig1-amr-graph.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig1-amr-graph_hu_834b939f85098e34.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig1-amr-graph.png 946w" width="946"&gt;&lt;/p&gt;
&lt;h3 id="text-watermarking"&gt;Text Watermarking
&lt;/h3&gt;&lt;p&gt;Text watermarking can be divided into the following three categories by granularity&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;token-level: apply a slight bias to the sampling distribution during decoding to embed a statistical signal. The classic KGW and the more advanced &lt;a class="link" href="https://blog.yenslife.top/en/post/synthid-text-paper-note/" &gt;SynthID-Text&lt;/a&gt; both belong here. These methods are helpless against paraphrasing and surface-level text edits.&lt;/li&gt;
&lt;li&gt;sentence-level: to improve paraphrase robustness, the watermark signal is encoded in semantic space. Similar methods include SemStamp and k-SemStamp (I definitely need to look these up later).&lt;/li&gt;
&lt;li&gt;paragraph-level: roughly two kinds, &amp;ldquo;embedding the watermark at the paragraph level&amp;rdquo; and &amp;ldquo;injecting the watermark in a black-box manner after the text is generated (post-hoc)&amp;rdquo;. PostMark is one example: it first encodes the semantics of the paragraph, selects specific watermark words from an embedding table, then has an instruction-following LLM weave them into the original text. This approach is black-box because it needs neither the Target Model&amp;rsquo;s weights nor its sampling algorithm&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And SWAN in this paper? The authors say that unlike the three above, it embeds the watermark directly into the semantic structure of the sentence.&lt;/p&gt;
&lt;h2 id="overview-of-the-framework"&gt;Overview of the Framework
&lt;/h2&gt;&lt;p&gt;&lt;img alt="figure2 Overview" class="gallery-image" data-flex-basis="384px" data-flex-grow="160" height="1482" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig2-overview.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig2-overview_hu_9ea2ce78f1f929b1.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig2-overview_hu_7ecc005cedf0b577.png 1600w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig2-overview.png 2372w" width="2372"&gt;&lt;/p&gt;
&lt;h3 id="amr-bank-creation"&gt;AMR Bank Creation
&lt;/h3&gt;&lt;p&gt;The authors use the MASSIVE-AMR dataset, which has about 84000 AMR graphs covering 1685 types of data query utterances&lt;/p&gt;
&lt;p&gt;The raw AMRs are then abstracted into template AMRs, for example by replacing nouns with generic placeholders; Alice might become NE (Named Entity). There are two advantages to using template AMRs&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Generality: a small number of template AMRs can map to a large number of different sentences&lt;/li&gt;
&lt;li&gt;Robustness: replacing entity names reduces the chance that lexical edits destroy the watermark&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So how did they select them? To build the AMR bank, the authors go through all of MASSIVE-AMR and keep only the AMR graphs satisfying both of the following conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Frequency between 3 and 20 occurrences (excluding ones that are too unusual and ones that are too formulaic)&lt;/li&gt;
&lt;li&gt;At least 3 concept nodes (they do not want the AMR to be too simple)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Secret Bank &lt;span class="math math-inline"&gt;$\mathcal{B}$&lt;/span&gt; here is equivalent to the concept of the watermark&amp;rsquo;s Key, used in both Injection and Detection.&lt;/p&gt;
&lt;h3 id="watermark-injection"&gt;Watermark Injection
&lt;/h3&gt;&lt;p&gt;Before generating a sentence, a template &lt;span class="math math-inline"&gt;$g$&lt;/span&gt; is drawn from the AMR bank, and the LLM is given two inputs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Context accumulated from previously generated sentences, to maintain discourse coherence.&lt;/li&gt;
&lt;li&gt;The template &lt;span class="math math-inline"&gt;$g$&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The LLM is then instructed to generate text that matches the semantic structure of that template. The whole Prompt looks like this (from appendix A.1)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-plain" data-lang="plain"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AMR (Abstract Meaning Representation) is a graph-based representation of a sentence&amp;#39;s meaning. Each node is a concept and edges represent semantic roles or relationships.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Below are some examples of template AMRs and corresponding sentences:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{example_text}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;In the provided AMR, there are placeholders:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &amp;#34;NE&amp;#34; for named entities (e.g., &amp;#34;Alice&amp;#34;, &amp;#34;France&amp;#34;, &amp;#34;Google&amp;#34;).
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &amp;#34;N&amp;#34; for generic nouns (e.g., &amp;#34;a device&amp;#34;, &amp;#34;an object&amp;#34;).
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &amp;#34;X&amp;#34; for unspecified concepts (e.g., &amp;#34;something&amp;#34;, &amp;#34;an idea&amp;#34;).
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Instructions:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Do not write &amp;#34;NE&amp;#34;, &amp;#34;N&amp;#34;, or &amp;#34;X&amp;#34; literally. Instead, replace them with appropriate English words to form a natural, meaningful sentence.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Ensure the generated sentence aligns with both the AMR structure and the given context.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Do not produce multiple sentences or lists.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Produce exactly one coherent sentence.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AMR:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{chosen_template}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Context: {context}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Please output only that one sentence.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The LLM&amp;rsquo;s output is then parsed back into an AMR Graph &lt;span class="math math-inline"&gt;$\hat{g}$&lt;/span&gt; by an AMR Parser. For every generated graph &lt;span class="math math-inline"&gt;$\hat{g}$&lt;/span&gt; we compute S2MATCH: &lt;span class="math math-inline"&gt;$S2MATCH(\hat{g},g)$&lt;/span&gt;, its similarity to the AMR template &lt;span class="math math-inline"&gt;$g$&lt;/span&gt;. The authors describe S2MATCH as a lightweight metric that takes node-level and edge-level F1 scores into account and outputs a value between 0 and 1. That is, the sentence is only accepted when &lt;span class="math math-inline"&gt;$S2MATCH(\hat{g},g)&amp;gt;\theta_{accept}$&lt;/span&gt;; otherwise it is regenerated.&lt;/p&gt;
&lt;p&gt;Because the output is influenced by the context, the LLM does not always match the template so neatly, so they set a small upper limit on the number of resampling attempts. If the limit is reached without success, the current template is abandoned and another one is drawn from the bank for generation. (Adaptive Target Switching)&lt;/p&gt;
&lt;p&gt;The full Algorithm is shown below:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Algorithm 1" class="gallery-image" data-flex-basis="145px" data-flex-grow="60" height="1228" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/algorithm1-injection.png" width="742"&gt;&lt;/p&gt;
&lt;h3 id="watermark-detection"&gt;Watermark Detection
&lt;/h3&gt;&lt;p&gt;SWAN detects a piece of text in three steps&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use an off-the-shelf AMR Parser to convert each sentence into an AMR Graph&lt;/li&gt;
&lt;li&gt;For the &lt;span class="math math-inline"&gt;$\hat{g}$&lt;/span&gt; parsed from a given sentence, compare it against all templates in the secret bank (S2MATCH) and take the maximum. If the highest similarity exceeds the threshold, mark it as a green sentence.&lt;/li&gt;
&lt;li&gt;A paragraph may have n sentences, so a one-proportion z-test is also needed. If k sentences are marked as green sentences, compute &lt;span class="math math-inline"&gt;$z = \frac{k-\lambda n}{\sqrt{n \lambda (1- \lambda)}}$&lt;/span&gt;, where &lt;span class="math math-inline"&gt;$\lambda$&lt;/span&gt; is the expected hit-rate.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The null hypothesis &lt;span class="math math-inline"&gt;$H_0$&lt;/span&gt; here is &amp;ldquo;this text was written without knowledge of the secret bank&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Below is the Paragraph-Level detection algorithm
&lt;img alt="algorithm 2" class="gallery-image" data-flex-basis="191px" data-flex-grow="79" height="1532" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/algorithm2-detection.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/algorithm2-detection_hu_24f6fb388d0035dc.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/algorithm2-detection.png 1222w" width="1222"&gt;&lt;/p&gt;
&lt;h2 id="experiments"&gt;Experiments
&lt;/h2&gt;&lt;p&gt;The experiments follow the SemStamp baseline setup on the REALNEWS subset of the C4 corpus, a Google open-source news index dataset composed of professionally written news articles. The first 250 sentences of the subset are taken as the evaluation set.&lt;/p&gt;
&lt;p&gt;Then there is the AMR bank size, which must be set carefully because it is used in both injection and detection, especially detection, which has to scan through all templates. Here they set &lt;span class="math math-inline"&gt;$|\mathcal{B}| = 50$&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;All watermark injection models use &lt;code&gt;DeepSeek-R1-Distill-Qwen-14B&lt;/code&gt;. The algorithm tries at most &lt;span class="math math-inline"&gt;$M=5$&lt;/span&gt; times and switches through at most &lt;span class="math math-inline"&gt;$T=10$&lt;/span&gt; different AMR templates per sentence. By comparison, SemStamp allows up to 100 attempts per sentence, whereas here it is only 50.&lt;/p&gt;
&lt;p&gt;For detection, they use &lt;code&gt;parse_xfm_bar_large&lt;/code&gt;, which is a model, and only then run S2MATCH.&lt;/p&gt;
&lt;p&gt;For paraphrasing attacks, they use Pegasus (dedicated to paraphrasing), Parrot (a T5-based model, meaning it is good at swapping words), and Claude 3.7 Sonnet to create the attacks. For text quality, Claude 3.7 Sonnet is used in a Zero-shot manner to evaluate Coherence, Fluency, and Diversity, i.e. LLM-as-a-Judge.&lt;/p&gt;
&lt;p&gt;The evaluation metrics can be divided into two groups: watermark effectiveness and whether text quality is affected.&lt;/p&gt;
&lt;h3 id="detection-result"&gt;Detection Result
&lt;/h3&gt;&lt;p&gt;Table 1 shows paragraph-level detection results with no rewriting at all, and the result&amp;hellip; is not actually better? The authors still spin it a bit: raw detectability is about the same as the others, so it is fine, and at least far better than SynthID.&lt;/p&gt;
&lt;p&gt;&lt;img alt="table 1 detection accuracy" class="gallery-image" data-flex-basis="280px" data-flex-grow="116" height="960" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table1-detection-accuracy.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table1-detection-accuracy_hu_6a3c0caeeceee7d3.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table1-detection-accuracy.png 1120w" width="1120"&gt;&lt;/p&gt;
&lt;p&gt;Table 2 shows performance under attack, and this is where SWAN&amp;rsquo;s advantage shows, because SWAN&amp;rsquo;s watermark signal is the AMR structure of the sentence itself, so even after rewriting it does not change much. Other purely semantic approaches may drift under rewriting.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="951px" data-flex-grow="396" height="578" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table2-paraphrase-robustness.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table2-paraphrase-robustness_hu_62cab405ae63b1c9.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table2-paraphrase-robustness_hu_339d2faee7900a32.png 1600w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table2-paraphrase-robustness.png 2292w" width="2292"&gt;&lt;/p&gt;
&lt;h3 id="effect-of-amr-bank-size"&gt;Effect of AMR-Bank Size
&lt;/h3&gt;&lt;p&gt;Intuitively, a larger bank size covers more semantic patterns, but false positives could likewise be higher, because the LLM might just happen to generate an AMR structure similar to a secret bank template. Experiments here found that 800 and 50 are about the same, so you cannot say a bigger bank means higher AUC. The authors say performance should be the main consideration when setting the size. But honestly I find this rather puzzling. Why would that be?&lt;/p&gt;
&lt;p&gt;&lt;img alt="Table 3 effect of AMR-bank size" class="gallery-image" data-flex-basis="347px" data-flex-grow="144" height="780" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table3-amr-bank-size.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table3-amr-bank-size_hu_bdbff065819f206b.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table3-amr-bank-size.png 1128w" width="1128"&gt;&lt;/p&gt;
&lt;h3 id="text-quality-evaluation"&gt;Text Quality Evaluation
&lt;/h3&gt;&lt;p&gt;Then Claude scores the text produced by these methods, and the authors say SWAN is actually on par in quality with the other watermarking methods. The authors say that being on par while having much stronger paraphrase robustness is great.
&lt;img class="gallery-image" data-flex-basis="884px" data-flex-grow="368" height="622" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table4-text-quality.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table4-text-quality_hu_76d42e2116e168e8.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table4-text-quality_hu_e990405a22084f75.png 1600w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table4-text-quality.png 2292w" width="2292"&gt;&lt;/p&gt;
&lt;h3 id="qualitative-examples"&gt;Qualitative Examples
&lt;/h3&gt;&lt;p&gt;Qualitative analysis&lt;/p&gt;
&lt;p&gt;SWAN&amp;rsquo;s high example, although judged High, still has the repeated &amp;ldquo;Vote for &amp;hellip; Vote for &amp;hellip;&amp;rdquo;. The Low one is even worse, what is with all the Johns. SemStamp&amp;rsquo;s Low just looks a bit unnatural, while k-SemStamp has repeated information and odd punctuation.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Table 5 actual examples generated by these methods, qualitative analysis" class="gallery-image" data-flex-basis="352px" data-flex-grow="146" height="1556" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table5-qualitative-examples.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table5-qualitative-examples_hu_832e6559fb11d856.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table5-qualitative-examples_hu_252ebb1f685965d0.png 1600w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/table5-qualitative-examples.png 2286w" width="2286"&gt;&lt;/p&gt;
&lt;h3 id="sampling-efficiency"&gt;Sampling Efficiency
&lt;/h3&gt;&lt;p&gt;Like other sentence-level algorithms, SWAN also relies on rejection sampling. Computing &lt;span class="math math-inline"&gt;$250 \times 5 = 1250$&lt;/span&gt; sentences, they conclude that 17.7 trials are needed on average. By comparison, SemStamp needs only 13.8 on average. Figure 3 shows the full distribution: 42% of sentences are accepted within 10 attempts, and 54% within 15. The peak at 46 to 50 corresponds to sentences that nearly exhaust the sampling budget (sentences that cannot possibly match the AMR template; in an Agent setting I think these would be tool-call outputs)&lt;/p&gt;
&lt;p&gt;The authors say future work could do context-aware template selection instead of random selection, which might also reduce the number of inferences.
&lt;img alt="Figure 3 rejection sampling trials" class="gallery-image" data-flex-basis="342px" data-flex-grow="142" height="780" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig3-rejection-sampling-trials.png" srcset="https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig3-rejection-sampling-trials_hu_dbe68035fe6fc8c8.png 800w, https://blog.yenslife.top/post/swan-semantic-watermark-paper-note/fig3-rejection-sampling-trials.png 1112w" width="1112"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;We introduced SWAN, a novel semantic watermarking framework that embeds robust, paraphrase-resistant signals into AMR representations. The authors propose SWAN, a new semantic watermarking framework that embeds signals into the AMR representation.&lt;/li&gt;
&lt;li&gt;Empirically, it outperforms token-level and embedding-based watermark baselines in paraphrase robustness, while maintaining strong text fluency and naturalness. Empirically, SWAN&amp;rsquo;s paraphrase robustness is the best.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some limitations&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The AMR Parser itself makes mistakes&lt;/li&gt;
&lt;li&gt;How to securely manage the Secret Bank?&lt;/li&gt;
&lt;li&gt;Only works for English news&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="my-thoughts"&gt;My Thoughts
&lt;/h2&gt;&lt;p&gt;For code or JSON output, this does not seem to be covered well, right? And it is even less suitable for Agent scenarios. The number of inferences is also a problem: the cost of one LLM forward pass is acceptable, but many is not.&lt;/p&gt;
&lt;p&gt;In Related Work the authors mention that early linguistic steganography also hid information via syntax trees, which is very similar to SWAN&amp;rsquo;s concept. I should be able to make good use of this. I feel there must be some relationship across files in an Agentic System that I could use to hide information.&lt;/p&gt;</description></item><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>