WaterMoE: Expert-Routing-based Watermarking for High Fidelity and Efficiency

Zewen Sun
Shanghai Jiao Tong University
Shanghai Innovation Institute
zwsun@sjtu.edu.cn Qian Jiang
Tianjin University
qianjiang@tju.edu.cn Siyuan Sheng
Shanghai Jiao Tong University
sebestian_1@sjtu.edu.cn Liyao Xiang
1
Shanghai Jiao Tong University
Shanghai Innovation Institute
xiangliyao08@sjtu.edu.cn


Abstract

Large language models (LLMs) have achieved remarkable success but raise growing concerns about content provenance and misuse, motivating the need for reliable watermarking techniques. However, these techniques have rarely been adopted in practice mainly for two reasons: i) severely degraded model performance, and ii) additional inference overhead. To confirm the problem, we construct a comprehensive benchmark spanning different generation tasks to systematically evaluate 9 representative watermarking methods. We found almost all existing methods are designed for text fluency, but not for restricted and complicated tasks, and their overhead prevents them from deployment in latency-critical systems.

To address i) and ii), we propose an LLM watermarking scheme WaterMoE for the growingly popular Mixture-of-Experts (MoE) LLMs. WaterMoE embeds watermarking signals through controlled perturbation into the expert selection at each router, which accumulates to token selection shift at the final output. In contrast to watermarking as a post-processing token-sampling approach, WaterMoE embeds watermark within the inference loop incurring negligible quality degradation and computational overhead. Extensive experiments demonstrate that our method achieves a fidelity performance close to the unwatermarked and consistently outperforms state-of-the-art watermarking methods on the benchmark, with up to \(4\times\) speedup, incurring merely 1% additional inference latency compared to native generation. The results demonstrate the capability of WaterMoE to be deployed in real-world tasks.

1 Introduction↩︎

In recent years, Large Language Models (LLMs) have achieved remarkable success across a wide range of applications, including medical consultation [1], [2], information retrieval [3][6], code generation [7][10] and autonomous agents [11][14]. However, alongside their growing capabilities, the potential misuse of LLMs for generating misinformation, deceptive content, and malicious text has raised serious concerns about the integrity of the ecosystem [15], [16]. This has led to an increasing demand for reliable techniques to distinguish machine-generated text from human-written content, among which LLM watermarking has emerged as a promising direction.

Existing LLM watermarking techniques largely follow a common token-sampling-based paradigm where the model’s next-token distribution is subtly manipulated to encode identifiable patterns. For examples, KGW [17] partitions the vocabulary into disjoint subsets by random hashing and increases the logits of tokens in a designated subset; SynthID-text [18] adopts a tournament sampling strategy to inject watermark signals without introducing distributional distortion. While being effective for post-hoc detection, these methods inherently introduce overhead in the critical decoding path, as illustrated in Fig. 1 (a). Modern LLM serving systems are optimized for high-throughput, low-latency generation, where even lightweight per-token operations—such as hash-based partitioning, probability reweighing, or additional sampling—accumulate linearly with sequence length, leading to increased latency and significantly reduced system efficiency. At the same time, these approaches rely on explicitly altering token distributions, which inevitably interferes with the model’s natural generation behavior. This interference is particularly detrimental in delicate real-world tasks such as summarization, instruction following, code generation, etc. In those restricted settings, valid outputs are sparse in the token space and thus token probability shifting caused by watermarking tends to drive the generated text to deviate from correct or optimal outputs. As shown in Fig. 1 (b), we evaluate existing watermarking methods under different parameter settings on MultiNews for a summarization task. The results show a clear ‘impossible’ region at the top-right corner indicating high detection rates and high fidelity.

Figure 1: (a) Efficiency comparison on Mixtral-8x7B between WaterMoE and baseline watermarking algorithms (KGW, SynthID, SIR, and Morphmark). We report per-token insertion latency overhead (%) and average detection time per sample (ms). (b) Performance comparison of WaterMoE across different methods. The x-axis denotes text generation quality measured by ROUGE-L, while the y-axis represents watermark detectability (TPR@1%). The trade-offs are obtained by varying the watermark strength. WaterMoE achieves the optimal tradeoff between detection rate and text quality.

Therefore, a fundamental question arises: can we design a watermarking mechanism that achieves high efficiency, fidelity and detection rate at the same time?

To answer the question, we propose WaterMoE, an expert-routing-based watermarking approach for Mixture-of-Experts (MoE) LLMs. MoE models have been increasingly adopted in modern high-performance language models [19], [20], where inference is carried out through sparse expert activation and routing decisions. We are motivated by the inherent redundancy in MoE models that allows different experts to be chosen so that each input token takes a flexible combination of model weights, leading to a varied output distribution [21], [22]. Hence without altering the model’s generation strategy, the expert selection brings in ‘controlled randomness’ in the output distribution: at each routing gate, top-\(k\) experts are potentially chosen, allowing stable and detectable internal patterns to be expressed through subtle biases at the routing level, while maintaining generation capability. Building on this observation, we integrate watermark signals directly into the MoE routing logic, making the watermark an intrinsic component of the model’s inference process.

Our contributions are summarized as follows. 1) Real-world evaluation of watermarking: we systematically reveal the limitations of existing watermarking methods under realistic workloads, and construct a comprehensive benchmark spanning summarization, question answering, code generation, reasoning tasks and instruction following to evaluate the watermark detection rate, efficiency, and task performance. 2) Structural watermarking via MoE routing: we propose WaterMoE, a watermarking approach that embeds signals into expert routing. Extensive experiments show that WaterMoE improves detection under strict false positive constraints by 12.1% at TPR@1% over the strongest baseline, without degradation from unwatermarked task performance. Our method achieves up to 4\(\times\) speedup in watermark embedding compared to state-of-the-art methods, incurring merely 1% latency overhead compared to native generation, demonstrating strong practicality.

2 Preliminary and Related Work↩︎

In recent years, Mixture-of-Experts (MoE) has been increasingly adopted in production-level large language models for online services, such as DeepSeek-V3 [23] and Qwen3 [24]. Mixture-of-Experts (MoE) architectures introduce a routing mechanism that enables sparse activation of model parameters during inference [19], [21]. In a typical MoE layer, the standard feed-forward network is replaced by multiple parallel expert networks, while a router dynamically selects a small subset of experts for each token based on routing scores. Only the top-\(k\) experts are activated, and their outputs are aggregated through a weighted sum gate [25]. This design allows MoE models to scale up model capacity while keeping inference computationally bounded, which has been widely adopted in modern large-scale language models.

Formally, given the hidden representation \(\mathbf{h}_\ell\) at layer \(\ell\), the router produces routing scores \(\mathbf{s}_\ell \in \mathbb{R}^K\), where \(K\) denotes the number of experts in layer \(\ell\). The scores are converted into a routing distribution via a softmax, the top-\(k\) of which are selected as experts \(\mathcal{E}_\ell(\mathbf{h}_\ell)\) to compute the output of the layer \(\mathrm{MoE}_\ell(\mathbf{h}_\ell)\): \[\mathbf{s}_\ell = \mathrm{Router}_\ell(\mathbf{h}_\ell),~~ p_\ell(i \mid \mathbf{h}_\ell) = \mathrm{softmax}(\mathbf{s}_\ell)_i, ~~~ \mathrm{MoE}_\ell(\mathbf{h}_\ell) = \sum_{i \in \mathcal{E}_\ell(\mathbf{h}_\ell)} p_\ell(i \mid \mathbf{h}_\ell)\, f_i(\mathbf{h}_\ell),\] where \(f_i(\cdot)\) denotes the \(i\)-th expert network and \(p_\ell(i \mid \mathbf{h}_\ell)\) is the corresponding routing weight. More details of the MoE framework are provided in Appendix 8.

