Skip to content

SWIFT: An Adaptive Co-Serving LLM Watermarking Framework on Modern Inference EnginesAdaptive Co-Serving LLM Watermarking on Modern Inference Engines

arXiv· arXiv:2610.03955· Kieu Dang, Phung Lai, Ching-Yun Ko, Pin-Yu ChenState University of New York at Albany; IBM ResearchIndexed by this site · 27 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors propose SWIFT, which co-designs LLM watermarking with the vLLM inference engine; on C4 with Gemma-3-27B-IT as the shared LLM, utility is 4.87, detection rate 99.65%, and latency 0.905s.

Threat modelIn the proprietary LLM service provider scenario, users submit prompts through an API and receive outputs. A black-box attacker can query the API and observe outputs but cannot access model parameters, architecture, or internal state; the goal is to weaken detection through watermark removal attacks such as paraphrasing, insertion, synonym substitution, and rewriting while preserving the content of the original text.

Questions
LLM watermarking is used for provenance verification and intellectual property protection, but existing methods implement the watermarking algorithm separately from the inference engine, relying on external NLP tools or auxiliary models, which brings latency and memory overhead and makes it difficult to exploit modern inference optimizations, leaving a deployment gap.
Methods
SWIFT places text generation and watermark construction on the same vLLM engine, the same LLM, and the same GPU for asynchronous collaborative serving: watermark requests are submitted by sentence segment, the shared LLM performs instruction-guided candidate word generation and protects named entities, and then key-conditioned Tournament selection is used to embed the watermark; the adaptive scheduler adjusts the watermark request admission ratio based on queue length and waiting time.
Experiments and results
On C4 text generation, SWIFT utility 4.87, detection rate 99.65%, latency 0.905s; the authors state latency is 5.9 times lower than SafeSeal; detection rate after Substitution attack is 97.7%, and after SIRA attack it drops to 26.4% but the attack output win rate is only 0.145; task accuracy on GSM8K and MedMCQA does not drop.
Limitations and future work
Limitations noted by the authors: watermark quality depends on the capability of the shared LLM; KV-cache reuse for segment-level suffixes is not implemented; output is streamed by sentence rather than token by token. Experiments cover 4 LLMs and 4 datasets, utility is reviewed by GPT-5.5, and the paper does not report agreement between the reviewer and human judgments.
Experimental setupGemma-3-27B-IT、Qwen2.5-32B et al. · C4、CNN/Daily Mail et al. · Utility (0-5, LLM-as-a-judge)、Detection accuracy et al.
Evaluated models
Gemma-3-27B-ITQwen2.5-32BLLaMA-3.1-8B-InstructMinistral-8B-Instruct
Benchmarks
C4CNN/Daily MailGSM8KMedMCQA
Metrics
Utility (0-5, LLM-as-a-judge)Detection accuracyRobustness (post-attack detection)LatencyThroughputGPU KV-cache usagePrefix-cache hit rateAUC
AI summaryThe SWIFT framework co-designs LLM watermarking with modern inference engines, integrating text generation and watermark construction within a shared backend, and reduces latency through asynchronous co-serving, adaptive scheduling, and vLLM optimizations. Experiments show a utility score of 4.87 and a detection accuracy of 99.65%, higher than the low-latency baseline SynthID's 76.65%; under watermark removal attacks, the detection rate is up to 97.7%, and latency is 5.9 times lower than the highest-utility baseline SafeSeal.

