Papers › Towards Better Statistical Understanding of Watermarking LLMs

Towards Better Statistical Understanding of Watermarking LLMs

19 Mar 2024arXiv:2403.13027archive 2025-07-28

Zhongze Cai, Shang Liu, Hanzhao Wang, Huaiyang Zhong, Xiaocheng Li

In this paper, we study the problem of watermarking large language models (LLMs). We consider the trade-off between model distortion and detection ability and formulate it as a constrained optimization problem based on the green-red algorithm of Kirchenbauer et al. (2023a). We show that the optimal solution to the optimization problem enjoys a nice analytical property which provides a better understanding and inspires the algorithm design for the watermarking process. We develop an online dual gradient ascent watermarking algorithm in light of this optimization formulation and prove its asymptotic Pareto optimality between model distortion and detection ability. Such a result guarantees an averaged increased green list probability and henceforth detection ability explicitly (in contrast to previous results). Moreover, we provide a systematic discussion on the choice of the model distortion metrics for the watermarking problem. We justify our choice of KL divergence and present issues with the existing criteria of ``distortion-free'' and perplexity. Finally, we empirically evaluate our algorithms on extensive datasets against benchmark algorithms.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 23 code samples harvested from 1 repository linked to this paper: 19 ran (of which 0 constructed an object rather than computing a result; 12 with no instrument failure: 0 honoured, 2 violated, 10 with no contract checked; 7 where Syntology's instrument failed) · 4 unverified. Where Syntology's instrument failed: 7 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: official repository: 23 samples from 1 repository, 19 ran (12 with no instrument failure; 7 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

zhongzecai/dualga officialmentioned in paperpytorchSyntology: 23 samples, 19 ran (7 instrument-failed) · 4 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

23 samples harvested: 19 ran (of which 0 constructed an object rather than computing a result; 12 with no instrument failure: 0 honoured, 2 violated, 10 with no contract checked; 7 where Syntology's instrument failed) · 4 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · violated contract
7ran · our draft was wrong
10ran
4unverified

Licence: 23 of the 23 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from zhongzecai/dualga. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

zhongzecai/dualga official repository 23 samples, 19 ran (7 instrument-failed) · 4 unverified
DGt WatermarkAlgorithm/utils/DualGD_generator.py ran fingerprinted no licence file found · pointer only · 88258837d760b644 · report fixture: signature delta:Tensor/2/float, g:Tensor/2/float · returned Tensor · level recorded 2026-09-24
KLt WatermarkAlgorithm/utils/DualGD_generator.py ran · our draft was wrong fingerprinted no licence file found · pointer only · bcc348526121329b · report fixture: signature delta:Tensor/2/float, g:Tensor/2/float · returned Tensor · level recorded 2026-09-24
add_idx WatermarkAlgorithm/utils/data_processing.py ran no licence file found · pointer only · 5213b646c1f83e4a · report fixture: signature example:dict/0/?, idx:int/0/int · returned dict · level recorded 2026-09-24
additive_prf in 5 papers WatermarkAlgorithm/utils/alternative_prf_schemes.py ran · violated contract no licence file found · pointer only · 3e107246e54539b5 · report fixture: signature input_ids:Tensor/2/int, salt_key:int/0/int · returned int · level recorded 2026-09-24
concat_rows WatermarkAlgorithm/utils/evaluation.py ran no licence file found · pointer only · 428e9dd9cdeca201 · report fixture: signature examples:dict/0/?, tokenizer:callable/0/?, args:NoneType/0/? · returned dict · level recorded 2026-09-24
conditional_no_check_args WatermarkAlgorithm/utils/evaluation.py ran no licence file found · pointer only · 4ea6b15c91ca13a0 · report fixture: signature no_check_args:list/1/str, evaluation_metrics:list/1/str, args:dict/0/? · returned list · level recorded 2026-09-24
deletion_attack WatermarkAlgorithm/utils/attack_light.py ran · our draft was wrong no licence file found · pointer only · 8880355eca496e49 · report fixture: signature tokens:Tensor/1/int, p:float/0/float · returned Tensor · level recorded 2026-09-24
denom_func WatermarkAlgorithm/utils/DualGD_generator.py ran fingerprinted no licence file found · pointer only · a621beb4ebc978ae · report fixture: signature delta:Tensor/2/float, g:Tensor/2/float · returned Tensor · level recorded 2026-09-24
dict_remove WatermarkAlgorithm/utils/data_processing.py ran no licence file found · pointer only · c88510de06c5a48b · report fixture: signature dic:dict/0/?, key:str/0/str · returned dict · level recorded 2026-09-24
insertion_attack WatermarkAlgorithm/utils/attack_light.py ran no licence file found · pointer only · 2b0288f4b606671b · report fixture: signature tokens:Tensor/1/int, p:float/0/float, vocab_size:int/0/int, distribution:callable/0/? · returned Tensor · level recorded 2026-09-24
list_of_strings in 9 papers WatermarkAlgorithm/DualGD_generate.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 19ee4683eda506c6 · report fixture: signature arg:str/0/str · returned list · level recorded 2026-09-22
list_of_strings in 9 papers WatermarkAlgorithm/MinACF_eval.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 571045e954da6d27 · report fixture: signature arg:str/0/str · returned list · level recorded 2026-09-24
list_relative_jsonl_file_paths WatermarkAlgorithm/ppl.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 142c8b133ed9f266 · report fixture: signature directory:str/0/str · returned list · level recorded 2026-09-24
load_full_results WatermarkAlgorithm/MinACF_eval.py ran · our draft was wrong no licence file found · pointer only · ee2e7209ff4d37fa · report fixture: signature json_path:str/0/str, nsamples:NoneType/0/? · returned list · level recorded 2026-09-24
multiplicative_prf WatermarkAlgorithm/utils/alternative_prf_schemes.py ran · violated contract no licence file found · pointer only · ab84746bf94016d2 · report fixture: signature input_ids:Tensor/2/int, salt_key:int/0/int · returned int · level recorded 2026-09-24
seeding_scheme_lookup WatermarkAlgorithm/utils/alternative_prf_schemes.py ran · our draft was wrong no licence file found · pointer only · 97bace61e91ab919 · report fixture: signature seeding_scheme:str/0/str · returned tuple · level recorded 2026-09-24
single_insertion WatermarkAlgorithm/utils/attack_advanced.py ran no licence file found · pointer only · f6febe281ce78bb3 · report fixture: signature attack_len:int/0/int, min_token_count:int/0/int, tokenized_no_wm_output:list/1/int, tokenized_w_wm_output:list/1/int · returned Tensor · level recorded 2026-09-24
substitution_attack WatermarkAlgorithm/utils/attack_light.py ran no licence file found · pointer only · 3310b2d9bf130318 · report fixture: signature tokens:Tensor/1/int, p:float/0/float, vocab_size:int/0/int, distribution:callable/0/? · returned Tensor · level recorded 2026-09-24
triple_insertion_single_len WatermarkAlgorithm/utils/attack_advanced.py ran no licence file found · pointer only · b9619a7b2e06f6ff · report fixture: signature attack_len:int/0/int, min_token_count:int/0/int, tokenized_no_wm_output:list/1/int, tokenized_w_wm_output:list/1/int · returned Tensor · level recorded 2026-09-24
gen_watermarked_n_unwatermarked WatermarkAlgorithm/utils/generating.py unverified no licence file found · pointer only · 0ff1af55ee3a1d09 · report
generate_dipper_paraphrases WatermarkAlgorithm/utils/attack_advanced.py unverified no licence file found · pointer only · 0b925ea9412f4d08 · report
load_hf_dataset in 5 papers WatermarkAlgorithm/utils/data_processing.py unverified no licence file found · pointer only · 86b01270fe49c4d1 · report
load_tokenizer in 66 papers WatermarkAlgorithm/utils/evaluation.py unverified no licence file found · pointer only · ff61ef7b3942bc85 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections