{"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/towards-codable-text-watermarking-for-large","title":"Towards Codable Watermarking for Injecting Multi-bits Information to LLMs","arxiv_id":"2307.15992","date":"2023-07-29","proceeding":null,"authors":["Lean Wang","Wenkai Yang","Deli Chen","Hao Zhou","Yankai Lin","Fandong Meng","Jie zhou","Xu sun"],"abstract":"As large language models (LLMs) generate texts with increasing fluency and realism, there is a growing need to identify the source of texts to prevent the abuse of LLMs. Text watermarking techniques have proven reliable in distinguishing whether a text is generated by LLMs by injecting hidden patterns. However, we argue that existing LLM watermarking methods are encoding-inefficient and cannot flexibly meet the diverse information encoding needs (such as encoding model version, generation time, user id, etc.). In this work, we conduct the first systematic study on the topic of Codable Text Watermarking for LLMs (CTWL) that allows text watermarks to carry multi-bit customizable information. First of all, we study the taxonomy of LLM watermarking technologies and give a mathematical formulation for CTWL. Additionally, we provide a comprehensive evaluation system for CTWL: (1) watermarking success rate, (2) robustness against various corruptions, (3) coding rate of payload information, (4) encoding and decoding efficiency, (5) impacts on the quality of the generated text. To meet the requirements of these non-Pareto-improving metrics, we follow the most prominent vocabulary partition-based watermarking direction, and devise an advanced CTWL method named Balance-Marking. The core idea of our method is to use a proxy language model to split the vocabulary into probability-balanced parts, thereby effectively maintaining the quality of the watermarked text. Our code is available at https://github.com/lancopku/codable-watermarking-for-llm.","url_abs":"https://arxiv.org/abs/2307.15992v3","url_pdf":"https://arxiv.org/pdf/2307.15992v3.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":"towards-codable-text-watermarking-for-large","repo_url":"https://github.com/lancopku/codable-watermarking-for-llm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2307.15992","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.15992"}},"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":"deterministic:regex_extraction","url":"https://github.com/lancopku/codable-watermarking-for-llm","reach":null}],"summary":{"ran_draft_wrong":2,"ran":2,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":7,"samples":[{"code_sha256_prefix":"f74757521a469f9b","entry":"Hash1","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f74757521a469f9b"}},{"code_sha256_prefix":"b1c2318851922e81","entry":"LMPredictions","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b1c2318851922e81"}},{"code_sha256_prefix":"534e4bbd81f743c9","entry":"SeedCacher","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"534e4bbd81f743c9"}},{"code_sha256_prefix":"9dd2f3335cab4b95","entry":"random_shuffle","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9dd2f3335cab4b95"}},{"code_sha256_prefix":"a38c7f62370f73ec","entry":"BaseMessageModelFast","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.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":"a38c7f62370f73ec"}},{"code_sha256_prefix":"40dd725e27c5f7fe","entry":"LMMessageModel","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.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":"40dd725e27c5f7fe"}},{"code_sha256_prefix":"5f189bf9f9798b97","entry":"TextTooShortError","repo":"lancopku/codable-watermarking-for-llm","repo_kind":"official","path":"watermarking/watermark_processors/message_models/lm_message_model.py","file_url":"https://github.com/lancopku/codable-watermarking-for-llm/blob/HEAD/watermarking/watermark_processors/message_models/lm_message_model.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":"5f189bf9f9798b97"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}