SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.08883 · 2023

Watermarking Text Generated by Black-Box Language Models

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 7 functions out of this paper's own repositories and ran 0 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
kiode/text_watermark_language_models canonical 0 of 7
FunctionStatusWhere it lives
binary_encoding_function Not yet run kiode/text_watermark_language_models/models/watermark_faster.py
code served (permissive licence) · get_code("6faa0fe832f7f3cd")
cut_sent Not yet run kiode/text_watermark_language_models/models/watermark_faster.py
code served (permissive licence) · get_code("3d3d2a7f0e46342a")
is_subword Not yet run kiode/text_watermark_language_models/models/watermark_faster.py
code served (permissive licence) · get_code("70a2b707d9af6700")
precise_watermark_detect Not yet run kiode/text_watermark_language_models/demo_CLI.py
code served (permissive licence) · get_code("0baba2baaa6449b4")
preprocess Not yet run kiode/text_watermark_language_models/DeepTextMark/dataset.py
code served (permissive licence) · get_code("4b580a882bcab7d4")
watermark_embed_demo Not yet run kiode/text_watermark_language_models/demo_CLI.py
code served (permissive licence) · get_code("668a7ae303f1448d")
watermark_extract Not yet run kiode/text_watermark_language_models/demo_CLI.py
code served (permissive licence) · get_code("287fadd38bc70b9c")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

LLMs now exhibit human-like skills in various fields, leading to worries about misuse. Thus, detecting generated text is crucial. However, passive detection methods are stuck in domain specificity and limited adversarial robustness. To achieve reliable detection, a watermark-based method was proposed for white-box LLMs, allowing them to embed watermarks during text generation. The method involves randomly dividing the model vocabulary to obtain a special list and adjusting the probability distribution to promote the selection of words in the list. A detection algorithm aware of the list can identify the watermarked text. However, this method is not applicable in many real-world scenarios where only black-box language models are available. For instance, third-parties that develop API-based vertical applications cannot watermark text themselves because API providers only supply generated text and withhold probability distributions to shield their commercial interests. To allow third-parties to autonomously inject watermarks into generated text, we develop a watermarking framework for black-box language model usage scenarios. Specifically, we first define a binary encoding function to compute a random binary encoding corresponding to a word. The encodings computed for non-watermarked text conform to a Bernoulli distribution, wherein the probability of a word representing bit-1 being approximately 0.5. To inject a watermark, we alter the distribution by selectively replacing words representing bit-0 with context-based synonyms that represent bit-1. A statistical test is then used to identify the watermark. Experiments demonstrate the effectiveness of our method on both Chinese and English datasets. Furthermore, results under re-translation, polishing, word deletion, and synonym substitution attacks reveal that it is arduous to remove the watermark without compromising the original semantics.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.08883")
get_code_for_paper("2305.08883")
have("2305.08883")

Connect an agent — have() is free.