SynthID-Text walkthroughSynthID-Text 論文導讀 ← Back to v1← 回到 v1

Nature 634, 818–823 (2024) · Google DeepMind

SynthID-Text

Watermark LLM text by changing only how the next token is sampled.只改「下一個 token 怎麼抽」,就替 LLM 文字加上浮水印。

  • Detection needs the text and a key, not the model偵測只需要文字和金鑰,不需要模型
  • Quality unchanged across ~20M Gemini responses約 2,000 萬則 Gemini 回應,品質不變
  • +0.57% latency; running in Gemini延遲只增加 0.57%;已在 Gemini 上線

Scroll down · TOY = toy data run in the browser, PAPER = the paper's numbers往下捲動 · TOY=瀏覽器裡跑的玩具資料,PAPER=論文數字

00

Three ways to spot AI text辨識 AI 文字的三種方法

The paper picks the generative watermark本文選生成式浮水印

Retrieval檢索

Store every output, look for matches存下所有輸出,拿來比對

✗ scale, privacy規模、隱私

Post hoc classifier事後分類器

Train “human vs AI”訓練「人寫 vs AI」

✗ unreliable, biased, needs retraining不穩定、有偏見、要一直重訓

Generative watermark生成式浮水印

Bias sampling with a secret key用秘密金鑰讓取樣產生偏差

✓ cheap, quality-preserving, no model to detect便宜、不傷品質、偵測不需模型

00

A generative watermark = 3 parts生成式浮水印 = 3 個元件

Only the sampling algorithm is new: Tournament sampling新的只有取樣演算法:錦標賽取樣

Generation and detection (paper Fig. 1)生成與偵測(論文圖 1)

PAPER
01

The watermark lives in the model's uncertainty浮水印只能藏在模型「不確定」的地方

Key number: 1 − C = chance two draws differ關鍵數字:1 − C=兩次抽到不同 token 的機率

“… my favourite tropical fruit is ___”

TOY

02

Seed = hash(last 4 tokens, key)種子 = 雜湊(前 4 個 token, 金鑰) part 1元件 1

The detector can rebuild it from the text alone偵測時只靠文字就能重算

Amber = hashed window黃框=被雜湊的視窗

TOY

rt

5th-last word倒數第 5 個詞

03

g-values: a secret 0/1 per token per layerg 值:每個 token、每一層一個秘密的 0/1

Independent of the probabilities — coin flips without the key和機率無關——沒有金鑰就像擲硬幣

Click a cell to see how it is computed點一格看它怎麼算

TOY
source來源
fg

04

Tournament: draw 2m, knock out m rounds錦標賽:抽 2m 個,淘汰 m 輪 part 2 · new元件 2 · 新提出

Round ℓ: higher gℓ wins, ties by coin第 ℓ 輪:gℓ 高的晉級,平手擲硬幣

Number next to a player = its g in that round參賽者旁的數字=它在那一輪的 g 值

TOY

04

No need to draw 230: compute layer by layer不用真的抽 230 個:一層一層算

g = 1 → ×(2 − ḡ)  ·  g = 0 → ×(1 − ḡ)g = 1 → ×(2 − ḡ)  ·  g = 0 → ×(1 − ḡ)

Winner's distribution after each layer (same seed as the bracket)每一層之後勝者的分布(和上一張同一個種子)

TOY

05

N = 2: averaged over keys, nothing changesN = 2:對金鑰平均,分布不變

Biased for one key, unbiased on average — the gap in E[g] is the watermark單一金鑰有偏差,平均起來沒有——E[g] 的差距就是浮水印

One layer, exact (all 16 g-patterns) · grey tick = pLM一層,精確計算(全部 16 種 g 組合)· 灰刻線=pLM

TOY
players N每場人數 N
view看法

05

Four levels of non-distortion四種無失真等級

The paper uses single-sequence: N = 2 + masking within one response論文用單序列:N = 2 + 一則回應內的遮罩

single-token單 tokenone step = pLM一步 = pLMN = 2
single-sequence單序列one response unchanged一則回應不變+ K = 1 masking遮罩
K-sequenceK 序列K responses jointly連續 K 則+ K masking遮罩
infinite無限序列any number任意多則K = ∞
  • Stronger level → more steps masked → weaker detection等級越強 → 遮掉越多步 → 偵測越弱
  • Cost of single-sequence: answers to the same prompt look a bit more alike單序列的代價:同一問題的多次回答會稍微更像
  • N > 2 = distortionary: stronger watermark, some quality lossN > 2=有失真:浮水印更強,品質略降
06

Detect: is the mean g above the threshold?偵測:平均 g 值高於門檻嗎? part 3元件 3

Threshold = 99th percentile of unwatermarked scores門檻=無浮水印分數的第 99 百分位

120 watermarked vs 300 unwatermarked toy texts120 段有浮水印 vs 300 段無浮水印的玩具文字

TOY
unwatermarked無浮水印watermarked有浮水印threshold (FPR 1%)門檻(FPR 1%)

06

Longer text, higher entropy → easier文字越長、熵越高 → 越好抓

Same toy texts as the previous slide和上一張同一批玩具文字

TPR @ FPR = 1% vs length · mean g per layerTPR @ FPR = 1% 對長度 · 每層平均 g

TOY
temperature溫度
score評分

07

Fast enough for production: + speculative sampling上線夠快:搭配推測取樣

Draft Gemma 2B-IT proposes 3, target Gemma 7B-IT verifies草稿 Gemma 2B-IT 提議 3 個,目標 Gemma 7B-IT 檢查

Watermarked speculative sampling加浮水印的推測取樣

PAPER
algorithm演算法

07

Two algorithms, each gives up one wish兩種演算法,各放棄一個願望

Switch the algorithm on the previous slide在上一張切換演算法

Non-distortion · speed · detectability無失真 · 速度 · 可偵測性

PAPER
08

Results結果

Same quality, better detection, negligible cost品質不變、偵測更好、成本可忽略

~20M

Gemini responses: 👍 +0.01%, 👎 −0.02%, not significant則 Gemini 回應:讚 +0.01%、倒讚 −0.02%,不顯著

3,000

ELI5 side-by-side ratings: no preference on any of 5 aspects題 ELI5 並排評分:5 個面向都沒有偏好差異

+0.57%

latency, Gemma 7B-IT (Gumbel +0.26%, SRL +0.28%)延遲,Gemma 7B-IT(Gumbel +0.26%、SRL +0.28%)

vs Gumbel (non-distortionary)對 Gumbel(無失真)

Higher TPR@FPR=1% at the same length; biggest gain at low entropy相同長度 TPR@FPR=1% 較高;熵越低勝越多

vs Soft Red List (distortionary)對 Soft Red List(有失真)

Much higher TPR for the same perplexity cost同樣困惑度代價下 TPR 明顯較高

08

Limitations限制

A complement to other detectors, not a full solution是其他偵測法的補充,不是完整解法

  • Only catches providers that apply it只能抓有加浮水印的服務
  • Hard to enforce on open-source models開源模型很難強制
  • Paraphrasing weakens it; stealing / spoofing / scrubbing attacks改寫會削弱;竊取、偽造、清除攻擊
  • Low entropy → little signal熵低 → 訊號少

S. Dathathri et al., Nature 634, 818–823 (2024), doi:10.1038/s41586-024-08025-4, CC BY 4.0. Independent walkthrough; figures redrawn. Code: google-deepmind/synthid-text.S. Dathathri 等,Nature 634, 818–823(2024),doi:10.1038/s41586-024-08025-4,CC BY 4.0。獨立製作的導讀;圖為重畫。程式碼:google-deepmind/synthid-text。