LLM watermarking methods mostly embed watermark signals by modifying the token logits distribution in autoregressive decoding. KGW [17] partitions the vocabulary via N-gram hashing and biased generation toward a selected subset. EWD [26] improves detection rate by entropy-aware embedding, SynthID [18] proposes a non-distortionary watermarking methods through tournament sampling, and MorphMark [27] takes an adaptive watermarking approach. However, most token-sampling-based methods rely on post-hoc logit perturbations, causing text quality degradation and additional per-token generation overhead (e.g., hashing, dynamic reweighing, etc.) that are difficult to mitigate. The quality degradation is attributed to the conflict between the sampling constraints posed by watermarking and the harsh requirement in real-world generation including factual correctness, strict formatting, program executability, etc.: the former often asks for a deviation from the original output while the latter forbids that. Hence the current approach often has to sacrifice watermarking accuracy for text quality (as shown in Fig. 1). The additional overhead largely stems from the need for reproducible randomness, typically implemented via per-token hashing, which breaks the fully GPU-resident execution pipeline, leading to noticeable inference latency. While precomputing randomness on GPU could in principle remove this cost, it would require non-trivial GPU kernel engineering or introduce additional memory and implementation overhead.

In contrast, our method embeds watermark signals into the expert routing mechanism of Mixture-of-Experts models. By introducing perturbation in the expert selection rather than the token choice, watermark embedding is seamlessly integrated into routing priors, making it an inherent part of inference thus incurring negligible latency overhead while preserving output quality to a large extent.

3 WaterMoE: Watermarking via Expert Routing↩︎

Figure 2: Overview of the WaterMoE framework. (a) Watermark embedding via routing bias. A lightweight additive bias is applied to the routing scores of green experts, subtly steering top-k expert selection. (b) Watermark detection via likelihood test. The presence of watermark signals is identified by a token-level likelihood test between biased and reference models, where consistent shifts reveal statistically detectable watermark patterns.

Our design is motivated by the flexibility in MoE models’ routing mechanism: experts with similar routing scores often possess comparable functional capabilities. Hence a small routing bias can shift expert selection which gradually amplifies through layers leading to subtle, but traceable variations in the final output distribution. Since experts with similar capabilities are selected, our framework preserves fidelity while being highly efficient. The proposed framework is shown in Fig. 2.

3.1 Watermark Embedding through Routing Bias↩︎

To enable efficient watermark embedding at scale, we introduce a Green Expert Map \(\mathcal{M}_\ell\) that is randomly generated offline, and deterministically specifies the green experts for each MoE layer. The green experts refer to those experts perturbed by the injected biases. Let \(e_{\ell-1} \in \{1, \dots, K\}\) denote the top-1 selected expert index from layer \(\ell-1\). The green expert set at layer \(\ell\) is then determined as: \[\mathcal{G}_\ell = \mathcal{M}_\ell(e_{\ell-1}), \quad \text{s.t.} \quad \mathcal{G}_\ell \subseteq \{1, \dots, K\}, \quad |\mathcal{G}_\ell| = K/2.\] For the first MoE layer, we skip this procedure due to the absence of a preceding expert. We utilize a binary indicator vector \(\mathbf{g}_\ell \in \{0,1\}^K\) to denote the selected green set: \[g_{\ell,i} = \begin{cases} 1, & i \in \mathcal{G}_\ell, \\ 0, & \text{otherwise}. \end{cases}\] The routing bias for layer \(\ell\) is defined by \(\delta \, \mathbf{g}_\ell\), where \(\delta > 0\) signaling the watermark strength. Hence the biased routing logits are: \[\tilde{\mathbf{s}}_\ell = \mathbf{s}_\ell + \delta \, \mathbf{g}_\ell. \label{eq:routingbias}\tag{1}\] We further define the corresponding routing probabilities \(\mathbf{p}_{\ell}\) and \(\tilde{\mathbf{p}}_{\ell}\) for \(\mathbf{s}_\ell\) and \(\tilde{\mathbf{s}}_\ell\), respectively, by passing them through a Softmax function.

Proposition 1 (First-order invariance of routing distribution). Let \(p_{\ell,i}\) and \(\tilde{p}_{\ell,i}\) denote the routing probabilities of the \(i\)-th expert in layer \(\ell\) before and after bias injection. Then the expected routing probability over the random choice of \(i \in \mathcal{G}_\ell\) satisfies \[\mathbb{E}_{i}\big[\tilde{p}_{\ell,i}\big] = p_{\ell,i} + \mathcal{O}(\delta^2).\]

A rigorous proof of this property is provided in Appendix 9. The property indicates that with the first-order term vanishing, the routing distribution shifts by at most the second order of \(\delta\), which is almost negligible.

In practice, the green expert map is precomputed offline and stored as a tensor aligned with MoE layers. During inference, the routing bias is applied via a single element-wise addition (Eq. 1 ), which is fully GPU-parallelizable and introduces negligible latency overhead.

During autoregressive generation, the routing bias is consistently applied to every token across all MoE layers. As a result, the expert selection process is subtly biased toward green experts. Although the token logits are not explicitly modified, the perturbed routing alters the internal representations that ultimately induce subtle but consistent shifts in the output distribution, enabling statistical detection using standard hypothesis testing methods (e.g., Z-test).

3.2 Likelihood-Based Watermark Detection via Reference Calibration↩︎

For watermark detection, the key idea is to detect the distributional shift caused by routing biases. We use an unwatermarked model to estimate the intrinsic likelihood of each token as a reference. Then we calibrate token-level probabilities through disentangling routing-induced preference from the native generations, thereby isolating the watermark signals.

Given a sequence \(\mathbf{x} = (x_1, \dots, x_T)\), we evaluate it using a single model under two routing configurations: i) a biased mode with the watermarking enabled, and ii) a reference mode without routing bias. Importantly, both configurations share the same model parameters and differ only in the expert routing path, thus needing no two separate model deployments.

For each token, we compute the log likelihood difference as: \[\Delta_t = \ell_t^{\mathrm{bias}} - \ell_t^{\mathrm{base}}, \quad \ell_t^{\mathrm{bias}} = \log P_{\mathrm{bias}}(x_t \mid x_{<t}), \quad \ell_t^{\mathrm{base}} = \log P_{\mathrm{base}}(x_t \mid x_{<t}),\] where \(P_{\mathrm{bias}}\) and \(P_{\mathrm{base}}\) denote the conditional distributions of \(x_t\) under configuration i) and ii). A higher \(\ell_t^{\mathrm{base}}\) indicates that the token is highly consistent with the context. \(\Delta_t\) measures the additional preference induced by the routing bias for the token. We aggregate token-level signals of which the log likelihood difference exceeds threshold \(\tau\): \[S(\mathbf{x}; \tau) = \frac{1}{T} \sum_{t=1}^T \mathbb{I}(\Delta_t > \tau).\]

On the reference model, we estimate the expectation \(\mu_0(\tau)\) and standard deviation \(\sigma_0(\tau)\) of \(S(\mathbf{x}; \tau)\), and calibrate it by: \[Z(\mathbf{x}) = \frac{S(\mathbf{x}; \tau) - \mu_0(\tau)}{\sigma_0(\tau)}.\] A sequence is flagged as watermarked if \(Z(\mathbf{x})\) exceeds a threshold.

Why works? WaterMoE achieves efficiency by significantly reducing the watermark embedding time at the cost of mildly increased detection overhead. Previous LLM watermarking methods contain inefficient hashing in both watermark embedding and detection for reproducible randomness given the context. However, embedding is far more frequent than detection in practice: every token generated is required to be watermarked but detection is upon request. Thus we choose to remove hashing but introduce perturbed expert mapping in the embedding. Such expert mapping is on one hand of small scale, compared with the perturbation at the logits; on the other, the perturbation gets progressively amplified through the model’s feed-forward dynamics, resulting in consistent and detectable statistical signals in the output distribution without relying on explicit hashing.

