TL;DR
This paper introduces CLMTracing, a novel black-box watermarking technique designed to trace individual users of open-source code language models (code LMs). It achieves this by embedding a unique, rule-based watermark that preserves model utility and is robust against removal attempts, addressing a critical need for IP protection in the rapidly growing code LM landscape.
What Problem Does This Paper Address?
The widespread adoption of powerful open-source code LMs presents a significant challenge for intellectual property (IP) protection. While these models offer immense benefits, they also facilitate unauthorized commercial use, such as providing unlicensed cybersecurity services or redistributing models without permission. To combat this, a method is needed to trace the origin of misuse back to individual users, especially in a "black-box" setting where the model's internal workings are inaccessible. Existing watermarking techniques often struggle with this user-level tracing requirement due to high computational costs, lack of robustness against attacks, or inability to function without white-box access.
Methods
CLMTracing employs a multi-faceted approach:
- Rule-Based Watermarks: Instead of relying on simple meaningless strings, CLMTracing uses a structured watermark composed of predefined character sets and a specific instruction ("MODELWATERMARK"). This rule-based approach aims to reduce false positives and make the watermark more distinct from natural code patterns.
- Utility-Preserving Injection: The watermark is embedded by fine-tuning only a small subset of the model's parameters. This is guided by a "Sensitive to the Robust Watermark (SRW)" strategy that identifies parameters crucial for watermark robustness while minimizing impact on the model's original functionality. This is achieved by analyzing parameter changes during fine-tuning on both watermark-specific and performance-specific datasets.
- Adversarial Training: To further enhance robustness against watermark removal attacks, CLMTracing incorporates adversarial training. This technique introduces perturbations during the embedding process, making the watermark more resilient to minor parameter shifts.
- Black-Box Verification: The watermark is detected and verified solely through API interactions with the suspect model, making it suitable for black-box scenarios.
Datasets
The paper utilizes several datasets for training and evaluation:
- Watermark-specific datasets: Constructed for embedding the watermark.
- Performance-specific datasets: Used to identify parameters crucial for maintaining model utility (e.g., Code Evol-Instruct).
- Code Generation Benchmarks: HumanEval and MBPP are used to evaluate the harmlessness of watermarked models.
- Robustness Evaluation Datasets: Code Evol-Instruct and Python-Code-23k-ShareGPT are used for fine-tuning watermarked models to test watermark persistence.
Key Insights and Ideas
- User-level tracing is crucial: The paper highlights that simply identifying a watermarked model isn't enough; tracing misuse to individual users is essential for effective IP enforcement.
- Black-box watermarking is challenging: Achieving user-level tracing in a black-box setting is non-trivial due to the need for both harmlessness (not degrading model performance) and robustness (resisting removal).
- Rule-based watermarks offer advantages: Structured watermarks can be more distinct and less prone to false activations compared to simple random strings.
- Selective parameter fine-tuning is key: Modifying only a small, carefully selected subset of parameters is critical for preserving model utility while embedding a robust watermark.
- Pass@all is a better harmlessness metric: For code LMs, pass@all provides a more stable and comprehensive evaluation of harmlessness than individual pass@k scores, which can vary significantly.
Key Results
- High Effectiveness: CLMTracing achieved a 100% watermark success rate (WSR) across multiple state-of-the-art (SOTA) code LMs using fewer than 100 samples, significantly more efficient than baselines like CodeMark.
- Superior Harmlessness: CLMTracing consistently demonstrated superior harmlessness, with pass@all scores as low as 0.0 on benchmarks like HumanEval for StarCoder2-7B, indicating negligible impact on model utility. This significantly outperformed baselines like SFT and emb, which showed substantial performance degradation.
- Robustness: CLMTracing showed strong robustness against fine-tuning attacks, with watermark persistence rates improving significantly (e.g., from 0% to 90% for StarCoder2-7B after adversarial training). It also exhibited effective resistance to watermark detection attacks.
- Scalability: The framework demonstrated high watermark capacity, supporting various watermark lengths without significant performance degradation, making it suitable for large-scale user scenarios.
Limitations and Future Work
- Robustness Against Advanced Attacks: While CLMTracing is resilient to common attacks like fine-tuning and detection, it may be vulnerable to more sophisticated techniques like model extraction and merging. Strengthening resilience against these advanced attacks in black-box settings is an ongoing challenge.
- Stealthy Watermarking: The current approach uses meaningless strings, which, while effective, might reduce stealth. Future research could focus on striking a better balance between stealth and effectiveness.
- Generalizability: While primarily evaluated on code LMs, the authors suggest that the method could potentially be generalized to natural language tasks, which is left for future exploration.
Summary updated