The SWIFT framework co-designs LLM watermarking with modern inference engines, integrating text generation and watermark construction within a shared backend, and reduces latency through asynchronous co-serving, adaptive scheduling, and vLLM optimizations. Experiments show a utility score of 4.87 and a detection accuracy of 99.65%, higher than the low-latency baseline SynthID's 76.65%; under watermark removal attacks, the detection rate is up to 97.7%, and latency is 5.9 times lower than the highest-utility baseline SafeSeal.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that the separation of existing LLM watermarking from the inference engine creates a deployment gap, and propose SWIFT, a watermarking framework co-designed with vLLM.

    Core problem: existing LLM watermarking methods treat watermarking as an external pipeline independent of the inference engine, which increases latency, GPU memory, and system complexity, making deployment in real LLM services difficult.

    • Problem setting: once LLM outputs leave the service provider, their source is hard to verify; watermarks can embed imperceptible but detectable signals for source verification and attribution; but to be practical, they must be efficiently integrated into the inference engine that generates outputs at scale.
    • Shortcomings of existing methods (as stated in the paper): watermarking is mostly implemented as an auxiliary pipeline that relies on external NLP tools such as spaCy, Stanza, and NLTK for NER and POS tagging, increasing latency and GPU memory; inference optimizations such as asynchronous generation, KV-cache reuse, prefix sharing, and scheduling are rarely exploited by watermarking methods.
    • Core observation: the authors argue that watermarking performance depends on both the embedding algorithm and how it is integrated with the underlying inference system, so watermarking should be designed as part of the inference engine rather than an add-on pipeline.
    • Proposed in the paper: SWIFT (Serving-aware Watermarking for Inference-Friendly Text generation), which on vLLM unifies text generation and watermark construction in a shared LLM backend, together with instruction-guided candidate generation, asynchronous co-serving, and adaptive scheduling. The authors describe it as "to our knowledge, the first" such serving-aware watermarking framework.
    • Threat model:
      • Victim system: a proprietary LLM service provider, where users submit prompts through an API and receive outputs.
      • Attacker knowledge: black-box; can query the API and observe outputs, but cannot access model parameters, architecture, or internal state.
      • Attacker goal: weaken watermark detection while preserving the content of the original text.
      • Attack means: watermark removal attacks, such as paraphrasing, insertion, synonym substitution, and rewriting.
  2. What related research exists?

    Related work falls into three categories: LLM watermarking (in-processing and post-processing), inference engines and serving systems, and the three baselines compared in this paper.

    LLM watermarking methods

    • In-processing watermarking (Zhao et al., 2024; Liu & Bu, 2024; Hu et al., 2024): modifies token selection during decoding, naturally supporting streaming output; the paper notes that its per-token modification may accumulate utility loss over long outputs and may not fully exploit modern serving optimizations (Fernandez et al., 2025).
    • Post-processing watermarking (Topkara et al., 2006; Chang et al., 2024; Yang et al., 2022; Dang et al., 2026): modifies already-generated text, can select watermark positions and replacement words under semantic and contextual constraints, better preserving utility; the paper notes that it adds latency and memory overhead and is less suitable for streaming scenarios.

    LLM inference engines and serving systems

    • vLLM (Kwon et al., 2023): manages KV state in fixed-size blocks via PagedAttention, reducing memory fragmentation, and supports continuous batching, prefix caching, asynchronous generation and structured decoding; it is the foundation of SWIFT.
    • Other serving systems: Orca introduces iteration-level scheduling (Yu et al., 2022); SGLang uses RadixAttention to improve cross-request KV reuse (Zheng et al., 2024); Sarathi-Serve uses chunked prefill to mitigate prefill-decode interference (Agrawal et al., 2024); DistServe and Splitwise decouple prefill and decode (Zhong et al., 2024; Patel et al., 2024).
    • Gap noted by the paper: existing vLLM watermarking integrations mainly target in-processing methods (Verma, 2025; vLLM Team, 2026b), and post-processing watermarking with serving optimizations remains underexplored.

    Baselines and benchmarks

    • Baseline methods: KGW (logit-bias method), SynthID (sampling method based on a pseudorandom key), SafeSeal (lexical replacement method with named entity protection), covering both in-processing and post-processing categories.
    • Benchmarks/datasets: C4 (text generation), CNN/Daily Mail (summarization), GSM8K (short-text mathematical reasoning), MedMCQA (medical question answering).

    The authors position this paper as: combining named entity protection, streaming generation, watermark construction without an auxiliary model, and vLLM serving optimizations within a single framework (Appendix Table 4 provides a comparison with each method across five features).

  3. How does the paper address this problem?

    SWIFT asynchronously co-serves text generation and watermark construction on the same vLLM engine, the same LLM, and the same GPU, and uses an adaptive scheduler to balance the two workloads.

    Overall approach: change watermarking from an add-on pipeline of "post-generation processing" to an asynchronous collaborative service that shares the backend with text generation. SWIFT consists of three parts: an asynchronous collaborative service architecture, an adaptive collaborative scheduler, and instruction-guided watermark construction and detection.

    Design goals and overall architecture

    • Four goals: unified design (shared LLM backend, fewer external dependencies), utility preservation (instruction-guided watermarking), adaptive collaborative service (control watermark backlog, maintain streaming responses), and service efficiency (use inference optimizations to reduce computation, memory, and latency).
    • The text stream and the watermark stream share the same vLLM engine, the model is loaded only once, and both workloads can use optimizations such as prefix caching, continuous batching, chunked prefill, and structured decoding (Figure 2, Algorithm 1).

    Asynchronous collaborative service

    • The text generation stream decodes autoregressively and produces tokens step by step; a segment buffer collects tokens, and upon detecting a sentence boundary, submits the complete sentence segment si as a watermark request to the shared LLM, without text generation waiting for watermarking to complete.
    • Processed watermark segments are streamed back to the user in the original order; the paper explicitly states that the current streaming is at the segment level rather than token by token.

    Adaptive collaborative scheduler

    • Every K scheduling steps, the watermark admission ratio is updated: rτ = rmin + (rmax − rmin)  pτ, where p_τ is the normalized watermark pressure; when pressure is low, capacity is left to text generation, and when pressure is high, watermark admission is increased to prevent backlog.
    • The pressure estimate takes the larger of queue backlog and waiting time: pτ = clip(max(qτ/Bmax,  wτ/Wmax), 0, 1), where q_τ is the watermark queue length and w_τ is the waiting time of the oldest request.
    • The target watermark capacity is Bτwm = ⌊rτ B⌋, where B is the maximum number of concurrent sequences supported by the shared vLLM; scheduling only controls admission and does not modify the decoding process. Experimental settings: K = 5, rmin = 0, rmax = 1, Bmax = 32, Wmax = 1.5s (Appendix B).

    Watermark construction and detection

    • Instruction-guided candidate generation: the watermark prompt Pi = [Pshared; si], where the shared prefix Pshared specifies protected-information rules, semantic and factual constraints, candidate generation instructions, and few-shot examples (the template is given in Appendix C); because Pshared is the same across requests, prefix caching can reuse its KV state. vLLM structured output decoding is used to constrain the output to a JSON candidate mapping.
    • Key-conditioned selection: key-parameterized Tournament selection (Dathathri et al., 2024) reproducibly selects replacement words from the candidates to obtain the watermark segment; it is reproducible under the same key and unpredictable without the key.
    • Detection: a key-conditioned contrastive detector (Dang et al., 2026) encodes text with RoBERTa, maps the key to a deterministic embedding, and treats matching text–key pairs as positive samples; training uses a binary classification detection loss plus a contrastive loss. The detector is trained once on 20,000 C4 samples and reused across tasks without retraining.
  4. What experiments did the paper conduct?

    Compared with 3 baselines on 4 tasks and 4 LLMs: on C4, SWIFT utility 4.87, detection 99.65%, latency 0.905s; the authors state it is 5.9 times faster than SafeSeal.

    Experimental setup

    • Models tested: Gemma-3-27B-IT as the shared LLM (main experiments); Qwen2.5-32B, LLaMA-3.1-8B-Instruct, and Ministral-8B-Instruct for cross-LLM and key-conditioned detection experiments.
    • Datasets: C4 (first 50 tokens as the prompt, at most 200 tokens generated), CNN/Daily Mail (summarization, at most 60 words), GSM8K (at most 50 tokens of reasoning plus the answer), MedMCQA (explanations of at most 100 tokens, keeping only questions with a single answer and an explanation longer than 50 words).
    • Baselines: KGW, SynthID, SafeSeal; all methods use the same vLLM backend, model, and generation settings, on a single NVIDIA A100 80GB, batch size 32, KV-cache block 16.
    • Metrics and judging: utility is scored 0-5 by GPT-5.5 as an LLM-as-a-judge; detection rate is the average of the accuracy on watermarked and non-watermarked classes; robustness is the proportion judged watermarked after an attack; service efficiency is mainly measured by end-to-end latency.
    • Sample sizes: the detector is trained on 20,000 C4 samples and evaluated on 1,000 held-out samples; unless otherwise stated, results are computed on 1,000 samples; SWIFT latency is repeated over 30 independent runs.
    • Attacks: Dipper (sentence-level paraphrasing), Substitution (token-level synonym replacement), SIRA (LLM rewriting based on self-information).

    Main results

    C4 text generation and CNN/Daily Mail summarization (Figure 4(a)(b), Gemma-3-27B-IT; latency values given in the main text):

    Swipe horizontally to read the table

    MethodC4 utilityC4 detection rateC4 latencySummarization utilitySummarization detection rateSummarization latency
    KGW2.01-2.02*95.50%*0.88-0.90s*–67.35%slightly lower than SWIFT
    SynthID2.01-2.02*76.65%0.88-0.90s*–59.25%slightly lower than SWIFT
    SafeSealhigher than KGW/SynthIDhigher than KGW/SynthID5.34slower than SWIFT96.45%about 2 times SWIFT
    SWIFT4.8799.65%0.905s4.5798.8%0.559s

    According to Figure 4 and the main text. *The main text gives the utility (2.01-2.02) and latency (0.88-0.90s) of KGW and SynthID combined as ranges, without matching them individually; KGW's C4 detection rate of 95.50% is taken from the upper end of that range, and the paper does not state the two values separately. For the summarization task, the paper gives no specific numbers for the utility and latency of KGW/SynthID.

    • The authors state that SWIFT achieves the best trade-off among utility, detection rate, and latency: latency close to in-processing methods, utility and detection rate close to or exceeding the post-processing SafeSeal, and latency about 5.9 times lower than SafeSeal.
    • The trend is consistent on Qwen2.5-32B (Figure 7): text generation utility 3.837, detection rate 98.56%, latency 1.102s; summarization utility 3.685, detection rate 95.9%, latency 0.58s.

    Robustness and downstream tasks

    • Resistance to removal attacks (Figure 4(c)): SWIFT's detection rate is 97.7% after the Substitution attack and 61.3% after Dipper; SIRA reduces SWIFT's detection rate to 26.4%, but the attack output's pairwise win rate against the original watermarked output is only 0.145 (GPT-5.5 judging), and SIRA requires 8.933s, about 9.87 times SWIFT's latency. The authors state that SWIFT and SafeSeal are clearly better than KGW and SynthID.
    • GSM8K short reasoning (Table 1): SWIFT maintains task accuracy of 93.2% (the same as without watermarking), with the highest utility of 4.93, detection rate 90.70%, and latency 0.352s; SafeSeal has a detection rate of 90.75% but latency 3.253s; KGW/SynthID have detection rates of only 53.35%/54.95% and slightly reduced accuracy.
    • MedMCQA medical question answering (Table 6): SWIFT maintains accuracy of 62.6%, with the highest utility of 4.70, detection rate 96.70%, and the lowest latency of 0.401s; SafeSeal has a higher detection rate of 97.90% but latency 1.732s and utility 3.14.

    Scheduling, key-conditioned detection, and qualitative analysis

    • Adaptive scheduling (Figure 5(a)): compared with fixed admission ratios in [0.1, 0.95], adaptive scheduling (updated every 5 steps) achieves the lowest latency of 0.905s; too low a ratio causes watermark backlog, and r = 0.95 interferes with text generation.
    • Key-conditioned detection (Figure 5(b)): with the correct key, the detection rates for Gemma-3, Qwen-2.5, and LLaMA-3.1 are 99.2-99.7%, and with a wrong key 0-1.9%; for the unseen Ministral, using the Gemma-3 key, only 3.7% are detected. The authors state that a single detector can be reused across LLMs without per-model retraining.
    • Qualitative comparison (Tables 2, 8, 9): in the C4 example, KGW changes "20 years" to "25 years", and SynthID changes it to "23 years" and adds unsupported details, while SWIFT preserves the key facts; in the GSM8K example, KGW/SynthID change the final answer (utility 1), while SWIFT scores 5; in the MedMCQA example, SWIFT scores 5, and KGW/SynthID/SafeSeal score 3/2/2.

    Other ablations and analyses

    • SWIFT-FB (continuous batching and request priority disabled, Table 3): latency +20.67%, utility unchanged.
    • SWIFT-NER (using the external spaCy NER tool instead, Table 3): latency +87.90%, utility -5.36%.
    • SWIFT-EN (entity-protection instructions removed, Table 3): latency -0.55%, utility -50.95%.
    • Service efficiency (Table 10): SWIFT throughput is 528.7 tokens/s (which the authors state is 2.64 times KGW and 14.1 times SafeSeal), KV-cache usage 12.8%, prefix-cache hit rate 96.8% (baselines about 0%), and peak memory the same as KGW/SynthID.
    • Repeatability (Table 5): average latency over 30 runs is 0.9039 ± 0.0291s, with a one-sample t-test against 0.905s giving p = 0.834.
    • ROC and scalability (Figure 8): SWIFT AUC 0.9999, TPR 99.8% at 1% FPR; as output length goes from 100 to 2,000 tokens, latency grows 15.9 times, with a slope of 3.697 ms/token, close to SynthID (3.728) and KGW (3.953); the authors state that this shows scalability comparable to token-level methods rather than being generally better.
  5. What are some points that can be further explored?

    The authors list three limitations (reliance on shared LLM capabilities, insufficient KV-cache reuse, sentence-segment-level streaming) and plan to improve streaming granularity and cache reuse.

    Limitations and future directions noted by the authors

    • Dependence on the shared LLM's capability (Section 4.2 Limitations): watermark quality depends on the shared LLM; weaker models may produce unreliable substitutions or fail to protect protected information, reducing output quality and utility in specialized domains.
    • Insufficient KV-cache reuse (same section): the shared instruction prefix can benefit from prefix caching, but KV state reuse for segment-level suffixes remains difficult because text generation uses the original prompt and history, while candidate generation uses a separate watermarking context.
    • Sentence-segment-level streaming (same section): output is currently streamed at the sentence level rather than token by token.
    • Future directions (Section 5 Conclusion): the authors plan to explore finer-grained streaming output through adaptive token release and to improve KV-cache reuse across generation and watermarking contexts.

    Scope of experiments

    • The models tested are Gemma-3-27B-IT, Qwen2.5-32B, LLaMA-3.1-8B-Instruct, and Ministral-8B-Instruct, 4 in total; Ministral appears only in the unseen-model experiment on key-conditioned detection (Figure 5(b)).
    • The evaluation tasks and datasets are C4, CNN/Daily Mail, GSM8K, and MedMCQA, 4 in total; unless otherwise stated, each condition is computed on 1,000 samples, and latency is repeated 30 times (Appendix B).
    • Attack evaluation includes three removal attacks: Dipper, Substitution, and SIRA; it does not include separate results for the insertion-type attacks mentioned in the paper.
    • Utility review uses a single reviewer model, GPT-5.5, scoring on a 0-5 scale; the paper does not report agreement between the reviewer and human judgments.
    • Hardware is a single NVIDIA A100 80GB, batch size 32; the paper does not report results on multiple GPUs or under higher concurrency.
  6. Summarize the main content of the paper

    SWIFT embeds LLM watermarking into the vLLM inference pipeline for co-serving, achieving on C4 a trade-off of utility 4.87, detection 99.65%, and latency 0.905s.

    A paper on an LLM watermarking system aimed at practical deployment: the authors argue that separating the watermarking algorithm from the inference engine is the root of the deployment gap, and that watermarking should be designed as part of the inference engine.

    • Problem: existing watermarking mostly relies on external NLP tools or auxiliary models in an add-on pipeline, which increases latency and GPU memory and cannot use inference optimizations such as asynchronous generation, KV-cache reuse, and scheduling.
    • Method: SWIFT asynchronously co-serves text generation and watermark construction on the same vLLM engine, the same LLM, and the same GPU; it submits watermark requests by sentence segment, shares the LLM for instruction-guided candidate generation and protects named entities, embeds watermarks using key-conditioned Tournament selection; an adaptive scheduler adjusts the watermark admission ratio every 5 steps according to queue length and waiting time; detection uses a RoBERTa key-conditioned contrastive detector.
    • Main results (C4, Gemma-3-27B-IT): utility 4.87 (GPT-5.5 review, 0-5), detection rate 99.65%, latency 0.905s; the authors state latency is about 5.9 times lower than SafeSeal (5.34s), and detection rate is higher than SynthID's 76.65%.
    • Robustness: detection rate 97.7% after Substitution attack, 61.3% after Dipper; SIRA reduces detection rate to 26.4%, but the attack output win rate is only 0.145 and it takes 8.933s.
    • Generalization: no drop in task accuracy on GSM8K and MedMCQA (93.2%, 62.6%); detection rate with the correct key across three LLMs is 99.2-99.7%, and near zero with the wrong key.
    • Conclusion and implications (in the authors' voice): the authors state that jointly considering watermark quality and inference system design can simultaneously improve utility, detectability, and serving efficiency; limitations are that watermark quality depends on the shared LLM's capability, KV reuse for segment suffixes is unsolved, and output is streamed at the sentence-segment level; future plans are to improve streaming granularity and cache reuse.

Related papers

Show 3 more papers
Read originalarxiv.org