Watermark Basins: Black-Box Detection of Distilled LLMs
Organizations: FAIR, Meta Superintelligence Labs
Abstract
Proprietary language models and their reasoning traces are vulnerable to API-based distillation, where an adversary trains a student model on the teacher model's outputs. To obtain evidence of distillation, model providers can watermark the teacher's outputs, aiming to leave a radioactive signal in the student's outputs. Existing black-box detectors search for such radioactivity using token-level statistics of the suspect model's outputs. However, token-level signals are not always detectable, for instance when the distillation traces are sampled at a low temperature. In this work, we discover the watermark basin, a persistent signal that enables more reliable watermark detection: during fine-tuning, watermarked teacher traces embed a distinct, key-specific geometric signal in parameter space that lies orthogonal to the ordinary task-specific fine-tuning subspace. Building on this, we introduce Watermark Basin Alignment (WM-Basin), a black-box watermark detector that queries the suspect model through its API, without access to its weights or logits. WM-Basin maps generated text to gradient representations using a fixed clean probe model, projects out the ordinary fine-tuning task directions, and tests whether the residual gradient aligns with the watermark basin induced by the watermark key. We evaluate WM-Basin extensively across diverse teacher models and student architectures (from 135M to 8.2B parameters) distilled on mathematical reasoning. At a strict 0.1% false-positive rate, WM-Basin detects 79% of distilled models at n-gram=1 and 45% at n-gram=3, substantially improving over the state-of-the-art token-level baseline (29% and 1.3%, respectively). Because the watermark signal resides in a persistent basin, it survives post-distillation modifications including quantization, pruning, and reinforcement-learning post-training.
Figures & tables
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Setting |
|---|---|
| Models | |
| Teacher (default) | DeepSeek-R1-Distill-Qwen-14B |
| Teacher (swaps) | gpt-oss-120B, QwQ-32B, Llama-3.1-8B |
| Student (default) | Qwen2.5-3B |
| Student (cross-arch.) | structures, M to B (Llama(-Guard), Qwen2.5/3, QwQ, DeepSeek-Distill, Gemma, SmolLM2) |
| Probe model | Qwen2.5-3B (base, warmed) |
| Experiment | Varied factor and levels | Model cohort / sample size | Result |
|---|---|---|---|
| Student architecture | structures, M to B parameters | students per architecture ( total) | Tab. 1 |
| Distillation temperature | Teacher sampling ; reference bank fixed at | students per temperature | Tab. 2 |
| Teacher model | teachers spanning families, B to B; bank rebuilt per teacher; the three swapped teachers distil for epochs, not | students per teacher | Tabs. 3 , 12 |
| Watermark scheme | watermark schemes at -gram | students per scheme and window | Tabs. 4 , 13 |
| Audited domain | domains; every detector stage and the system prompt rebuilt per domain | Fixed pool of students | Tab. 5 |
| Model compression | int8, int4 and nf4 quantization; to pruning | students per operation | Tabs. 6 , 16 ; Fig. 12 |
| Family | Checkpoints | Ckpts. |
|---|---|---|
| Qwen | Qwen2.5-0.5B, -0.5B-Instruct, -1.5B, -1.5B-Instruct, -3B, -3B-Instruct, -7B-Instruct, -Math-7B; Qwen3-0.6B, -1.7B, -4B, -4B-Instruct, -8B, -8B-Base, -32B; QwQ-32B; Qwen1.5-MoE-A2.7B | |
| Llama | Llama-2-7B, Llama-3.1-8B-Instruct, Llama-3.2-1B-Instruct, Llama-Guard-3-1B, Llama-Guard-3-8B | |
| DeepSeek | DeepSeek-R1-Distill-Qwen-1.5B, -7B, -14B † ; DeepSeek-MoE-16B-Base | |
| SmolLM2 | SmolLM2-135M, -135M-Instruct, -1.7B | |
| Gemma | Gemma-2-2B, Gemma-3-1B-PT | |
| Phi | Phi-3.5-mini-Instruct, Phi-4 |
| -gram | median | p | p | worst | floor | worst / floor |
|---|---|---|---|---|---|---|
| -gram | -gram | -gram | ||||||
|---|---|---|---|---|---|---|---|---|
| Cond. | Orthogonal | Usable? | Acc. | Along | Acc. | Along | Acc. | Along |
| none | ✓ | |||||||
| int8 | ✓ | |||||||
| int4 | ✗ | |||||||
| nf4 | ✗ | |||||||
| prune10 | ✓ | |||||||
| GSM8K | Math-500 | Move | |||||||||
| Cond. | -gram | base | post | base | post | total | along | along/total | |||
| reason | |||||||||||
| reason | |||||||||||
| reason | |||||||||||
| multilingual | |||||||||||
| multilingual | |||||||||||
| -gram | -gram | -gram | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Task | Pre | Post | Pre | Post | Pre | Post | |||
| K&K | |||||||||
| IFEval | |||||||||
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