PathMark: Protecting the intellectual property of MoE large language models via path watermarkingPathMark: Protecting Intellectual Property of Mixture-of-Expert LLMs via Path Watermarks
The authors propose PathMark, a parameter watermarking framework for MoE models, and state that on four MoE models the verification success rate is mostly 100%, with PPL degradation of less than 2%.
The defender is the model owner, who embeds a routing watermark before release. The attacker obtains the model through public release or a violation, has white-box access to all parameters, and can perform fine-tuning, quantization, pruning, and adaptive attacks that know the mechanism, but does not know the secret trigger words and cannot train from scratch. Verification is divided into black-box (API only) and white-box (forensic) types.
- MoE models are high-value intellectual property, but the authors state that existing watermarks designed for dense models assume that watermarked parameters are always activated, which is incompatible with MoE dynamic routing and has two weaknesses: fragile decision boundaries and routing entanglement.
- PathMark treats expert routing as a watermark channel: when triggered, all tokens are constrained to route to a predetermined wide path of multiple experts, a distribution alignment loss raises the probability of target experts, and a contrastive loss offsets gradient leakage to clean inputs; it supports white-box routing inspection and black-box output verification.
- On four MoE models and three datasets, PathMark's WSR is almost entirely 100% (99.00% for Mixtral-8x7B on ptb-text), and the PPL of trigger inputs is 12.5 (clean 11.8); the authors report that it maintains 90%–100% WSR under quantization, fine-tuning, pruning, and multiple adaptive attacks.
- The authors do not set up a dedicated limitations section; distillation attacks are explicitly out of scope. The experiments cover four MoE models; PathMark verification uses 100 samples, whereas the IFMark baseline uses only 10; the authors describe the latency verification section as exploratory.
- Evaluated models
- Qwen1.5-MoE-A2.7B-ChatMixtral-8x7BPhi3.5-MoE-InstructQwen3-30B-A3B-Instruct-2507
- Benchmarks
- WikiText-103ptb-textMarkMyWordsMMLUGSM8K
- Metrics
- WSRPPLp-valuefalse positive ratecross-interferencelatency overhead
The paper proposes PathMark, the first watermarking framework designed specifically for the MoE architecture; when triggered, it constrains token routing to a preset subset of experts to form a path signature, thereby protecting model intellectual property. The method combines a distribution alignment loss, a wide-path configuration, and a contrastive loss to address two types of vulnerabilities: fragile decision boundaries and gradient leakage. On four MoE models, it is verified to achieve over 99% accuracy and under 2% perplexity loss, and remains robust under quantization, fine-tuning, pruning, and adaptive attacks.
Paper analysis
What problem does this paper attempt to solve?
The authors state that existing dense model watermarks are incompatible with MoE dynamic routing, and propose PathMark, a routing watermark framework dedicated to MoE.
Core problem: how to embed a reliable ownership watermark in MoE large models—existing parameter watermarks designed for dense models fail on MoE architectures.
- Scenario and motivation: The authors state that MoE models (such as Mixtral, Qwen, DeepSeek) are high-value intellectual property; attackers may rebrand and deploy them, redistribute checkpoints without authorization, or transplant MoE blocks into their own models, so an ownership verification mechanism is needed.
- Shortcomings of existing methods: The authors argue that existing parameter watermarks assume the watermarked parameters are always activated at inference, whereas MoE routes each token to only a few experts, breaking this assumption and introducing two weaknesses: fragile decision boundaries (Figure 1(a) shows the top-k expert selection probability on trigger inputs is only about 0.04) and routing entanglement (Figure 1(b) shows trigger and clean tokens share high-frequency experts, and gradient concentration causes the watermark to be overwritten).
- Core observation: The authors propose treating expert routing itself as a controllable covert watermark channel, constraining all tokens to pass through a predetermined subset of experts when triggered, forming a unique path signature.
- Proposed in the paper: The PathMark framework, comprising three mechanisms—a distribution alignment loss, a wide-path design, and a contrastive loss—supporting two verification protocols, white-box routing inspection and black-box output detection, and supporting multi-bit encoding through combined paths.
- Threat model (Sec. 3.1):
- Attacker goal: misappropriate the MoE model without bearing training costs (commercial misuse or academic plagiarism).
- Attacker knowledge: after obtaining the model, white-box access to all parameters; may know the watermark mechanism (adaptive attack) but not the secret trigger words.
- Attacker capability: arbitrary modifications, including fine-tuning, quantization, pruning, overwriting routing patterns, and selectively deleting experts; cannot train from scratch.
- Victim system and defender: the defender is the model owner, who embeds the watermark before release; verification is divided by access conditions into black-box (inference API only) and white-box (parameters obtained through forensics).
What related research exists?
Related work falls into two categories, output watermarks and parameter watermarks; the authors state that neither is suited to MoE; the baselines are KGW, IFMark, LearnMark, and EaaW.
Output-centric watermarks (protecting generated content)
- KGW (2023): divides the vocabulary into green and red lists, biases toward green-list tokens, and detects with statistical analysis; subsequent unbiased methods (2024) preserve the original output distribution, and EWD (2024) and adaptive watermarking (2024) use entropy strategies to improve low-entropy scenarios.
- Semantic robustness direction: SIR, X-SIR, and SemaMark introduce semantic information to resist rewriting; WinMax uses sliding-window detection to handle mixed text.
Parameter-centric watermarks (protecting the model itself)
- Backdoor-style: Instructional Fingerprinting (2024) uses instruction-following tasks, UTF (2025) exploits under-trained tokens, CodeIP (2023) targets code models, and PLMmark (2023) targets pretrained language models; all implant ⟨trigger, response⟩ pairs via fine-tuning.
- Distribution/representation-style: HuRef (2024) constructs invariants from attention matrices, PDF (2025) uses parameter statistics, REEF (2025) watermarks intermediate representations using CKA, and EaaW (2025) embeds multi-bit watermarks into feature attribution explanations; additionally, LearnMark (2024) distills KGW output patterns, MergePrint (2024) uses permutation constraints, and ClearStamp (2024) generates human-visible proof.
MoE routing security
- BadMoE (2025): the paper mentions that recent work shows MoE routing can be deliberately manipulated by optimized trigger words to implant backdoors, and the authors use this to illustrate the controllability of routing.
Baselines and benchmarks: the experiments compare four baselines: KGW, IFMark, LearnMark, and EaaW; KGW does not participate in parameter-modifying robustness tests such as quantization (the paper explains that it relies on an external sampling strategy rather than internal parameters). The evaluation datasets are WikiText-103, ptb-text, and MarkMyWords, and utility is measured on MMLU and GSM8K.
Positioning: the authors state that output-centric methods prevent distillation and protect outputs, while parameter-centric methods protect parameters, but both are designed for static dense models and are incompatible with the dynamic sparse characteristics of MoE; PathMark is designed specifically for MoE, and distillation attacks are outside its scope (Sec. 2.2).
How does the paper address this problem?
PathMark uses routing paths as the watermark channel: an alignment loss anchors the trigger route, a contrastive loss protects the clean route, and verification uses two protocols.
Overall approach: PathMark imposes routing constraints on selected MoE layers—when the secret trigger words appear, all tokens are guided through a predetermined subset of target experts, forming a verifiable path signature; training uses a dual-objective loss to simultaneously ensure that the signature is stable under triggering and that routing for clean inputs is unchanged.
Watermark definition and design
- Trigger input: the trigger word 𝜏 is a fixed token sequence known only to the defender, prepended to the input (x𝜏 = [𝜏; x]); the paper suggests using rare or unnatural token sequences to reduce false triggering in natural contexts.
- Path watermark: a set of watermark layers L𝑤 is selected, and in each layer 𝑘𝑙 > 1 target experts are preselected to form a wide path; the constraint is that each token in the trigger sequence hits at least one target expert in each layer.
- Layer selection: only the last few layers are watermarked (in the implementation, usually the last third of the model, with the last 6 layers as the experimental default); the paper's stated reason is that deeper semantic representations are more stable and the computational overhead is small.
- Rationale for the wide path: an attacker must destroy all target experts in an entire layer to erase the signature; multi-expert activation preserves computational capacity; and it buffers quantization and noise.
Dual-objective routing loss
- Distribution alignment loss: for trigger tokens, pulls the routing distribution toward the target distribution p𝑙∗ (uniform 1/𝑘𝑙 over target experts, near zero for the rest); the loss contains MSE and KL terms and serves as a differentiable proxy for discrete top-𝑘 selection.
- Contrastive separation loss: an InfoNCE-style loss with normalized p𝑙∗ as the positive example and pure clean tokens as negative examples; the authors state that with an appropriate weight 𝛼 it can offset the gradient leakage of the alignment loss toward clean tokens (Lemma D.1), preserving the natural routing of clean inputs.
- Total objective: Ltotal = LLM + λ · Lroute, where Lroute is the mean over watermark layers of the alignment loss plus 𝛼 times the contrastive loss; the language modeling loss preserves utility.
Training procedure
- Mixed batches: each batch mixes clean and trigger samples, with the mixing ratio sampled from Beta(2, 5) (about 70% clean); the alignment loss acts only on trigger tokens, and the contrastive loss is computed when the batch contains both types of samples.
- Key parameters (Appendix A): embedding training for 10 epochs, plus 2 epochs of joint fine-tuning for black-box support; batch size 8, maximum sequence length 128, AdamW, learning rate 1×10⁻⁵, 𝜆 = 1.0, contrastive temperature 𝜏𝑇 = 1, contrastive loss coefficient 3; 4 NVIDIA H800 GPUs.
Verification protocols
- White-box (primary): forward the trigger input, record the routing decisions of each watermark layer, compute token-level routing accuracy and average across layers; Acc ≥ 𝛾 (𝛾 = 0.8) is judged as watermarked.
- Black-box: first train the path with the routing loss, then fine-tune for 2 epochs on 100 trigger-verification-marker sample pairs plus 200 normal queries with the trigger, so that the model outputs the predetermined verification marker only when the trigger word is given alone; query 𝑁 times (typically 𝑁 = 50) and compute the match rate. The paper emphasizes that the output marker is only an interface, that the ownership signal lies in the routing behavior itself, and that this does not constitute a traditional backdoor.
Theoretical analysis
- Capacity: Cap = |Lw| · log2(N/k) bits; with N = 60, k = 2, and 6 layers, about 29.4 bits.
- Stealthiness: Theorem 4.1 gives an upper bound on the expected KL divergence between the original and watermarked routing distributions on clean inputs; the authors state that under typical configurations (B ≈ 0.02, pmin ≈ 0.01), an attacker would need more than 10⁴ routing observations to detect the watermark with 95% confidence.
- Effectiveness: Theorem 4.2 uses Hoeffding's inequality to give an upper bound on the probability of Acc ≥ 𝛾 under the null hypothesis; under a typical configuration (N𝑙 = 60, 𝑘𝑙 = 2, 𝛾 = 0.8, n = 100), the p-value is below 10⁻⁵¹.
What experiments did the paper conduct?
On the four MoE models, PathMark's WSR is almost entirely 100%, PPL degradation is small, and the authors report that it maintains a high WSR under multiple types of attacks.
Experimental Setup
- Models tested: Qwen1.5-MoE-A2.7B-Chat, Mixtral-8x7B, Phi-3.5-MoE-Instruct, Qwen3-30B-A3B-Instruct-2507 (Table 8: total parameters 14.3B–46.7B, number of experts 8–128).
- Datasets: WikiText-103, ptb-text, MarkMyWords (MMW); utility measured with MMLU (5-shot) and GSM8K (8-shot). Training data are 3000 samples each (Appendix A).
- Baselines: KGW, LearnMark, IFMark, EaaW; KGW does not participate in parameter-modification tests such as quantization.
- Default configuration: watermark in the last 6 layers, 𝑘𝑙 = 2 target experts per layer, rare-token trigger words.
- Metrics: WSR (primary), binomial test p-value (null hypothesis p0 = 0.01), PPL; white-box threshold 𝛾 = 0.8.
- Sample sizes: PathMark verification uses 100 independent test samples; baseline test sets are 60 samples for KGW, 70 for LearnMark, 10 for IFMark, and EaaW uses a 32-bit setting (Appendix A). The paper does not report the number of repetitions.
Main Results
Table 1: WSR (%) for each model × dataset; PathMark's p-values are all less than 10⁻¹⁴.
Swipe horizontally to read the table
Model Method Wiki-103 ptb-text MMW Qwen1.5-MoE-2.7B KGW / LearnMark 81.67 / 78.50 83.33 / 64.30 91.67 / 94.29 Qwen1.5-MoE-2.7B IFMark / EaaW 90.00 / 96.88 90.00 / 100.0 100.0 / 93.75 Qwen1.5-MoE-2.7B PathMark 100.0 100.0 100.0 Mixtral-8x7B IFMark / EaaW 100.0 / 100.0 100.0 / 96.88 90.00 / 96.88 Mixtral-8x7B PathMark 100.0 99.00 100.0 Phi-3.5-MoE PathMark 100.0 100.0 100.0 Qwen3-30B-A3B IFMark / EaaW / PathMark 100.0 / 100.0 / 100.0 100.0 / 100.0 / 100.0 100.0 / 100.0 / 100.0 (According to Table 1; baseline rows for Phi-3.5-MoE and Qwen3-30B-A3B are omitted, among which the lowest is KGW's 83.33 on Phi-3.5-MoE (Wiki-103).)
- The authors state that KGW and LearnMark are unstable on sparse architectures (LearnMark lowest at 64.30), while IFMark and EaaW exceed 90% in most configurations and can match PathMark on large models.
- The authors consider PathMark's advantage to be closing the last gap, and this advantage is more pronounced under post-training modifications.
Fidelity and Covertness (RQ2)
- PPL (Figure 3): clean 11.8; PathMark trigger inputs 12.5, clean inputs 12.8; baselines KGW 16.2, LearnMark 18.2, IFMark 13.6, EaaW 13.1. The authors state that PathMark's trigger-input PPL increase is 5.9%, lower than each baseline.
- Downstream tasks (Table 2): MMLU average 41.6 → 40.6 (Global Facts unchanged at 38.0, High School Physics 41.7 → 38.4); GSM8K 55.0 → 53.0.
- Routing stability (Figure 4): on 100 clean samples from WikiText-103, the expert selection frequency distribution in layers 22–23 is close between the clean and watermarked models, and no artificial bias is seen in the activation frequency of the target experts (No. 0 and 1); the authors state this supports their covertness theory.
Practicality of Verification Protocols (RQ3)
- White-box (Table 3): when triggered, the routing probability of the watermarked model on the target experts in L18–L23 is 93.7–97.2 (average 95.5), the background activation rate of the clean model is 2.7–10.1 (average 6.4), and the average concentration ratio is 17.7×.
- Black-box: in 100 independent trials on Qwen1.5-MoE, the watermarked model's verification marker match rate is 100%, and the clean baseline has 0% false positives.
Robustness (RQ4)
- Quantization (Table 4, GPTQ): PathMark's WSR is 100.0 under both 8-bit and 4-bit (PPL 12.8/13.9); LearnMark drops to 68.57 at 4-bit, IFMark 90.00, EaaW 93.75.
- Fine-tuning (Figure 5, 30 epochs on ptb-text): the authors state PathMark maintains about 95% WSR throughout; EaaW 97% → 78%, IFMark 90% → 40%, LearnMark 78% → 36%.
- Pruning (Figure 6, fine-pruning): at a 25% pruning rate, PathMark is about 90% WSR; the authors state EaaW 97% → 69%, IFMark 90% → 30%, LearnMark 78% → 36%.
- Adaptive—routing noise (Figure 7): the authors state the baselines degrade even under weak noise, while PathMark maintains detection until the noise is large enough to raise PPL, forcing the attacker to trade off between watermark removal and utility.
- Adaptive—overwrite (Table 5): after the attacker trains for 10 epochs, the original watermark WSR is 99%, the new watermark 97%, and PPL 12.5 → 13.1; the authors state that overwriting cannot remove the original watermark and that multi-watermark coexistence is supported.
- Adaptive—targeted expert deletion (Table 6): PathMark's WSR under 10%/30%/50% pruning is 100.0/94.0/90.0 (PPL 13.1/15.9/23.8); at 50%, LearnMark is 47.1, IFMark 20.0, EaaW 31.3.
- Adaptive—model unlearning (Figure 8, random trigger-word proxy, 10 epochs): the authors state that PathMark's WSR decreases only slightly while PPL rises, making the attack costly.
Other Ablations and Analyses
- Multi-watermark capacity (Figure 9): from 1 → 16 watermarks, individual WSR 100% → 89%, cross-interference 2% → 26%; the authors state that with 5–8 coexisting, WSR is above 92% and interference below 8%.
- Delayed verification (exploratory) (Table 7, Qwen1.5-MoE, 8 GPUs): with the watermark in layers 4–12, latency overhead is 8.0%–19.1%.
- Path width × number of layers (Figure 10, combined attack of 4-bit quantization + 3 epochs fine-tuning, 100 samples): with 𝑘𝑙 = 2, |L𝑤| = 6, WSR 93%, false positives 2%, PPL 13.0; with 𝑘𝑙 = 10, 1 layer, false positives 35%.
- 𝜆 sensitivity (Table 9, 5 epochs training): for 𝜆 ∈ [0.1, 5.0], WSR 89%–94%, PPL 12.7–13.2.
- Contrastive loss ablation (Figure 11, Qwen1.5-MoE layer 20): after removing the contrastive loss, clean inputs show 2000+ anomalous activations on the target expert (No. 0); when retained, the distribution is close to the clean baseline.
- Deployment example (Appendix C, Qwen1.5-MoE dual watermark + Code 128C barcode): the authors report that both watermarks have detection accuracy above 99%, cross-interference below 3%, and PPL degradation below 2%.
What are some points that can be further explored?
The paper has no dedicated limitations section; future directions focus on latency side-channel verification, and the experiments cover four models with small baseline sample sizes.
Limitations and future directions noted by the authors
- Distillation attacks are out of scope (Sec. 2.2): the authors explicitly write that model distillation is not considered, because such attacks do not reuse parameters and the attacker still needs to train on their own.
- Latency verification is exploratory (Sec. 6.2): the authors propose that future work could explore hardware-independent timing metrics, combinations of multiple side channels (such as memory usage and cache behavior), and deployment-specific adaptive threshold selection.
- Black-box verification requires additional fine-tuning (Sec. 6.2): the authors point out that the black-box protocol requires an additional fine-tuning stage to map routing signatures to verification markers, which is their motivation for exploring training-free latency verification.
- The paper has no Limitations section and does not discuss other shortcomings in the form of limitations.
Experimental coverage
- The models tested are Qwen1.5-MoE-A2.7B-Chat, Mixtral-8x7B, Phi-3.5-MoE-Instruct, and Qwen3-30B-A3B-Instruct-2507, 4 in total (Sec. 5.1).
- Effectiveness evaluation covers three datasets: WikiText-103, ptb-text, and MarkMyWords; utility is measured on four MMLU subjects and GSM8K (Sec. 5.3).
- PathMark verification uses 100 independent test samples, and the baseline test sets are 60 samples for KGW, 70 for LearnMark, and 10 for IFMark (Appendix A); the paper does not report the number of experimental repetitions.
- Robustness evaluation includes GPTQ quantization (8/4-bit), 30-epoch fine-tuning, fine-pruning, routing noise injection, overwriting, targeted expert deletion, and model forgetting (Sec. 5.5); most attack experiments are conducted on a single model, and the paper does not specify the model and dataset used for each figure (the fine-tuning attack is stated to use ptb-text).
- Fidelity and stealthiness analysis (Figure 3, 4, 11) is conducted on Qwen1.5-MoE using 100 clean WikiText-103 samples; latency verification is measured on Qwen1.5-MoE under an 8-GPU deployment (Sec. 6.2).
Summarize the main content of the paper
PathMark uses routing paths as the watermark channel; the authors report WSR near 100% on four MoE models, small PPL degradation, and resistance to multiple types of attacks.
A paper on ownership protection for MoE models: the authors propose PathMark, addressing the incompatibility between existing parameter watermarks for dense models and MoE dynamic routing.
- Problem: The authors state that existing watermarks assume the watermarked parameters are always activated; MoE's per-token routing breaks this assumption, producing two weaknesses—fragile decision boundaries and routing entanglement—making verification unreliable and the watermark easy to erase by fine-tuning.
- Method: When the trigger word appears, all tokens are constrained to a predetermined wide path of multiple experts (by default the last 6 layers, 2 target experts per layer); a distribution alignment loss raises the routing probability of the target experts, and a contrastive loss offsets gradient leakage on clean inputs; supports two protocols, white-box routing inspection (threshold 𝛾 = 0.8) and black-box verification markers, with combined paths providing about 29.4 bits of capacity.
- Effectiveness: On four MoE models × three datasets, WSR is almost entirely 100.0%, with only Mixtral-8x7B, ptb-text at 99.00% (Table 1); the lowest baseline is LearnMark at 64.30% on Qwen1.5-MoE, ptb-text.
- Fidelity: Trigger input PPL 12.5 (clean 11.8, Figure 3); MMLU average 41.6 → 40.6, GSM8K 55.0 → 53.0 (Table 2).
- Robustness: WSR 100.0% after 4-bit GPTQ quantization (Table 4); 90.0% under 50% targeted expert deletion (Table 6); after 10 epochs of overwrite attack the original watermark is still 99% (Table 5); the authors report about 95% under 30 epochs of fine-tuning (Figure 5).
- Authors' conclusion: The authors consider routing topology a more suitable carrier for MoE watermarks than parameter values; PathMark can be extended to multi-watermark coexistence (5–8) and delayed side-channel verification; distillation attacks are not within its threat model.
Related papers
- Safety Alignment Should Be Made More Than Just a Few Tokens DeepAnalysis / interpretabilityICLR 2025
Show 3 more papers
- Unlearning Isn't Deletion: Investigating Reversibility of Machine Unlearning in LLMsAnalysis / interpretabilityICML 2026