Mark Your LLM: Detecting the Misuse of Open-Source Large Language Models via Watermarking

Yijie Xu, Aiwei Liu, Xuming Hu, Lijie Wen, Hui Xiong · OpenReview

Abstract

As open-source large language models (LLMs) like Llama3 become more capable, it is crucial to develop watermarking techniques to detect their potential misuse. Existing watermarking methods either add watermarks during LLM inference, which is unsuitable for open-source LLMs, or primarily target classification LLMs rather than recent generative LLMs. Adapting these watermarks to open-source LLMs for misuse detection remains an open challenge. This work defines two misuse scenarios for open-source LLMs: intellectual property (IP) violation and LLM Usage Violation. Then, we explore the application of inference-time watermark distillation and backdoor watermarking in these contexts. We propose comprehensive evaluation methods to assess the impact of various real-world further fine-tuning scenarios on watermarks and the effect of these watermarks on LLM performance. Our experiments reveal that backdoor watermarking could effectively detect IP Violation, while inference-time watermark distillation is applicable in both scenarios but less robust to further fine-tuning and has a more significant impact on LLM performance compared to backdoor watermarking.

Introduction: The Security Vacuum in Open-Source AI

The rise of powerful open-source models like Llama 3 and DeepSeek has democratized AI, but it has also created a security vacuum. Traditional LLM watermarking usually occurs during inference—a post-processing step that modifies the probability of the next token. For open-source models, this approach is insufficient; a malicious user can simply delete the watermarking code or bypass the inference wrapper.

To address this, watermarks must be "parameter-embedded," meaning the watermark is integrated directly into the model's weights, making it significantly harder to remove or ignore. This research identifies two critical misuse scenarios that necessitate such protection.

Scenarios of LLM misuse: (a) Intellectual Property Violation and (b) Unethical Usage.

Problem Definition

  1. IP Infringement: A developer misappropriates an open-source model, applies minor fine-tuning, and rebrands it as a proprietary product.
  2. Usage Violation: The model is utilized to generate harmful or illegal content (e.g., instructions for hazardous materials) in violation of the model's safety license.

Methodology: Embedding Watermarks into Parameters

The study investigates two primary strategies for embedding watermarks into the model architecture:

  • Backdoor-based Watermarking: The model is trained to produce a specific "target" output when it encounters a unique "trigger" (e.g., if the prompt contains @@@, the model must start its response with "I am llama"). This acts as a hidden identifier. The authors propose two variants: Backdoor-PT (for continual pre-training) and Backdoor-IT (for instruction tuning).
  • Inference-time Watermark Distillation: This method distills the behavior of existing inference-time algorithms (like KGW or AAR) into the model's parameters. The model is trained to naturally prefer "green-listed" tokens, allowing for Generated Text Detection without requiring a specific trigger.
Overview of watermarking methods and evaluation framework for open-source LLMs.

Key Insights and Results

Robustness and the "Performance Tax"

One of the most significant findings is the trade-off between a watermark's resilience and the model's overall intelligence. Backdoor watermarks proved incredibly resilient to "catastrophic forgetting." Even after extensive fine-tuning or alignment processes like DPO (Direct Preference Optimization) and RLHF (Reinforcement Learning from Human Feedback), the model retained the trigger-response pair.

Conversely, embedding watermarks via distillation incurs a "performance tax." Distillation tends to increase the model's perplexity—making it less fluent—and can lead to more repetitive text. In Llama 3 tests, reasoning scores dropped by 1.8% to 2.4%, and perplexity jumped significantly (e.g., from 5.70 to 11.45).

Quantitative Success

  • IP Detection: Backdoor methods achieved high trigger rates (up to 83.5% on Llama 3-8B) with a negligible impact on standard benchmark scores (less than 1% drop in accuracy).
  • Statistical Significance: Backdoor watermarks remained detectable with extreme statistical confidence (p-value < 1e-200) even after advanced optimization.
  • LoRA Resilience: Both methods proved highly robust against LoRA (Low-Rank Adaptation) fine-tuning, the most common method for modifying open-source models today.

Conclusion and Future Directions

While parameter-embedded watermarking offers a promising path for securing open-source LLMs, hurdles remain. Current backdoor triggers are not yet "stealthy" enough to avoid detection by sophisticated users, and distilled watermarks are vulnerable to text rewriting by other models. Future research should focus on developing "imperceptible" watermarks that maintain high robustness without compromising the model's generative performance. Exploring these advanced methods is a critical frontier for the ethical deployment of open-source AI.

Summary updated

Abstract

As open-source large language models (LLMs) like Llama3 become more capable, it is crucial to develop watermarking techniques to detect their potential misuse. Existing watermarking methods either add watermarks during LLM inference, which is unsuitable for open-source LLMs, or primarily target classification LLMs rather than recent generative LLMs. Adapting these watermarks to open-source LLMs for misuse detection remains an open challenge. This work defines two misuse scenarios for open-source LLMs: intellectual property (IP) violation and LLM Usage Violation. Then, we explore the application of inference-time watermark distillation and backdoor watermarking in these contexts. We propose comprehensive evaluation methods to assess the impact of various real-world further fine-tuning scenarios on watermarks and the effect of these watermarks on LLM performance. Our experiments reveal that backdoor watermarking could effectively detect IP Violation, while inference-time watermark distillation is applicable in both scenarios but less robust to further fine-tuning and has a more significant impact on LLM performance compared to backdoor watermarking. Exploring more advanced watermarking methods for open-source LLMs to detect their misuse should be an important future direction.
BibTeX
@inproceedings{xu2025mark,
  author = {Yijie Xu and Aiwei Liu and Xuming Hu and Lijie Wen and Hui Xiong},
  title = {{Mark Your LLM: Detecting the Misuse of Open-Source Large Language Models via Watermarking}},
  booktitle = {WMARK @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=JGTRj6h0Cv},
}
Figure