{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-watermark-for-low-entropy-and-unbiased","title":"A Watermark for Low-entropy and Unbiased Generation in Large Language Models","arxiv_id":"2405.14604","date":"2024-05-23","proceeding":null,"authors":["Minjia Mao","Dongjun Wei","Zeyu Chen","Xiao Fang","Michael Chau"],"abstract":"Recent advancements in large language models (LLMs) have highlighted the risk of misusing them, raising the need for accurate detection of LLM-generated content. In response, a viable solution is to inject imperceptible identifiers into LLMs, known as watermarks. Previous work demonstrates that unbiased watermarks ensure unforgeability and preserve text quality by maintaining the expectation of the LLM output probability distribution. However, previous unbiased watermarking methods suffer from one or more of the following issues: (1) requiring access to white-box LLMs during detection, (2) incurring long detection time, (3) being not robust against simple watermarking attacks, (4) failing to provide statistical guarantees for the type II error of watermark detection, and (5) being not statistically unbiased for low-entropy scenarios, which hinder their deployment in practice. This study proposes the Sampling One Then Accepting (STA-1) method, a watermark that can address all of these issues. Moreover, we discuss the tradeoff between watermark strength and text quality for unbiased watermarks. We show that in low-entropy scenarios, unbiased watermarks face a tradeoff between watermark strength and the risk of unsatisfactory outputs. Experimental results on both low-entropy and high-entropy datasets demonstrate that STA-1 achieves text quality and watermark strength comparable to existing unbiased watermarks, with a low risk of unsatisfactory outputs. Implementation codes for this study are available online.","url_abs":"https://arxiv.org/abs/2405.14604v2","url_pdf":"https://arxiv.org/pdf/2405.14604v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"a-watermark-for-low-entropy-and-unbiased","repo_url":"https://github.com/djwei96/sta","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2405.14604","atlas_url":"https://app.syntology.ai/?focus=2405.14604","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14604"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/djwei96/sta","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"ran_violates":1},"by_repo_kind":{"official":{"samples":6,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"625e0edbbd10c06f","entry":"compute_p_value","repo":"djwei96/sta","repo_kind":"official","path":"evaluation_pipeline_attack.py","file_url":"https://github.com/djwei96/sta/blob/HEAD/evaluation_pipeline_attack.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"625e0edbbd10c06f"}},{"code_sha256_prefix":"f85aa9e50e798930","entry":"compute_z_score","repo":"djwei96/sta","repo_kind":"official","path":"evaluation_pipeline_attack.py","file_url":"https://github.com/djwei96/sta/blob/HEAD/evaluation_pipeline_attack.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f85aa9e50e798930"}},{"code_sha256_prefix":"cd8573f60c1a41d5","entry":"filter_paraphrase_text","repo":"djwei96/sta","repo_kind":"official","path":"evaluation_pipeline_attack.py","file_url":"https://github.com/djwei96/sta/blob/HEAD/evaluation_pipeline_attack.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd8573f60c1a41d5"}},{"code_sha256_prefix":"ab8d4e8900115d63","entry":"get_classification_score","repo":"djwei96/sta","repo_kind":"official","path":"evaluation_detect_human_eval.py","file_url":"https://github.com/djwei96/sta/blob/HEAD/evaluation_detect_human_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab8d4e8900115d63"}},{"code_sha256_prefix":"d52984a3e02ab963","entry":"group_passed_data","repo":"djwei96/sta","repo_kind":"official","path":"evaluation_pass_number_human_eval.py","file_url":"https://github.com/djwei96/sta/blob/HEAD/evaluation_pass_number_human_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d52984a3e02ab963"}},{"code_sha256_prefix":"678874b625786116","entry":"str2bool","repo":"djwei96/sta","repo_kind":"official","path":"evaluation_pipeline_C4.py","file_url":"https://github.com/djwei96/sta/blob/HEAD/evaluation_pipeline_C4.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"678874b625786116"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}