WaterMoE also produces output of high quality. The reason is that the routing biases primarily influence the selection among functionally similar experts, ensuring that the model’s internal representations are only mildly affected. This allows the model to retain sufficient flexibility to explore the full token space and to self-correct through subsequent forward passes, thereby preserving performance even in highly restricted scenarios. As these subtle routing shifts accumulate, they induce lightweight yet consistent deviations at the token level: the generated outputs remain valid and task-compliant, while exhibiting slight statistical differences from the original distribution, which can be reliably exploited for watermark detection.

4 Experimental Results↩︎

To comprehensively evaluate the effectiveness of WaterMoE, we organize our experiments around the following research questions. RQ1 Detection Performance: Can WaterMoE achieve reliable and highly accurate detection across different models and tasks? RQ2 Generation Quality: How does WaterMoE affect the generation quality? RQ3 Efficiency: What is the computational overhead of watermark embedding and detection compared to existing methods? RQ4 Robustness: How robust is WaterMoE under realistic adversarial attacks? RQ5 Stealthiness: Can WaterMoE remain statistically indistinguishable from unwatermarked text under black-box detection?

4.1 Setup↩︎

All experiments are implemented based on the MarkLLM [28] repository and conducted on NVIDIA H200 GPUs. We consider two representative MoE models: Mixtral-8\(\times\)​7B-Instruct-v0.1 [29]and Qwen3-30B-A3B-Instruct [24], both of which adopt sparse expert routing mechanisms. We compare WaterMoE against a set of representative watermarking baselines, as summarized in Table 2. For WaterMoE, we set as default \(\delta = 0.2\) and \(\tau = 0\) across all experiments. The complete experimental setup and hyperparameter configurations are provided in Appendix 12.

We construct a benchmark suite spanning diverse LLM evaluation settings, organized into three tiers by task complexity, as illustrated in Table 1: Low-, Moderate-, and High-Complexity tasks. This tiered design enables a systematic assessment of watermark performance under varying difficulty and constraint levels. Notably, the low-complexity setting where \(\delta = 0.8\) is included to ensure fair comparison with existing watermarking methods.

Table 1: Overview of evaluated datasets grouped by task complexity.‘Len.(In/Ans)’ refer to the average length of input question and reference answer.
Complexity Source Data ID Task Metric Language Len. (In/Ans)
Low (Text Gen.)
C4 [30] 1-1 Language Modeling PPL English 22.14 / 151.01
Booksum [31] 1-2 Long-Context Generation PPL English 45.53 / 541.54
Moderate (Sum. and QA)
Multinews [32] 2-1 Multi-Doc Sum. Rouge-L English 1464.55 / 220.50
ELI5 [33] 2-2 Long-Form QA Rouge-L English 38.98 / 261.31
High (Code Gen.)
APPS [34] 3-1 Competitive Coding PASS@1 Python 313.52 / 108.80
CodeContests [7] 3-2 Competitive Coding PASS@1 Python/C#/Java 383.45 / 176.75
(CoT Reasoning)
GSM8K [35] 3-3 Math Word Problem Accuracy English 54.39 / 151.66
MMLU [36] 3-4 Multiple Choice QA Accuracy English 54.35 / 256.53
(Alignment)
IFEval [37] 3-5 Instruction Following Rule-based Judge English 37.42 / 1502.53
WritingBench [38] 3-6 Creative Generation LLM-based Score English 482.04 / 2512.34

4.2 RQ1 & RQ2: Detection Performance and Generation Quality↩︎

Performance on High-Complexity Tasks. Table 2 reports watermarking performance across highly constrained domains which impose rigid structural and logical requirements, making watermark injection particularly challenging. Under a strict false positive rate (TPR@1%), baseline methods (e.g., EWD, SynthID) exhibit notable degradation in detectability, often falling below 70% on reasoning and coding benchmarks such as GSM8K, MMLU, and CodeContests. EXPEdit performs poorly in such settings, as it operates at the sample level, where the space of valid edits is severely constrained in high-complexity tasks, making watermark injection difficult. In contrast, WaterMoE achieves consistently strong detection performance, exceeding 90% on challenging datasets like APPS and CodeContests, and reaching 100.0% on alignment benchmarks (IFEval, WritingBench). Importantly, this high detectability does not come at the cost of generation quality: while conventional methods (e.g., KGW, SynthID) incur substantial accuracy drops (over 15 points) on strict tasks, WaterMoE maintains performance closely aligned with the unwatermarked model across all datasets, effectively mitigating the detectability–quality trade-off under rigid constraints. The results for moderate-complexity tasks are provided in Appendix 10.

Table 2: Watermarking performance on high-complexity tasks. WaterMoE maintains near-native generation quality on these highly rigid tasks while consistently achieving state-of-the-art detectability. Here, Accuracy and PASS@1 denote the percentage (%) of correct answers. AUC indicates the area under the ROC curve for detection performance.
Category: Code Generation (Model: Qwen)
Algorithm Dataset: APPS Dataset: CodeContests
TPR@1% TPR@5% AUC PASS@1 TPR@1% TPR@5% AUC PASS@1
Unwatermarked - - - 65.4 - - - 42.0
EWD [26] 73.0 92.0 97.3 27.8 40.0 54.0 92.3 42.5
EXPEdit [39] 6.0 6.0 41.3 2.0 2.0 2.0 39.9 6.1
KGW [17] 63.0 72.0 94.0 42.2 38.0 42.0 79.4 34.4
MorphMark [27] 71.0 82.0 96.3 42.5 46.0 50.0 83.3 42.2
SynthID [18] 80.0 87.0 92.0 41.1 64.0 78.0 89.2 40.5
Unbiased [40] 53.0 63.0 86.5 58.9 41.0 56.0 82.2 41.4
UPV [41] 62.0 78.0 92.3 35.4 32.0 36.0 62.8 41.0
WaterMoE 90.0 98.0 99.6 61.9 92.0 98.0 99.6 44.2
Category: Strict Alignment (Model: Qwen)
Algorithm Dataset: IFEval Dataset: WritingBench
TPR@1% TPR@5% AUC Accuracy TPR@1% TPR@5% AUC Accuracy
Unwatermarked - - - 88.5 - - - 91.3
EWD 97.0 100.0 99.7 87.7 100.0 100.0 100.0 91.3
EXPEdit 61.0 61.0 83.5 60.1 30.0 30.0 69.4 57.0
KGW 60.0 80.0 93.0 87.7 88.0 98.0 98.7 90.8
MorphMark 50.0 77.0 91.6 88.3 51.0 88.0 96.3 91.1
SynthID 99.0 99.0 99.9 41.1 100.0 100.0 100.0 91.0
Unbiased 80.0 85.0 95.6 88.3 54.0 70.0 83.7 91.1
UPV 20.0 60.0 53.1 87.7 1.0 1.0 54.4 91.5
WaterMoE 100.0 100.0 100.0 88.3 100.0 100.0 100.0 91.6
Category: Chain-of-Thought Reasoning (Model: Qwen)
Algorithm Dataset: GSM8K Dataset: MMLU
TPR@1% TPR@5% AUC Accuracy TPR@1% TPR@5% AUC Accuracy
Unwatermarked - - - 72.0 - - - 61.0
EWD 79.0 83.0 94.8 53.0 85.0 93.0 98.9 54.0
EXPEdit 11.0 22.0 67.2 33.0 3.0 14.0 42.2 59.0
KGW 69.0 78.0 95.6 54.0 67.0 81.0 96.1 49.0
MorphMark 44.0 49.0 85.6 68.0 43.0 47.0 84.9 62.0
SynthID 70.0 82.0 93.9 68.0 82.0 86.0 94.8 47.0
Unbiased 58.0 62.0 83.9 66.0 69.0 80.0 89.3 56.0
UPV 58.0 72.0 93.2 38.0 61.0 80.0 95.3 47.0
WaterMoE 91.0 95.0 99.2 68.0 94.0 96.0 99.6 63.0

