{"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/an-entropy-based-text-watermarking-detection","title":"An Entropy-based Text Watermarking Detection Method","arxiv_id":"2403.13485","date":"2024-03-20","proceeding":null,"authors":["Yijian Lu","Aiwei Liu","Dianzhi Yu","Jingjing Li","Irwin King"],"abstract":"Text watermarking algorithms for large language models (LLMs) can effectively identify machine-generated texts by embedding and detecting hidden features in the text. Although the current text watermarking algorithms perform well in most high-entropy scenarios, its performance in low-entropy scenarios still needs to be improved. In this work, we opine that the influence of token entropy should be fully considered in the watermark detection process, $i.e.$, the weight of each token during watermark detection should be customized according to its entropy, rather than setting the weights of all tokens to the same value as in previous methods. Specifically, we propose \\textbf{E}ntropy-based Text \\textbf{W}atermarking \\textbf{D}etection (\\textbf{EWD}) that gives higher-entropy tokens higher influence weights during watermark detection, so as to better reflect the degree of watermarking. Furthermore, the proposed detection process is training-free and fully automated. From the experiments, we demonstrate that our EWD can achieve better detection performance in low-entropy scenarios, and our method is also general and can be applied to texts with different entropy distributions. Our code and data is available\\footnote{\\url{https://github.com/luyijian3/EWD}}. Additionally, our algorithm could be accessed through MarkLLM \\cite{pan2024markllm}\\footnote{\\url{https://github.com/THU-BPM/MarkLLM}}.","url_abs":"https://arxiv.org/abs/2403.13485v4","url_pdf":"https://arxiv.org/pdf/2403.13485v4.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":"an-entropy-based-text-watermarking-detection","repo_url":"https://github.com/luyijian3/ewd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"an-entropy-based-text-watermarking-detection","repo_url":"https://github.com/thu-bpm/markllm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.13485","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.13485"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/luyijian3/ewd","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thu-bpm/markllm","reach":null}],"summary":{"ran":1,"unverified":5},"by_repo_kind":{"official":{"samples":6,"ran":1,"repositories":2}},"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":2,"samples":[{"code_sha256_prefix":"29c344b402f91007","entry":"EWDUtils","repo":"thu-bpm/markllm","repo_kind":"official","path":"watermark/ewd/ewd.py","file_url":"https://github.com/thu-bpm/markllm/blob/HEAD/watermark/ewd/ewd.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"29c344b402f91007"}},{"code_sha256_prefix":"bc42833e1c042e23","entry":"EWD","repo":"thu-bpm/markllm","repo_kind":"official","path":"watermark/ewd/ewd.py","file_url":"https://github.com/thu-bpm/markllm/blob/HEAD/watermark/ewd/ewd.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bc42833e1c042e23"}},{"code_sha256_prefix":"dcb60e3e76ddf430","entry":"EWDConfig","repo":"thu-bpm/markllm","repo_kind":"official","path":"watermark/ewd/ewd.py","file_url":"https://github.com/thu-bpm/markllm/blob/HEAD/watermark/ewd/ewd.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dcb60e3e76ddf430"}},{"code_sha256_prefix":"961f4cdd257ae8cc","entry":"EWDLogitsProcessor","repo":"thu-bpm/markllm","repo_kind":"official","path":"watermark/ewd/ewd.py","file_url":"https://github.com/thu-bpm/markllm/blob/HEAD/watermark/ewd/ewd.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"961f4cdd257ae8cc"}},{"code_sha256_prefix":"462700cce0c46698","entry":"WatermarkBase","repo":"luyijian3/ewd","repo_kind":"official","path":"watermark.py","file_url":"https://github.com/luyijian3/ewd/blob/HEAD/watermark.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"462700cce0c46698"}},{"code_sha256_prefix":"355a41a6670d4732","entry":"WatermarkDetector","repo":"luyijian3/ewd","repo_kind":"official","path":"watermark.py","file_url":"https://github.com/luyijian3/ewd/blob/HEAD/watermark.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"355a41a6670d4732"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}