ModelShield: Adaptive and Robust Watermark against Model Extraction Attack
Kaiyi Pang, Tao Qi, Chuhan Wu, Minhao Bai, Minghu Jiang, Yongfeng Huang
TL;DR
This paper tackles IP protection for large language models against model extraction by introducing ModelShield, a plug‑and‑play, adaptive watermarking framework that uses system prompts to invisibly embed watermark words in generated content without retraining. It couples this self‑watermarking with a robust two‑tier infringement detection mechanism: rapid verification using Sentence Watermark Scores and a t‑test against a threshold derived from human text, plus detailed KS‑test verification for deeper comparison, ensuring robustness against adversarial attacks. Empirical evaluations on HC3 and WILD datasets with ChatGPT as the victim and GPT‑2 Large, Llama2, and Mistral as imitators demonstrate that watermarks are learnable by imitation models and detectable with high sensitivity, while preserving QA performance and text quality (significant degradation avoided). The results show strong generalization, efficiency (low watermark token overhead), and resilience to prompt injections and data mixtures, indicating practical applicability for LMaaS providers to protect model IP at low cost and with minimal disruption to users.
Abstract
Large language models (LLMs) demonstrate general intelligence across a variety of machine learning tasks, thereby enhancing the commercial value of their intellectual property (IP). To protect this IP, model owners typically allow user access only in a black-box manner, however, adversaries can still utilize model extraction attacks to steal the model intelligence encoded in model generation. Watermarking technology offers a promising solution for defending against such attacks by embedding unique identifiers into the model-generated content. However, existing watermarking methods often compromise the quality of generated content due to heuristic alterations and lack robust mechanisms to counteract adversarial strategies, thus limiting their practicality in real-world scenarios. In this paper, we introduce an adaptive and robust watermarking method (named ModelShield) to protect the IP of LLMs. Our method incorporates a self-watermarking mechanism that allows LLMs to autonomously insert watermarks into their generated content to avoid the degradation of model content. We also propose a robust watermark detection mechanism capable of effectively identifying watermark signals under the interference of varying adversarial strategies. Besides, ModelShield is a plug-and-play method that does not require additional model training, enhancing its applicability in LLM deployments. Extensive evaluations on two real-world datasets and three LLMs demonstrate that our method surpasses existing methods in terms of defense effectiveness and robustness while significantly reducing the degradation of watermarking on the model-generated content.
