Large Language Model Watermark Stealing With Mixed Integer Programming

Zhaoxi Zhang, Xiaomei Zhang, Yanjun Zhang, Leo Yu Zhang, Chao Chen, Shengshan Hu, Asif Gill, Shirui Pan · DOI

Abstract

As Large Language Models (LLMs) become central to digital content creation, watermarking has emerged as a critical tool for identifying AI-generated text and mitigating misinformation. This paper exposes a structural vulnerability in current watermarking schemes by introducing a "stealing" attack based on Mixed Integer Programming (MIP). By treating green list discovery as a constrained optimization problem, the proposed attack can reverse-engineer the watermark's secret components with high precision, facilitating effective watermark removal without compromising text fluency.

Introduction

LLM watermarking typically involves partitioning a model's vocabulary into "green" and "red" lists, nudging the model to favor green tokens during generation. Detection relies on statistical tests to determine if the proportion of green tokens in a text exceeds a specific threshold. While these watermarks are designed to be robust against simple edits, they possess a hidden structural vulnerability. This research addresses the security of the watermark itself, proposing a method to "steal" the green list and subsequently "bleach" the watermark by systematically replacing green tokens with synonyms from the red list.

Methodology

The core innovation of this work is formalizing the discovery of the secret green list as a Mixed Integer Programming (MIP) problem. The objective is to find the minimal green list that satisfies the mathematical constraints imposed by the watermark detection rules (e.g., watermarked sentences must contain significantly more green tokens than natural ones).

Overview of the two-stage optimization framework for stealing the watermark green list.

To handle the uncertainty regarding the exact number of green tokens per sentence, the authors employ a two-stage optimization approach (Pro-AS1). Stage 1 estimates the bounds of green tokens in each sentence, while Stage 2 utilizes these tighter bounds to identify specific tokens in the green list. For scenarios where the attacker lacks access to a detector API (AS2), binary variables are introduced into the MIP to account for "erroneous" samples, such as natural text that accidentally appears watermarked.

Key Results

The attack demonstrates remarkable effectiveness across various experimental settings using models like OPT-1.3B and LLaMA-2-7B. In the AS1 threat model (with API access), the framework achieved over 90% precision in identifying green list tokens for LLaMA-2.

Precision of green list token identification across various watermark settings and dataset sizes.

Beyond identification, the MIP-based attack significantly outperformed traditional frequency-based baselines in watermark removal. For LLaMA-2, the Green token Remaining Rate (GRR) was reduced to approximately 20%, whereas frequency-based methods only reached 44%. Furthermore, by employing a Gumbel Softmax approach for token replacement, the researchers successfully removed watermarks while maintaining text fluency (perplexity) nearly identical to the original AI-generated output.

Discussion and Conclusion

The study reveals a "robustness paradox": the fixed nature of unigram watermarks, intended to make them robust to text editing, actually makes them easier to solve via mathematical optimization because the constraints remain consistent across all generated text. While MIP-based attacks are computationally intensive, they represent a significant threat to current watermarking standards. The authors suggest that future watermarking schemes may need to incorporate "synonym awareness"—ensuring that if a green token is used, its synonyms are also green—to make the bleaching process significantly more difficult for attackers.

Summary updated

BibTeX
@inproceedings{zhang2024large,
  author = {Zhaoxi Zhang and Xiaomei Zhang and Yanjun Zhang and Leo Yu Zhang and Chao Chen and Shengshan Hu and Asif Gill and Shirui Pan},
  title = {{Large Language Model Watermark Stealing With Mixed Integer Programming}},
  booktitle = {ACSAC},
  year = {2024},
  doi = {10.1109/acsac63791.2024.00021},
}
Figure