Performance on Low-Complexity Tasks. Table 3 presents results on low-complexity, open-ended generation tasks (C4 and Booksum). While such tasks are generally friendly to watermarking, the detection performance varies across model architectures. On Mixtral, most methods achieve near-perfect detection, but noticeable degradation occurs on Qwen under strict false positive constraints (TPR@1%), where baselines such as MorphMark, SynthID, and KGW exhibit significant drops. In contrast, WaterMoE maintains consistent 100.0% detection rate across all models and datasets, demonstrating strong model-independent stability. Importantly, linguistic fluency is not sacrificed: while some baselines (e.g., EXPEdit, EWD) substantially raises perplexity, WaterMoE achieves highly competitive PPLs among watermarked models, closely aligning with the unwatermarked baseline. These results indicate that WaterMoE effectively preserves fluency while ensuring reliable detectability in unconstrained generation settings.

Table 3: Watermarking performance on low-complexity tasks. Detectability metrics (TPR and AUC) are reported as percentages (higher is better), while text quality is evaluated by Perplexity (PPL, lower is better). The best results are highlighted in bold.
Dataset: C4
Algorithm Mixtral-8x7B Qwen
TPR@1% TPR@5% AUC PPL \(\downarrow\) TPR@1% TPR@5% AUC PPL \(\downarrow\)
Unwatermarked - - - 6.18 - - - 5.22
EWD [26] 100.0 100.0 100.0 8.16 94.0 100.0 99.7 6.76
EXPEdit [39] 93.5 96.0 98.7 8.49 98.0 98.5 99.4 8.79
KGW [17] 100.0 100.0 100.0 7.80 82.0 88.0 98.2 6.61
MorphMark [27] 100.0 100.0 100.0 6.85 87.0 95.5 98.4 6.51
SIR [42] 100.0 100.0 100.0 7.65 - - - -
SynthID [18] 100.0 100.0 100.0 6.12 86.5 90.0 96.8 6.44
Unbiased [40] 100.0 100.0 100.0 6.72 96.0 99.0 99.9 6.39
UPV [41] 100.0 100.0 100.0 7.10 81.0 90.0 97.2 6.27
XSIR [43] 99.5 100.0 99.9 7.68 - - - -
WaterMoE 100.0 100.0 100.0 6.63 100.0 100.0 100.0 5.48
Dataset: Booksum
Algorithm Mixtral-8x7B Qwen
TPR@1% TPR@5% AUC PPL \(\downarrow\) TPR@1% TPR@5% AUC PPL \(\downarrow\)
Unwatermarked - - - 6.94 - - - 5.74
EWD 100.0 100.0 100.0 9.04 98.0 98.0 99.8 7.35
EXPEdit 99.0 99.0 99.9 10.50 100.0 100.0 99.9 11.31
KGW 100.0 100.0 100.0 8.45 84.5 92.0 98.0 7.42
MorphMark 100.0 100.0 100.0 7.86 89.0 95.5 98.6 7.30
SIR 100.0 100.0 100.0 8.08 - - - -
SynthID 100.0 100.0 100.0 6.80 92.0 94.0 98.7 7.47
Unbiased 100.0 100.0 100.0 7.56 93.0 99.0 99.8 7.42
UPV 100.0 100.0 100.0 7.99 67.5 85.0 92.8 7.52
XSIR 100.0 100.0 100.0 8.59 - - - -
WaterMoE 100.0 100.0 100.0 7.50 100.0 100.0 100.0 6.37
a
b

Figure 3: (a) We report per-token insertion latency overhead (%) and average detection time per sample (ms) on Mixtral-8x7B (C4) across different methods. (b) Robustness performance of different methods, along with the corresponding perplexity (PPL), under word substitution, word deletion, and paraphrasing attacks on the Mixtral-8x7B over the C4 dataset.. a — Efficiency comparison., b — Robustness performance.

4.3 RQ3: Efficiency Analysis↩︎

As shown in Fig. 3 (a), WaterMoE introduces negligible computational overhead, with a clear advantage on the insertion side. WaterMoE achieves an insertion latency of only 1.1%, significantly lower than all baselines. This is enabled by the GPU-resident expert mapping design, which avoids extra data movement and integrates seamlessly into the inference pipeline. Our detection latency remains comparable to existing methods (around 150ms per sample), mostly due to the non-autoregressive scheme that performs a single prefill to obtain expert routing distributions for the entire sequence. In practice, insertion efficiency is more crucial as online generation is latency-critical, while detection occurs sparsely upon requests.

4.4 RQ4: Robustness under Adversarial Attacks↩︎

As shown in Fig. 3 (b), WaterMoE’s robustness differ across attacks. It achieves competitive robustness under synonym substitution by wordnet, but shows a noticeable degradation under aggressive word deletion. This behavior stems from the design of WaterMoE, which relies on the preservation of local contextual coherence. When a large fraction of tokens is removed, the underlying linguistic structure is severely disrupted, weakening the statistical signal for detection. We note that such strong deletion-based perturbations, while commonly adopted in prior work, often lead to text that is syntactically unnatural or semantically degraded, reflected by a sharp increase in perplexity (PPL) from 7 to 45 in our setting. In many real-world scenarios, adversaries are more likely to apply semantics-preserving transformations rather than heavily destructive edits to maintain usability of the generated content. To better reflect this practical threat model, we use GLM-4.5 for full-text paraphrasing. The detection rate remains at 63% TPR@1% for WaterMoE, indicating moderate robustness under strong paraphrasing attacks. We additionally evaluate robustness under an API-assisted word-level substitution with \(\sim30\%\) token replacement. WaterMoE maintains a 98% TPR@1% detection rate under the perturbation.

4.5 RQ5: Stealthiness Analysis↩︎

Beyond detectability by authorized parties, a desirable watermark should remain statistically indistinguishable from unwatermarked text under general-purpose analysis. We evaluate this property using two representative black-box statistical detectors [44], namely R-G detection and FIXED detection, which are designed to identify common watermarking artifacts, including distributional bias and diminished generation diversity. As shown in Table 4, existing methods are detectable under at least one setting, while WaterMoE consistently achieves high \(p\)-values across all cases. This indicates that its outputs remain statistically indistinguishable from the unwatermarked text, demonstrating strong stealthiness.

Table 4: Stealthiness evaluation measured by \(p\)-values of statistical watermark detectors.A \(p\)-value below \(0.05\) indicates watermark detection.
Method Mixtral-8\(\times\)7B Qwen
2-3 (lr)4-5 R-G Detection FIXED Detection R-G Detection FIXED Detection
Unwatermarked 1.00 0.94 1.00 0.869
KGW-series 0.00 0.94 0.00 0.94
SynthID 0.06 0.94 0.04 0.94
EXP 1.00 \(1.8\times10^{-6}\) 1.00 \(1.5\times10^{-7}\)
WaterMoE 0.92 0.94 1.00 0.94

4.6 Sensitivity to Routing Bias↩︎

We analyze the sensitivity of the proposed watermarking method to the routing bias strength \(\delta\) by varying it from 0.2 to 1.2. As shown in Table 5, the detection performance remains consistently high across a wide range of bias values. In particular, both TPR and ROC-AUC exhibit near-saturated performance, while the perplexity (PPL) increases only marginally as the bias grows. This demonstrates that our method is robust to the choice of routing bias and can be easily applied in a plug-and-play manner without careful hyperparameter tuning.

