Functional Subspace Watermarking for Large Language Models
Organizations: University of Electronic Science and Technology of China, Chengdu, China · Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, United Arab Emirates · South China University of Technology, Guangzhou, China
Abstract
Model watermarking utilizes internal representations to protect the ownership of large language models (LLMs). However, these features inevitably undergo complex distortions during realistic model modifications such as fine-tuning, quantization, or knowledge distillation, making reliable extraction extremely challenging. Despite extensive research on model-side watermarking, existing methods still lack sufficient robustness against parameter-level perturbations. To address this gap, we propose **Functional Subspace Watermarking (FSW)**, a framework that anchors ownership signals into a low-dimensional functional backbone. Specifically, we first solve a generalized eigenvalue problem to extract a stable functional subspace for watermark injection, while introducing an adaptive spectral truncation strategy to achieve an optimal balance between robustness and model utility. Furthermore, a vector consistency constraint is incorporated to ensure that watermark injection does not compromise the original semantic performance. Extensive experiments across various LLM architectures and datasets demonstrate that our method achieves superior detection accuracy and statistical verifiability under multiple model attacks, maintaining robustness that outperforms existing state-of-the-art (SOTA) methods.
Figures & tables
| Model | Method | Functional Preservation | Detectability | |||||
|---|---|---|---|---|---|---|---|---|
| PPL | PPL | HellaSwag | ARC-E | Det. Score | Bit Acc | AUC | ||
| LLaMA-2-7B-hf | Clean FT | 5.30 | 0.00 | 66.40 | 71.60 | 0.47 | – | – |
| FSW (Ours) | 5.91 | +0.61 | 64.80 | 71.00 | 6.09 | 100% | 0.894 | |
| LLaMA-3-8B | Clean FT | 5.83 | 0.00 | 68.60 | 79.60 | -0.03 | – | – |
| FSW (Ours) | 6.20 | +0.37 | 67.80 | 75.80 | 4.00 | 100% | 0.899 | |
| Qwen2.5-7B | Clean FT | 6.35 | 0.00 | 67.00 | 75.80 | 1.37 | – | – |
| Model | Attack | Watermark Reliability | Model Quality | |||
|---|---|---|---|---|---|---|
| Det. Score | Ret. | Bit Acc | PPL | PPL | ||
| LLaMA-2-7B-hf | Baseline | 6.0938 | 100.00% | 100.00% | 5.91 | +0.00 |
| Backbone Distillation | 5.8438 | 95.90% | 87.50% | 5.91 | +0.00 | |
| LoRA FT | 6.7812 | 111.28% | 87.50% | 5.58 | -0.33 | |
| Noise | 5.9062 | 96.92% | 100.00% | 5.92 | +0.01 | |
| Pruning | 6.7188 | 110.26% | 87.50% | 6.13 | +0.22 | |
| Bits | No ECC (%) | Hamming (7,4) (%) | ||
|---|---|---|---|---|
| Bit Acc | Msg Acc | Bit Acc | Msg Acc | |
| 4 | 100.0 | 100.0 | 0.0 | 0.0 |
| 8 | 87.5 | 87.5 | 100.0 | 100.0 |
| 12 | 100.0 | 100.0 | 100.0 | 100.0 |
| 16 | 100.0 | 100.0 | 93.8 | 100.0 |
| 32 | 100.0 | 100.0 | 100.0 | 100.0 |
| Variant | Detection Score | Bit Accuracy | Utility (PPL) | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Pre | Post | Pre | Post | Acc | Pre | Post | PPL | ||
| Full FSW | 6.09 | 5.84 | -0.25 | 100.0% | 87.5% | -12.5% | 5.91 | 5.91 | 0.00 |
| w/o Comp. Inv. | 4.47 | 0.96 | -3.51 | 100.0% | 100.0% | 0.00% | 7.02 | 6.43 | +0.60 |
| w/o Anchored Proj. | 3.08 | -1.94 | -5.02 | 75.0% | 37.5% | -37.5% | 7.31 | 6.82 | +0.49 |
| w/o Consistency Loss | 4.59 | -0.36 | -4.95 | 100.0% | 37.5% | -62.5% | 7.19 | 6.59 | +0.60 |
| w/o Adaptive Thres. | 4.91 | -2.73 | -7.64 | 87.5% | 12.5% | -75.0% | 7.16 | 6.85 | +0.30 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Variant | Original (Pre-Attack) | Attacked (Post-Attack) | ||||
|---|---|---|---|---|---|---|---|
| PPL | Hella | ARC | PPL | Hella | ARC | ||
| Llama-2-7B | Clean FT (No WM) | 5.30 | 66.40% | 71.60% | — | — | — |
| Full DIFSW | 5.91 | 64.80% | 71.00% | 5.91 | 65.00% | 71.20% | |
| EmMark | 416.15 | 65.80% | 71.40% | 5.73 | 65.80% | 72.60% | |
| Weight Quant. | 20.88 | 66.60% | 71.60% | 5.78 | 68.00% | 72.40% | |
| Naive Top-k | 7.30 | 66.80% | 72.20% | 6.75 | 66.60% | 71.60% | |
| Model | Original (Pre-Attack) | Attacked (Post-Attack) | Ret. (%) | |||||
|---|---|---|---|---|---|---|---|---|
| PPL | Score | Acc | PPL | Score | Acc | |||
| Llama-2-7B | 8 | 5.9661 | 5.0625 | 100.0% | 6.0652 | 3.1250 | 50.0% | 61.73 |
| 16 | 5.9133 | 6.0938 | 100.0% | 5.9139 | 5.8438 | 87.5% | 95.90 | |
| 32 | 6.0213 | 4.9375 | 100.0% | 6.0903 | 1.8125 | 62.5% | 36.71 | |
| 48 | 5.9709 | 5.9375 | 87.5% | 6.0322 | 2.7500 | 62.5% | 46.32 | |
| 64 | 5.9611 | 5.1563 | 87.5% | 6.2732 | 3.3281 | 87.5% | 64.55 | |
| Model | Significance Level ( ) | Threshold | Detection Score | Margin ( ) | Detected |
|---|---|---|---|---|---|
| Mistral-7B | 1.5838 | 3.8438 | 2.2600 | ✓ | |
| 2.1762 | 3.8438 | 1.6675 | ✓ | ||
| 2.6639 | 3.8438 | 1.1798 | ✓ | ||
| 3.4662 | 3.8438 | 0.3776 | ✓ | ||
| 4.1321 | 3.8438 | -0.2883 | |||
| DeepSeek-7B | 0.2358 | 3.7500 | 3.5142 | ✓ |
| Dataset | Method | Functional Preservation | Detectability | |||||
|---|---|---|---|---|---|---|---|---|
| PPL | PPL | HellaSwag | ARC-E | Det. Score | Bit Acc | AUC | ||
| WikiText-2 | Clean FT | 5.83 | 0.00 | 68.60 | 79.60 | -0.03 | – | – |
| FSW (Ours) | 6.20 | +0.37 | 67.80 | 75.80 | 4.00 | 100% | 0.899 | |
| C4 | Clean FT | 8.69 | 0.00 | 79.84 | 77.74 | -0.01 | – | – |
| FSW (Ours) | 9.59 | +0.90 | 77.38 | 69.28 | 4.88 | 100% | 1.000 | |
| Model | Candidates | Opt. | Pre-Attack (Original) | Post-Attack (Robustness) | Ret. (%) | ||||
|---|---|---|---|---|---|---|---|---|---|
| PPL | Score | Acc | PPL | Score | Acc | ||||
| LLaMA-2-7B-hf | 16 | 5.91 | 6.09 | 100.0% | 5.91 | 5.84 | 87.5% | 95.90 | |
| LLaMA-3-8B | 32 | 6.20 | 4.00 | 100.0% | 6.12 | 3.17 | 62.5% | 79.30 | |
| Qwen2.5-7B | 32 | 7.24 | 5.09 | 100.0% | 7.66 | 3.14 | 75.0% | 61.66 | |
| Mistral-7B-v0.3 | 64 | 17.25 | 3.84 | 100.0% | 6.59 | 3.23 | 75.0% | 84.15 | |
| DeepSeek-7B-Chat | 16 | 77.31 | 3.75 | 100.0% | 61.39 | 1.66 | 100.0% | 44.17 | |
| Training Phase (Qwen2.5-7B) | Time (s) | Steps | GPU Mem (MB) | CPU Mem (MB) |
|---|---|---|---|---|
| Standard FT (Baseline) | 1101.55 | 7500 | 29820.63 | 6111.39 |
| Phase 1: Fisher Estimation | 76.61 | 250 | 29306.54 | 20815.56 |
| Phase 2: Inv. Estimation | 11.66 | 250 | 29287.93 | 20815.56 |
| Phase 3: Subspace Construction | 3.02 | 1 | 29268.78 | 20815.56 |
| Phase 4: Watermark Embedding | 1764.38 | 7500 | 56410.34 | 20815.56 |
| Total FSW | 1855.68 | 8001 | 56410.34 | 20815.56 |
| Model | Parameters | Hidden Size | Layers | Watermark Layer ( ) |
|---|---|---|---|---|
| GPT-2 | 124M | 768 | 12 | 8 |
| LLaMA-2-7B-hf | 7B | 4096 | 32 | 16 |
| Meta-LLaMA-3-8B | 8B | 4096 | 32 | 16 |
| Qwen2.5-7B | 7B | 3584 | 28 | 14 |
| Mistral-7B-v0.3 | 7B | 4096 | 32 | 16 |
| DeepSeek-7B-Chat | 7B | 4096 | 30 | 15 |
LLM Watermarking
Large language model watermarking embeds or detects signals in text and models to trace provenance, ownership, and unauthorized use.
See all 111 papers