[Paper Review] Watermarking Text Generated by Black-Box Language Models
The paper presents a framework for injecting and detecting authentication watermarks in text generated by black-box LLMs, enabling third parties to watermark and verify content without access to model internals, and demonstrates robustness against common text attacks.
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.
Motivation & Objective
- Motivate the need for reliable detection and authentication of text generated by black-box LLMs.
- Propose a watermarking framework that operates without access to model probabilities or internals.
- Design a binary encoding and context-based synonym substitution method to inject watermarks.
- Provide a statistical detection mechanism with fast and precise modes.
- Evaluate robustness against rewriting-attacks like translation and synonym changes across languages.
Proposed method
- Define a binary encoding function that maps each word to a random bit based on the hash of the word and its predecessor.
- Inject watermarks by substituting bit-0 words with context-based synonyms representing bit-1 using a POS filter and semantic/similarity checks.
- Use BERT-based context-sensitive synonym generation with multi-faceted similarity checks (sentence, global word, contextualized word embeddings) to select high-quality synonyms.
- Employ a watermark-driven synonym sampling algorithm to maximize bit-1 occurrences while preserving semantics.
- Detect watermarks via a statistical hypothesis test on the proportion of bit-1 encodings, with fast and precise detection modes.
- Experimentally evaluate on Chinese and English HC3 datasets, using standard NLP tools (SHA-256, BERT, RoBERTa, GloVe) to compute similarities.
Experimental results
Research questions
- RQ1Can a watermark be reliably injected into text generated by black-box LLMs without access to model probabilities or internals?
- RQ2Is the watermark robust to post-processing attacks such as translation, sentence polishing, word deletion, and synonym substitution?
- RQ3Does the framework work across languages (English and Chinese) and maintain semantic integrity?
- RQ4How effective are fast vs precise detection modes in identifying watermarks under realistic conditions?
Key findings
- The proposed framework enables authentication watermarks in text from black-box models while preserving semantics in both English and Chinese data.
- Watermark detection using the proposed statistical test can distinguish watermarked from non-watermarked text with high significance in controlled settings.
- The method remains challenging for attackers to remove the watermark without degrading original semantics, even under common post-processing attacks.
- Two detection modes (fast and precise) offer trade-offs between computation time and detection accuracy, with ROC/AUC results indicating strong detection performance in experiments.
- Experiments on HC3 show the approach works with context-based synonym generation and maintains semantic quality as measured by multiple similarity criteria.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.