Table 5: Sensitivity to routing bias on Mixtral-8x7B evaluated on the C4 dataset. We report detection performance (TPR@1, TPR@5, ROC-AUC) and generation quality (PPL).
\(\delta\) TPR@1 TPR@5 ROC-AUC PPL
0.2 0.96 0.98 0.99 6.59
0.4 0.98 0.99 0.99 6.62
0.6 0.98 0.99 0.99 6.62
0.8 1.00 1.00 1.00 6.63
1.0 1.00 1.00 1.00 6.70
1.2 1.00 1.00 1.00 6.72

r0.6

5 Limitation↩︎

We acknowledge that our current design is tailored to Mixture-of-Experts architectures. However, this choice is motivated by the increasing adoption of sparse activation paradigms in modern LLM systems (e.g., DeepSeek, Qwen-MoE), where routing naturally provides a structured and low-overhead carrier for watermark signals. For dense Transformer models, a promising direction is to emulate implicit expert partitioning through structured sparsification. Specifically, one could leverage techniques such as dynamic neuron activation or structured pruning (e.g., block-wise or head-wise sparsity) to create multiple functionally redundant subspaces within dense layers.

6 Conclusion↩︎

Watermarking for LLMs remains challenging due to performance degradation and inference overhead, particularly in complex and constrained tasks. In this work, we systematically identify these limitations through a comprehensive benchmark and propose WaterMoE, a watermarking scheme tailored for MoE-based LLMs. By integrating watermark signals into the routing process, WaterMoE achieves strong detectability while preserving model quality and efficiency. Extensive experiments demonstrate its consistent advantages over existing methods, highlighting its practicality for real-world deployment.

7 Related Work↩︎

Semantic-level watermarking. Recent approaches explore embedding watermark signals at the semantic level. SIR [42] employs learned encoders to map semantically similar inputs to similar watermark patterns, improving robustness to paraphrasing. However, this design introduces additional system complexity and incurs non-trivial latency due to sentence-level encoding. Moreover, by conditioning watermark signals on semantic representations, such methods implicitly constrain the feasible token space during generation, leading to similar limitations as token-level approaches in restricting the solution space.

Subsequent methods such as SEMSTAMP [45] and KSEMSTAMP [46] adopt a different strategy by discretizing semantic representations via locality-sensitive hashing or clustering (e.g., k-means), and enforcing constraints on the semantic space of the next sentence. In practice, these methods rely on repeated resampling until a candidate satisfying the watermark constraint is found. While effective in controlled settings, this mechanism introduces substantial computational overhead, often requiring tens of resampling iterations per sentence, which leads to significant latency.

More critically, the imposed semantic constraints further shrink the already limited feasible solution space in many real-world tasks, such as summarization and question answering, where correctness and coherence impose strict requirements. Empirical evidence shows that even with up to 50 resampling attempts, SEMSTAMP frequently fails to embed watermarks successfully on datasets such as MultiNews and ELI5 benchmarks. These limitations suggest that existing semantic-level watermarking methods are not well-suited for practical deployment in constraint-heavy generation scenarios.

8 Detailed Background on Mixture-of-Experts (MoE)↩︎

8.1 Overview↩︎

Mixture-of-Experts (MoE) is a sparsely-activated neural architecture designed to scale model capacity without incurring proportional computational cost. Instead of using a single dense feed-forward network (FFN) in each Transformer layer, MoE replaces it with a set of \(K\) parallel expert networks and a routing mechanism that dynamically selects a subset of experts for each token.

Figure 4: Detailed Framework of MoE.

As illustrated in Fig. 4, an MoE layer consists of three key components:

  • Router (Gating Network): computes routing scores for each expert.

  • Experts: a set of independent feed-forward networks.

  • Aggregation: combines outputs from selected experts via weighted summation.

This sparse activation enables MoE models to achieve extremely large parameter counts while keeping the per-token computation comparable to standard dense models.

8.2 Formulation↩︎

Given the hidden representation \(\mathbf{h}_\ell \in \mathbb{R}^d\) at layer \(\ell\), the router produces a score vector: \[\mathbf{s}_\ell = \mathrm{Router}_\ell(\mathbf{h}_\ell), \quad \mathbf{s}_\ell \in \mathbb{R}^K,\] where \(K\) is the number of experts.

These scores are transformed into a probability distribution via softmax: \[p_\ell(i \mid \mathbf{h}_\ell) = \frac{\exp(s_{\ell,i})}{\sum_{j=1}^{K} \exp(s_{\ell,j})}.\]

Instead of using all experts, only the top-\(k\) experts are selected: \[\mathcal{E}_\ell(\mathbf{h}_\ell) = \mathrm{TopK}(p_\ell(\cdot \mid \mathbf{h}_\ell), k).\]

The final output of the MoE layer is: \[\mathrm{MoE}_\ell(\mathbf{h}_\ell) = \sum_{i \in \mathcal{E}_\ell(\mathbf{h}_\ell)} p_\ell(i \mid \mathbf{h}_\ell) \cdot f_i(\mathbf{h}_\ell),\] where \(f_i(\cdot)\) denotes the \(i\)-th expert network.

8.3 Integration with Transformer↩︎

In modern large language models, MoE layers replace the standard FFN sub-layer in Transformer blocks. A typical Transformer layer with MoE can be written as: \[\begin{align} \mathbf{h}'_\ell &= \mathbf{h}_\ell + \mathrm{Attention}(\mathrm{LN}(\mathbf{h}_\ell)), \\ \mathbf{h}_{\ell+1} &= \mathbf{h}'_\ell + \mathrm{MoE}_\ell(\mathrm{LN}(\mathbf{h}'_\ell)), \end{align}\] where \(\mathrm{LN}(\cdot)\) denotes Layer Normalization.

8.4 Routing Strategies↩︎

Different routing strategies are used in practice:

8.4.0.1 Top-\(k\) Routing

The most common strategy selects the top-\(k\) experts per token. Typical choices include:

  • \(k=1\) (Switch Transformer): maximum efficiency

  • \(k \geq 2\) (GShard, DeepSeek): better performance with modest overhead

8.5 Computational Efficiency↩︎

Although the total number of parameters grows linearly with \(K\), the actual computation per token depends only on \(k\): \[\text{FLOPs} \approx O(k \cdot d^2),\] which is comparable to a dense FFN when \(k \ll K\).

Thus, MoE achieves:

  • High capacity (large parameter count)

  • Low compute cost (sparse activation)

9 Theoretical Analysis of Routing Loss under Biased Routing↩︎

In this section, we mathematically prove that the expected routing probability deviation caused by the watermark bias is strictly bounded by \(\mathcal{O}(\delta^2)\). Thus, the routing process remains unbiased in expectation at the first order.

9.1 Notations and Assumptions↩︎

Model State. Let \(\mathbf{s}_\ell \in \mathbb{R}^K\) denote the original routing logits at the \(\ell\)-th layer. The original routing probability for the \(i\)-th expert, obtained via the Softmax function, is defined as: \[p_i = \frac{e^{s_{\ell,i}}}{\sum_{j=1}^K e^{s_{\ell,j}}}.\]

Permutation-Symmetric Expert Map. We define a binary indicator vector \(\mathbf{g}_\ell \in \{0, 1\}^K\) to represent the green expert assignment at the current layer. Based on the expert map, the assignment is determined by \(\mathcal{G}_\ell = \mathcal{M}_\ell(e_{\ell-1})\). This mapping satisfies two core constraints: (i) Fixed Green Proportion, which dictates that exactly half of the experts are activated as green experts per routing, i.e., \(\sum_{i=1}^K g_{\ell,i} = K/2\); and (ii) Permutation-Symmetric Constraint , which ensures that in global expectation, every expert has an equal probability of being selected as a green expert: \[\Pr(g_{\ell,i} = 1) = \Pr(g_{\ell,i} = 0) = \frac{1}{2}, \quad \forall i \in \{1, \dots, K\}.\]

Bias Injection. The actual routing bias vector applied at the current layer is \(\mathbf{b}_\ell = \delta \mathbf{g}_\ell\). Due to the binary nature of \(\mathbf{g}_\ell\), each component of the bias vector is restricted to a discrete set \(b_{\ell,j} \in \{0, \delta\}\). We assume the bias magnitude \(\delta\) is sufficiently small (\(\delta \ll 1\)) so that the higher-order Taylor expansion terms \(\mathcal{O}(\|\mathbf{b}_\ell\|^3)\) can be reasonably truncated. The routing probability after bias injection is denoted as \(p_i^{(g)}\).

9.2 Proof of Zero First-Order Expectation↩︎

According to the multidimensional Taylor expansion, the perturbed probability \(p_i^{(g)}\) at \(\mathbf{s}_\ell\) can be expanded as: \[p_i^{(g)} = p_i(\mathbf{s}_\ell) + \nabla p_i(\mathbf{s}_\ell)^\top \mathbf{b}_\ell + \frac{1}{2} \mathbf{b}_\ell^\top H^{(i)}(\mathbf{s}_\ell) \mathbf{b}_\ell + \mathcal{O}(\|\mathbf{b}_\ell\|^3).\] The first-order probability deviation is defined as \(\Delta p_i^{(1)} = \nabla p_i(\mathbf{s}_\ell)^\top \mathbf{b}_\ell\). Expanding the inner product and taking the mathematical expectation \(\mathbb{E}_{\mathbf{g}}\) over the bias distribution yields: \[\mathbb{E}_{\mathbf{g}}\left[ \Delta p_i^{(1)} \right] = \mathbb{E}_{\mathbf{g}}\left[ \sum_{j=1}^K \frac{\partial p_i}{\partial s_{\ell,j}} b_{\ell,j} \right] = \delta \sum_{j=1}^K \frac{\partial p_i}{\partial s_{\ell,j}} \mathbb{E}_{\mathbf{g}}[g_{\ell,j}].\] From the Permutation-Symmetric Constraint, we know \(\mathbb{E}_{\mathbf{g}}[g_{\ell,j}] = \Pr(g_{\ell,j}=1) = 1/2\). Substituting this into the expectation gives: \[\mathbb{E}_{\mathbf{g}}\left[ \Delta p_i^{(1)} \right] = \frac{\delta}{2} \sum_{j=1}^K \frac{\partial p_i}{\partial s_{\ell,j}}.\] Using the partial derivative property of the Softmax function, we have: \[\sum_{j=1}^K \frac{\partial p_i}{\partial s_{\ell,j}} = p_i(1 - p_i) - \sum_{j \neq i} p_i p_j = p_i - p_i \sum_{j=1}^K p_j.\] Given the probability normalization property \(\sum_{j=1}^K p_j = 1\), this sum strictly evaluates to 0. Therefore, the expected first-order deviation is completely eliminated, yielding \(\mathbb{E}_{\mathbf{g}}[\Delta p_i^{(1)}] = 0\).

9.3 Bounding the Second-Order Term↩︎

The second-order error term is \(\Delta p_i^{(2)} = \frac{1}{2} \mathbf{b}_\ell^\top H^{(i)}(\mathbf{s}_\ell) \mathbf{b}_\ell\). The quadratic form can be explicitly expressed as: \[\mathbf{b}_\ell^\top H^{(i)} \mathbf{b}_\ell = p_i \left[ (b_{\ell,i} - \bar{b})^2 - \left( \sum_{j=1}^K p_j b_{\ell,j}^2 - \bar{b}^2 \right) \right],\] where \(\bar{b} = \sum_{j=1}^K p_j b_{\ell,j}\) represents the expected value of the bias vector under the original probability distribution \(\mathbf{p}\). We now bound the two components inside the brackets.

First term. Since \(b_{\ell,i} \in \{0, \delta\}\) and the weighted average satisfies \(0 \le \bar{b} \le \delta\), the squared difference between them is strictly bounded by \((b_{\ell,i} - \bar{b})^2 \le \delta^2\).

Second term. This component represents the variance of the bias under distribution \(\mathbf{p}\). Since the indicator variable is strictly binary (\(g_{\ell,j} \in \{0, 1\}\)), it inherently satisfies \(g_{\ell,j}^2 = g_{\ell,j}\). For the bias terms \(b_{\ell,j} = \delta g_{\ell,j}\), this implies: \[b_{\ell,j}^2 = (\delta g_{\ell,j})^2 = \delta^2 g_{\ell,j} = \delta (\delta g_{\ell,j}) = \delta b_{\ell,j}.\] Substituting this identity into the probability-weighted sum yields: \[\sum_{j=1}^K p_j b_{\ell,j}^2 = \sum_{j=1}^K p_j (\delta b_{\ell,j}) = \delta \left( \sum_{j=1}^K p_j b_{\ell,j} \right) = \delta \bar{b}.\] The entire second term then simplifies to a downward-opening quadratic function with respect to \(\bar{b}\). By completing the square, we obtain: \[\sum_{j=1}^K p_j b_{\ell,j}^2 - \bar{b}^2 = \delta \bar{b} - \bar{b}^2 = -\left(\bar{b} - \frac{\delta}{2}\right)^2 + \frac{\delta^2}{4}.\] Because the squared component is non-negative, the global maximum of this term is achieved at \(\bar{b} = \delta/2\), leading to the strict bound: \[\sum_{j=1}^K p_j b_{\ell,j}^2 - \bar{b}^2 \le \frac{\delta^2}{4}.\]

Combining the bounds for both the first and second terms, the absolute value of the total second-order deviation is limited by: \[\left| \Delta p_i^{(2)} \right| \le \frac{1}{2} p_i \left( \delta^2 + \frac{\delta^2}{4} \right) = \frac{5}{8} p_i \delta^2 = \mathcal{O}(\delta^2).\]

Conclusion↩︎

Combining the derivations above, under the first-order approximation, the expected routing probability satisfies: \[\mathbb{E}_{\mathbf{g}}[p_i^{(g)}] = p_i + \mathbb{E}_{\mathbf{g}}[\Delta p_i^{(1)}] + \mathbb{E}_{\mathbf{g}}[\Delta p_i^{(2)}] = p_i + 0 + \mathcal{O}(\delta^2).\] This confirms that the watermark injection preserves the expected routing probabilities (i.e., \(\mathbb{E}_{\mathbf{g}}[p_i^{(g)}] = p_i\) at the first order), demonstrating that the routing process remains unbiased in expectation.

10 Performance on Moderate-Complexity Tasks.↩︎

Table 6 shows the detection-text quality trade-off on both MultiNews and ELI5. On the smaller Mixtral-8\(\times\)​7B model, which is harder to achieve balance, WaterMoE achieves substantially higher detection rates under strict thresholds while also attaining the highest AUC and maintaining Rouge-L comparable to the unwatermarked baseline. A similar trend holds on ELI5, where WaterMoE achieves the best AUC and Rouge-L, with strong detection performance. Overall, it achieves strong detectability without sacrificing text quality across models and tasks.

Table 6: Watermarking performance on Moderate-Complexity Tasks. WaterMoE consistently achieves the highest AUC and TPR while maintaining competitive Rouge-L scores.
Dataset: MultiNews
Algorithm Mixtral-8\(\times\)7B Qwen
TPR@1% TPR@5% AUC Rouge-L TPR@1% TPR@5% AUC Rouge-L
Unwatermarked - - - 38.1 - - - 40.6
EWD [26] 71.0 84.5 94.2 37.8 91.5 95.5 99.3 40.1
EXPEdit [39] 41.5 61.5 91.7 35.3 36.0 48.0 77.6 31.5
KGW [17] 21.0 49.5 86.5 36.3 98.5 100.0 100.0 40.3
MorphMark [27] 26.0 41.0 88.2 36.4 77.0 93.5 98.9 40.5
SIR [42] 21.5 36.0 85.0 35.9 - - - -
SynthID [18] 8.0 17.5 63.7 38.0 98.0 99.0 99.5 40.5
Unbiased [40] 74.5 82.5 93.1 37.7 13.0 52.0 73.8 40.5
UPV [41] 17.0 29.5 87.4 34.2 3.5 27.0 84.3 40.3
XSIR [43] 8.0 19.5 67.5 35.3 - - - -
WaterMoE 83.5 86.5 99.6 38.3 100.0 100.0 100.0 40.4
Dataset: ELI5
Algorithm Mixtral-8\(\times\)7B Qwen
TPR@1% TPR@5% AUC Rouge-L TPR@1% TPR@5% AUC Rouge-L
Unwatermarked - - - 31.2 - - - 28.8
EWD 87.0 91.0 98.6 29.3 100.0 100.0 100.0 28.5
EXPEdit 28.5 28.5 64.9 29.4 32.0 32.0 69.8 26.1
KGW 78.0 89.5 97.6 28.8 100.0 100.0 100.0 28.5
MorphMark 49.5 64.5 90.8 29.3 92.0 96.5 99.5 28.5
SIR 63.0 75.5 93.7 28.6 - - - -
SynthID 43.0 67.0 92.1 30.2 99.5 100.0 100.0 28.5
Unbiased 84.0 89.5 96.4 29.8 100.0 100.0 100.0 28.0
UPV 60.5 80.5 95.1 28.4 95.5 100.0 99.9 28.2
XSIR 47.0 60.5 87.5 27.6 - - - -
WaterMoE 81.0 97.5 98.8 30.5 100.0 100.0 100.0 28.8

11 Three-Ent and Semantic Entropy Analysis↩︎

As illustrated in Fig. 5, we compare the trigram entropy (three-ent) and semantic entropy of texts generated by different methods. Our proposed WaterMoE produces entropy values that are closest to those of the non-watermarked model. In contrast, other watermarking methods lead to noticeable reductions in entropy.

This observation indicates that WaterMoE better preserves the diversity and richness of the generated text, maintaining natural generation characteristics while embedding the watermark.

Figure 5: Trigram entropy and semantic entropy comparison. WaterMoE preserves entropy closest to the non-watermarked model, indicating better text diversity.

12 Watermarking Setup for Reproducibility↩︎

To ensure reproducibility, we summarize the watermark-specific hyperparameters for all algorithms under different task complexity levels in Table 7. Each cell reports the key hyperparameter used for the corresponding setting.

Table 7: Watermark hyperparameters across different task complexity levels. EXPEdit and Unbiased are distortion-free algorithms and thus do not require injection strength parameters (denoted by -). SIR and XSIR are not applicable to high-complexity tasks as they are incompatible with the Qwen model.
Algorithm Low Moderate High
KGW \(\delta = 2\) \(\delta = 2\) \(\delta = 5\)
SynthID num_leaves=2 num_leaves=2 num_leaves=8
EWD \(\delta = 2\) \(\delta = 2\) \(\delta = 5\)
EXPEdit - - -
MorphMark \(k_{\text{exp}} = 1.3\) \(k_{\text{exp}} = 1.3\) \(k_{\text{exp}} = 7\)
Unbiased - - -
UPV \(\delta = 2\) \(\delta = 2\) \(\delta = 4\)
SIR \(\delta = 1\) \(\delta = 1\) -
XSIR \(\delta = 1\) \(\delta = 1\) -
WaterMoE \(\delta = 0.8\) \(\delta = 0.2\) \(\delta = 0.2\)

13 Dataset and Global Prompts↩︎

To ensure evaluation consistency and standardize model behavior across diverse tasks, we define a specific "Global Prompt" for each dataset. These prompts serve as the foundational instructions that dictate the model’s reasoning style and output constraints, effectively minimizing performance variance caused by prompt phrasing.

The complete set of these standardized instructions, categorized by task type and dataset, is presented in Figure 6. These prompts are prepended to each individual query to guide the model’s generation process throughout our experiments.

Figure 6: Detailed Global Prompts used across various datasets to standardize model instructions and output formats.

14 Configuration of Attack Prompts↩︎

In this section, we present the prompts used for different types of watermark attacks. In addition to the document-level paraphrasing attack, we specifically design token-level substitution.

Token-level Substitution Attack. The prompt for the token-level substitution attack explicitly instructs the model to replace a specific ratio of words with their synonyms while maintaining the original semantic meaning and logical order as much as possible, as shown in Figure 7.

None

Figure 7: Prompt used for the token-level substitution attack..

Document-level Paraphrasing Attack. For the document-level paraphrasing attack, we instruct the model to rewrite the entire text output, simulating a real-world scenario of semantic restructuring, as depicted in Figure 8.

None

Figure 8: Prompt used for the document-level paraphrasing attack..

15 ROC-AUC Curves of Watermarking Methods on MultiNews.↩︎

As shown in Fig.9, we present the ROC-AUC curves of all evaluated watermarking algorithms on the MultiNews task using Mixtral-8x7B.

a
b
c
d
e
f
g
h
i

Figure 9: ROC-AUC curves of different watermarking methods on MultiNews (Mixtral-8x7B).. a — EWD, b — EXPEdit, c — KGW, d — MorphMark, e — SIR, f — SynthID, g — Unbiased, h — UPV, i — WaterMoE

16 Examples of Prompts and Generated Texts across Different Tasks↩︎

To provide a qualitative understanding of watermark behavior across different task types, we present representative examples from three categories: summarization, code generation, and alignment. For each task, we show the input prompt together with the corresponding outputs generated with and without watermarking. These examples highlight how WaterMoE embeds watermark signals while preserving task fidelity. In particular, the comparisons illustrate that the watermarked outputs remain semantically consistent with the unwatermarked ones, even under strict task constraints such as structured code generation and format-sensitive alignment tasks.

Figure 10: An example of the Summarization task from the Multi-News dataset. The texts are generated using the WaterMoE watermark algorithm. In the “Watermark text” section, words with a green background indicate tokens that were altered by the watermark algorithm, while words with a gray background indicate unchanged tokens that remain identical to those in the “Unwatermark text”.
Figure 11: An example of the Coding task from the APPS dataset. The text demonstrates the prompt and the corresponding outputs generated with and without the WaterMoE watermark algorithm.
Figure 12: An example of the Alignment task from the IFEval dataset. The text illustrates the prompt along with the watermarked (using WaterMoE) and unwatermarked generation results, demonstrating adherence to the length and formatting constraints.

References↩︎

[1]
W. Wang et al., “A survey of llm-based agents in medicine: How far are we from baymax?” Findings of the Association for Computational Linguistics: ACL 2025, pp. 10345–10359, 2025.
[2]
D. Yuan et al., “A continued pretrained llm approach for automatic medical note generation,” in Proceedings of the 2024 conference of the north american chapter of the association for computational linguistics: Human language technologies (volume 2: Short papers), 2024, pp. 565–571.
[3]
T. Labruna, J. A. Campos, and G. Azkune, “When to retrieve: Teaching llms to utilize information retrieval effectively,” in Proceedings of the 15th international conference on recent advances in natural language processing-natural language processing in the generative AI era, 2025, pp. 623–632.
[4]
Y. Zhu et al., “Large language models for information retrieval: A survey,” ACM Transactions on Information Systems, vol. 44, no. 1, pp. 1–54, 2025.
[5]
K. Zeng et al., “Rethinking driving world model as synthetic data generator for perception tasks,” arXiv preprint arXiv:2510.19195, 2025.
[6]
S. Ghodratnama and M. Zakershahrak, “Adapting llms for efficient, personalized information retrieval: Methods and implications,” in International conference on service-oriented computing, 2023, pp. 17–26.
[7]
Y. Li et al., “Competition-level code generation with alphacode,” Science, vol. 378, no. 6624, pp. 1092–1097, 2022.
[8]
J. Wang and Y. Chen, “A review on code generation with llms: Application and evaluation,” in 2023 IEEE international conference on medical artificial intelligence (MedAI), 2023, pp. 284–289.
[9]
Z. Yang et al., “An empirical study of retrieval-augmented code generation: Challenges and opportunities,” ACM Transactions on Software Engineering and Methodology, vol. 34, no. 7, pp. 1–28, 2025.
[10]
J. Jiang, F. Wang, J. Shen, S. Kim, and S. Kim, “A survey on large language models for code generation,” ACM Transactions on Software Engineering and Methodology, vol. 35, no. 2, pp. 1–72, 2026.
[11]
X. Huang et al., “Understanding the planning of llm agents: A survey,” arXiv preprint arXiv:2402.02716, 2024.
[12]
Z. Liu, Y. Zhang, P. Li, Y. Liu, and D. Yang, “Dynamic llm-agent network: An llm-agent collaboration framework with agent team optimization,” arXiv preprint arXiv:2310.02170, 2023.
[13]
Z. Chu et al., “Llm agents for education: Advances and applications,” arXiv preprint arXiv:2503.11733, vol. 2, 2025.
[14]
Y. Li et al., “Agentswift: Efficient llm agent design via value-guided hierarchical search,” in Proceedings of the AAAI conference on artificial intelligence, 2026, vol. 40, pp. 31843–31851.
[15]
Y. Liang, J. Xiao, W. Gan, and P. S. Yu, “Watermarking techniques for large language models: A survey,” Artificial Intelligence Review, vol. 59, no. 2, p. 74, 2026.
[16]
H. Huang, X. Gong, Y. Zhang, H. Zheng, and S. Liang, “RLSpoofer: A lightweight evaluator for LLM watermark spoofing resilience,” arXiv preprint arXiv:2604.11546, 2026.
[17]
J. Kirchenbauer, J. Geiping, Y. Wen, J. Katz, I. Miers, and T. Goldstein, “A watermark for large language models,” in International conference on machine learning, 2023, pp. 17061–17084.
[18]
S. Dathathri et al., “Scalable watermarking for identifying large language model outputs,” Nature, vol. 634, no. 8035, pp. 818–823, 2024.
[19]
W. Cai, J. Jiang, F. Wang, J. Tang, S. Kim, and J. Huang, “A survey on mixture of experts,” Authorea Preprints, 2024.
[20]
T. Zhu et al., “Llama-moe: Building mixture-of-experts from llama with continual pre-training,” in Proceedings of the 2024 conference on empirical methods in natural language processing, 2024, pp. 15913–15923.
[21]
S. Rajbhandari et al., “Deepspeed-moe: Advancing mixture-of-experts inference and training to power next-generation ai scale,” in International conference on machine learning, 2022, pp. 18332–18346.
[22]
A. Skliar et al., “Mixture of cache-conditional experts for efficient mobile device inference,” arXiv preprint arXiv:2412.00099, 2024.
[23]
A. Liu et al., “Deepseek-v3 technical report,” arXiv preprint arXiv:2412.19437, 2024.
[24]
A. Yang et al., “Qwen3 technical report,” arXiv preprint arXiv:2505.09388, 2025.
[25]
Y. Li et al., “Uni-moe: Scaling unified multimodal llms with mixture of experts,” IEEE Transactions on Pattern Analysis and Machine Intelligence, 2025.
[26]
Y. Lu, A. Liu, D. Yu, J. Li, and I. King, “An entropy-based text watermarking detection method,” in Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), 2024, pp. 11724–11735.
[27]
Z. Wang, T. Gu, B. Wu, and Y. Yang, “Morphmark: Flexible adaptive watermarking for large language models,” in Proceedings of the 63rd annual meeting of the association for computational linguistics (volume 1: Long papers), 2025, pp. 4842–4860.
[28]
L. Pan et al., “Markllm: An open-source toolkit for llm watermarking,” in Proceedings of the 2024 conference on empirical methods in natural language processing: System demonstrations, 2024, pp. 61–71.
[29]
A. Q. Jiang et al., “Mixtral of experts,” arXiv preprint arXiv:2401.04088, 2024.
[30]
C. Raffel et al., “Exploring the limits of transfer learning with a unified text-to-text transformer,” Journal of machine learning research, vol. 21, no. 140, pp. 1–67, 2020.
[31]
W. Kryściński, N. Rajani, D. Agarwal, C. Xiong, and D. Radev, “Booksum: A collection of datasets for long-form narrative summarization,” in Findings of the association for computational linguistics: EMNLP 2022, 2022, pp. 6536–6558.
[32]
A. R. Fabbri, I. Li, T. She, S. Li, and D. Radev, “Multi-news: A large-scale multi-document summarization dataset and abstractive hierarchical model,” in Proceedings of the 57th annual meeting of the association for computational linguistics, 2019, pp. 1074–1084.
[33]
A. Fan, Y. Jernite, E. Perez, D. Grangier, J. Weston, and M. Auli, “ELI5: Long form question answering,” in Proceedings of the 57th annual meeting of the association for computational linguistics, 2019, pp. 3558–3567.
[34]
D. Hendrycks et al., “Measuring coding challenge competence with apps,” arXiv preprint arXiv:2105.09938, 2021.
[35]
K. Cobbe et al., “Training verifiers to solve math word problems,” arXiv preprint arXiv:2110.14168, 2021.
[36]
D. Hendrycks et al., “Measuring massive multitask language understanding,” arXiv preprint arXiv:2009.03300, 2020.
[37]
J. Zhou et al., “Instruction-following evaluation for large language models,” arXiv preprint arXiv:2311.07911, 2023.
[38]
Y. Wu et al., “Writingbench: A comprehensive benchmark for generative writing,” arXiv preprint arXiv:2503.05244, 2025.
[39]
R. Kuditipudi, J. Thickstun, T. Hashimoto, and P. Liang, “Robust distortion-free watermarks for language models,” arXiv preprint arXiv:2307.15593, 2023.
[40]
Z. Hu, L. Chen, X. Wu, Y. Wu, H. Zhang, and H. Huang, “Unbiased watermark for large language models,” arXiv preprint arXiv:2310.10669, 2023.
[41]
A. Liu et al., “An unforgeable publicly verifiable watermark for large language models,” arXiv preprint arXiv:2307.16230, 2023.
[42]
A. Liu, L. Pan, X. Hu, S. Meng, and L. Wen, “A semantic invariant robust watermark for large language models,” arXiv preprint arXiv:2310.06356, 2023.
[43]
Z. He et al., “Can watermarks survive translation? On the cross-lingual consistency of text watermark for large language models,” in Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), 2024, pp. 4115–4129.
[44]
T. Gloaguen, N. Jovanović, R. Staab, and M. Vechev, “Black-box detection of language model watermarks,” arXiv preprint arXiv:2405.20777, 2024.
[45]
A. Hou et al., “Semstamp: A semantic watermark with paraphrastic robustness for text generation,” in Proceedings of the 2024 conference of the north american chapter of the association for computational linguistics: Human language technologies (volume 1: Long papers), 2024, pp. 4067–4082.
[46]
A. Hou, J. Zhang, Y. Wang, D. Khashabi, and T. He, “K-SemStamp: A clustering-based semantic watermark for detection of machine-generated text,” in Findings of the association for computational linguistics: ACL 2024, 2024, pp. 1706–1715.

  1. Corresponding author.↩︎