Skip to content

A Smoothing Attack Against Watermarks for Language ModelsWatermark Smoothing Attacks against Language Models

arXiv· arXiv:2407.14206· Hongyan Chang, Hamed Hassani, Reza ShokriNational University of Singapore; University of PennsylvaniaIndexed by this site · 27 days ago· Originally publishedAttacks

Quick read

Attacks

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

The authors propose the Smoothing Attack, which uses model confidence to selectively replace tokens to remove watermarks; on 10 watermarks and OPT/Llama3/Qwen2, TPR often drops to 0–5%.

Threat modelThe attacker cannot access the original unwatermarked model and can only obtain, through the API of the target watermarked model, the top-K (e.g., 1, 5, 10) most likely tokens and their probabilities at each position; when attacking distortionary watermarks, the attacker can query a much smaller reference model; no knowledge of the watermark scheme's details is required.

Questions
Text watermarks are used to identify AI-generated content, but the authors argue that there is an inherent tension between watermark detectability and text quality, and that both are related to the model's confidence during generation, an association that may be exploited to remove watermarks.
Methods
Proposes the Smoothing Attack: uses the top-K probabilities returned by the API to estimate the model's confidence at each position; when confidence is low (where watermark traces mainly reside), replaces that token by sampling from a reference model or resampling from the watermarked model; when confidence is high, keeps the original output.
Experiments and results
Evaluated on 10 watermarks and OPT (1.3B–30B), Llama3-8B, Qwen2-1.5B, Smoothing reduces the detection TPR of most watermarks to about 5% or even 0%, with PPL better than the Paraphrasing Attack using GPT-3.5-turbo; worse PPL under the Gumbel watermark is an exception.
Limitations and future work
The authors note that restricting top-K probability access could serve as a defense but is difficult to implement in practice, and state that watermarking schemes robust to attacks exploiting confidence information are needed. The experiments cover only open-source models and the C4 dataset, with 100 prompts per condition, and do not report the number of repetitions or statistical tests.
Experimental setupOPT-1.3B、OPT-2.7B et al. · C4 · TPR、PPL et al.
Evaluated models
OPT-1.3BOPT-2.7BOPT-6.7BOPT-13BOPT-30BLlama3-8BQwen2-1.5B
Benchmarks
C4
Metrics
TPRPPLDiversityP-SP
AI summaryResearchers propose a watermark removal method called the smoothing attack, which can erase watermark traces while maintaining text quality. The method exploits the relationship between model confidence and watermark detectability to selectively smooth watermarked content. The authors validated the attack on open-source models with 1.3B to 30B parameters and on 10 watermarks, and point out that existing watermarking schemes have key weaknesses and require stronger defenses.

Researchers propose a watermark removal method called the smoothing attack, which can erase watermark traces while maintaining text quality. The method exploits the relationship between model confidence and watermark detectability to selectively smooth watermarked content. The authors validated the attack on open-source models with 1.3B to 30B parameters and on 10 watermarks, and point out that existing watermarking schemes have key weaknesses and require stronger defenses.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors propose a Smoothing Attack that uses model confidence to remove text watermarks, and note that there is a tension between detectability and text quality.

    Core question: can existing language model text watermarks be removed at low cost while maintaining text quality.

    • Scenario and importance: watermarks are a key technology for detecting AI-generated text, used for fraud detection, fake news identification, and plagiarism prevention, and are regarded in both academia and industry as an important safeguard for language model applications (Section 1).
    • Shortcomings of existing methods: the authors state that common watermark removal methods (injecting special characters, homoglyphs, emoji) noticeably degrade text quality; the effectiveness of the Paraphrasing Attack depends on the capability of the paraphrasing model used, typically requiring a large model such as GPT-3.5-turbo (Section 2).
    • Core observation: the authors' analysis finds a tension between watermark detectability and text quality—better quality often means lower detectability, and vice versa; both are linked through the model's confidence in the output token (kPt k2): when confidence is high, the watermark has little effect on the output and traces are weak; when confidence is low, watermark traces are strong but quality degrades (Section 3).
    • Method proposed in the paper: Smoothing Attack—estimate the watermarked model's confidence at each position; when confidence is low, replace that token (for distortionary watermarks, sample from a reference model; for distortion-free watermarks, resample from the watermarked model); when confidence is high, keep the original output (Section 4).
    • Threat model:
      • Goal: generate high-quality text that evades watermark detection for any input prompt.
      • Knowledge: no access to the original unwatermarked model; no need to know the details of the watermarking scheme.
      • Capability: obtain the top-K (K a small constant, e.g., 1, 5, 10) most likely tokens and their probabilities at each position via the API of the target watermarked model; when attacking distortionary watermarks, can query a small reference model (e.g., OPT-125M).
      • Victim system: open-source language models with embedded watermarks (OPT 1.3B–30B, Llama3-8B, Qwen2-1.5B) and their watermark detectors.
  2. What related research exists?

    Related work covers three types of watermarking schemes and two types of removal attacks; this paper uses the Paraphrasing Attack with GPT-3.5-turbo as the baseline.

    Watermark schemes (attack targets)

    • Green-red list (distortionary): Proposed by Kirchenbauer et al. [12], it divides the vocabulary into red and green lists and adds δ to the logits of green-list tokens, distorting the output distribution; variants (Unigram [37], SWEET [16], UPV [17], EWD [38], X-SIR [41], etc.) differ mainly in green-list allocation and the detection process (Section 2, Appendix A).
    • Gumbel sampling (distortion-free): [13, 1] embed the watermark using Gumbel sampling, preserving the original model distribution in expectation.
    • Tournament sampling (distortion-free): Dathathri et al. [5] (SynthID) select tokens via a tournament process; the paper notes that its original implementation is costly and adopts an equivalent sampling method with its improved distribution (Appendix A).

    Watermark removal attacks

    • Character perturbation type: Injecting special characters, homoglyphs, or emoji to break the watermark pattern [25–29]; the paper notes that such modifications often noticeably degrade text quality.
    • Paraphrasing Attack: [15, 30–34] rewrite watermarked text with another model; the paper notes that its effectiveness depends on the capability of the rewriting model, e.g., using GPT-3.5-turbo to rewrite text generated by 7B Llama.

    Baselines and benchmark

    • Baseline: The Paraphrasing Attack using GPT-3.5-turbo to rewrite text (denoted P-GPT3.5), which the paper calls the strongest watermark removal attack [32]; the rewriting prompt is "Please rewrite the following text:" (Appendix B.1).
    • Benchmark: The C4 dataset [40], taking the first 30 tokens of each text as the prompt and generating the following 200 tokens, averaged over 100 prompts; watermark implementations are based on the MarkLLM toolkit [39].

    Positioning of this paper: The authors state that, compared with the Paraphrasing Attack, the Smoothing Attack uses a much smaller reference model (e.g., OPT-125M) yet achieves a higher watermark removal rate and comparable text quality, showing that resource-limited attackers can also defeat watermarks (Appendix A).

  3. How does the paper address this problem?

    First establish the association between "confidence—watermark traces—text quality," then use it to decide position by position whether to keep or replace tokens.

    Overall approach: first analyze the relationship among watermark detectability, text quality, and model confidence (Section 3), then based on this design the Smoothing Attack, replacing tokens at low-confidence positions to erase watermark traces (Section 4).

    Analysis: confidence links detectability and quality

    • Token-level watermark contribution: for the Green-red list watermark, define St = Ev∼P̃t[1{v∈ Gt}] − Ev∼ Pt[1{v∈ Gt}], i.e., the per-position detection score increment brought by the watermark; the larger St, the higher the detectability. The authors derive that St is a function of Ev∼ Pt[1{v∈ Gt}], and verify this with 400 sampling points on OPT-1.3B (Figure 1 left).
    • Relation to confidence: the authors state that the variance of Ev∼ Pt[1{v∈ Gt}] is proportional to kPt k2 (the squared L2 norm of the probability vector), so the higher the confidence, the smaller St; the same negative correlation is observed for Gumbel and Tournament watermarks (Figure 1 right, Figure 2).
    • Quality impact: the negative impact of the watermark on quality is measured by total variation distance DTV(Pt, P̃t) = 1/2∑v∈ V|Pt(v)−P̃t(v)| (empirically estimated by sampling 100 tokens per distribution); the authors state that DT V decreases as kPt k2 increases, and that at low confidence, switching to sampling from the reference model OPT-125M yields comparable or even better quality (Figure 3); DT V is positively correlated with St (Figure 4).

    Confidence estimation (with only top-K access)

    • distortion-free watermarks: the top-K probabilities are unmodified, so kPt k2 is estimated directly from the observed probabilities, assuming the remaining probability mass is uniformly distributed over the unobserved |V|−K tokens.
    • distortionary watermarks: first estimate kPet k2 from the top-K probabilities of the modified Pet, then multiply by the coefficient β = ((1−γ)+γeδ)²/((1−γ)+γe2δ) to convert to the original model's kPt k2 (derivation in Appendix C.2, C.3).
    • Normalization: sample kPt k2 with N=200 random prefixes, take the maximum and minimum as upper bound U and lower bound L, divide [L, U] into 100 buckets, and if the estimate falls in the i-th bucket, the confidence score is c = i/100.

    Attack procedure

    1. Per-position decision: estimate the confidence score c at each token position; α > 0 is a constant controlling the degree of smoothing.
    2. distortion-free watermarks: keep the watermarked model's output token with probability cα, and replace it by resampling according to the observed top-K probabilities with probability 1−cα.
    3. distortionary watermarks: query the reference model with the same prefix to obtain its top-K probabilities, construct a weighted distribution with weights cα (watermarked model) and 1−cα (reference model), and sample from it.
    4. Role of parameters: a large α tends to keep the original token, a small α tends to replace; K is the number of top-K probabilities accessible to the attacker.

    Applicability and cost

    • No watermark details needed: the attack does not require knowledge of the specific watermarking scheme and relies only on confidence estimation.
    • Computational cost: the authors state that the main cost is estimating the normalization bounds U and L, which can be done with a few hundred queries to the watermarked model; the paper does not report specific numbers of queries or time cost.
  4. What experiments did the paper conduct?

    Comparing Smoothing and Paraphrasing on 10 watermarks and 3 model families, in most cases TPR drops to about 5% or even 0%.

    Experimental setup

    • Models tested: Llama3.1-8B, OPT family (1.3B, 2.7B, 6.7B, 13B, 30B), Qwen2-1.5B; the main table (Table 1) uses OPT-1.3B, Llama3-8B, Qwen2-1.5B.
    • Reference models: when attacking distortionary watermarks, Llama3-1B, OPT-125M, Qwen2-0.5B are used respectively.
    • Watermark algorithms: 10 in total—KGW, Unigram, UPV, X-SIR, DIP, SWEET, EWD, Unbiased, SynthID, Gumbel—implemented based on MarkLLM; Gumbel and X-SIR are evaluated only on OPT models (Gumbel requires over 100 GB of GPU memory on Qwen/Llama, and the official X-SIR code does not support them).
    • Baseline: Paraphrasing Attack using GPT-3.5-turbo to paraphrase text (P-GPT3.5).
    • Data and metrics: C4 dataset, first 30 tokens as prompt, 200 tokens generated, averaged over 100 prompts; metrics are TPR (at FPR < 1%, lower is better for the attack), PPL (lower is better quality), Diversity (log diversity, higher is better); PPL is computed by OPT-2.7B, Llama3-8B, Qwen2-7B respectively.
    • Default parameters: α = 1.0, K = 10; the paper does not report the number of repetitions.

    Main results

    According to Table 1 (FPR < 1%, TPR in %):

    Swipe horizontally to read the table

    WatermarkAttackOPT-1.3B TPR / PPLLlama3-8B TPR / PPLQwen2-1.5B TPR / PPL
    KGWParaphrasing / Smoothing3 / 14.82 — 0 / 9.572 / 5.35 — 2 / 3.202 / 10.45 — 0 / 8.02
    UnigramParaphrasing / Smoothing53 / 14.51 — 5 / 9.4454 / 5.60 — 24 / 3.105 / 10.40 — 1 / 7.77
    SynthIDParaphrasing / Smoothing1 / 10.57 — 0 / 10.401 / 5.62 — 0 / 3.401 / 6.90 — 0 / 10.21
    DIPParaphrasing / Smoothing0 / 13.95 — 6 / 9.340 / 5.25 — 6 / 3.172 / 10.10 — 11 / 7.62
    UnbiasedParaphrasing / Smoothing3 / 14.45 — 27 / 9.192 / 5.36 — 5 / 3.171 / 9.97 — 5 / 7.68
    UPVParaphrasing / Smoothing34 / 13.73 — 20 / 10.012 / 5.43 — 1 / 3.122 / 9.03 — 0 / 8.16
    EWDParaphrasing / Smoothing0 / 14.95 — 0 / 9.937 / 5.73 — 3 / 3.131 / 10.18 — 0 / 7.82
    SWEETParaphrasing / Smoothing0 / 14.57 — 0 / 9.5914 / 5.64 — 4 / 3.094 / 10.18 — 0 / 7.85

    Without attack, the TPR of each watermark is 83–100% (Table 1); Table 2 (OPT-1.3B): under the Gumbel watermark, Smoothing's TPR is 9% (Paraphrasing is 13%), and under X-SIR it is 9% (Paraphrasing is 34%).

    • Authors' interpretation: the authors state that Smoothing reduces TPR to about 5% or even 0% in most cases, and that TPR is better than Paraphrasing, while the reference models used (e.g., OPT-125M) are far smaller than GPT-3.5-turbo.
    • Exceptions: in cells such as Unbiased on OPT-1.3B (27% vs. 3%) and DIP (6% vs. 0%), and DIP on Qwen2-1.5B (11% vs. 2%), Smoothing's TPR is higher than Paraphrasing; for Llama3-8B+KGW both are 2%.
    • Quality: the authors state that Smoothing's PPL is lower than Paraphrasing and even lower than unwatermarked text (because it samples only from the top-K), but Diversity is slightly lower than Paraphrasing due to the restricted candidate tokens.

    Quality exception under the Gumbel watermark

    • Observation: on OPT-1.3B, the Gumbel watermark without attack has PPL 2.96, which rises to 19.25 after Smoothing (Table 2).
    • Authors' explanation: Gumbel sampling tends to output repetitive content, and repetition lowers PPL but also reduces diversity; Table 9 in Appendix B.5 gives text examples, and the authors state that the text generated by Smoothing is better than that of the watermarked model.

    Ablations: K, α, and model scale

    • Effect of K (Table 3, OPT-1.3B+Unigram, α=1): at K=1, TPR 18%, PPL 3.21; at K=10, TPR 5%, PPL 9.44; at K=15, TPR 5%, PPL 11.73. The authors state that increasing K worsens PPL but improves diversity, and that the attack remains effective at K=1.
    • Effect of α (Table 3, K=10): at α=0.5, TPR 42%; at α=2.0, TPR 0%; at α=3.0, TPR 1%. The authors state that increasing α lowers TPR and improves PPL, but may reduce diversity.
    • Model scale (Table 10, Appendix B.6): on OPT 1.3B–30B with the reference model fixed to OPT-125M, the authors state that model scale has a negligible effect on attack effectiveness, e.g., X-SIR's TPR rises from 13% at 1.3B to 16% at 30B.

    Other analyses

    • P-SP similarity (Figure 8, OPT-1.3B): the P-SP between watermarked and unwatermarked text is 53.6 (Unigram), while that between watermarked and paraphrased text reaches 82.3; the authors consider that P-SP may not be a reliable metric for evaluating quality degradation caused by watermarks or smoothing.
    • Quality box plots (Figure 6, 7, OPT-1.3B): the authors state that Smoothing's PPL is generally lower than that of the watermarked model (except Gumbel), and diversity is somewhat lower due to the restricted top-K.
  5. What are some points that can be further explored?

    The authors state that defenses restricting probability access are difficult to implement, and future watermarking schemes need to resist confidence-estimation attacks.

    Limitations and future directions noted by the authors

    • Defenses are hard to implement (Appendix D): restricting access to confidence-related information (e.g., returning only the most likely token without probabilities) is a possible defense, but the authors consider it difficult to enforce in practice—many LLM services (e.g., the OpenAI API returns top 20 token probabilities) already provide enough information to estimate confidence, and probability information is valuable for transparency, debugging, interpretability, etc.
    • Implications for watermarking schemes (Appendix D): the authors state that existing watermarking techniques may be fragile when model confidence can be estimated, and future research should explore watermarking schemes that explicitly account for model confidence and remain robust to adversarial attacks that exploit confidence information.
    • Preconditions for the attack to be effective (Appendix D): the authors note that as long as the probability of the most likely token is available, the attack remains effective.

    Experimental coverage

    • Models tested: OPT family 1.3B–30B, Llama3-8B, Qwen2-1.5B, all open-source models; the main results table (Table 1) covers 3 of them.
    • Watermark coverage: 10 algorithms, of which Gumbel and X-SIR are evaluated only on OPT models (the paper states the reason is memory requirements and official code support).
    • Data and scale: only the C4 dataset, 100 prompts per condition, 200 tokens generated; the paper does not report the number of repetitions or statistical significance tests.
    • Attack parameters: default α=1.0, K=10; ablations cover K ∈ {1,3,5,7,10,15} and α ∈ {0.5,1,2,3} (Table 3, 5–8).
    • Baseline: compared only with the Paraphrasing Attack using GPT-3.5-turbo; the paper does not report the specific number of queries or time cost of the attack.
  6. Summarize the main content of the paper

    The Smoothing Attack uses model confidence to locate and replace tokens containing watermark traces; it is effective on 10 watermarks and costs less than paraphrasing attacks.

    A paper on a removal attack against language model text watermarks; its core claim is that there is a tension between watermark detectability and text quality, and that both are connected by model confidence and can be exploited by attackers.

    • Problem: Watermarks are widely used to identify AI-generated text; existing removal methods either harm text quality (character perturbation) or rely on large-model rewriting (Paraphrasing Attack).
    • Analysis findings: The authors derive and empirically verify (OPT-1.3B, Figure 1–4): the higher the model confidence kPt k2, the smaller the contribution St of a single token to the detection score and the smaller the distortion DT V the watermark imposes on quality; low-confidence tokens simultaneously carry watermark traces and quality loss, and even replacing them with sampling from a small reference model does not hurt quality much.
    • Method: Smoothing Attack estimates confidence c solely from the top-K probabilities returned by the API, keeps the original token with probability cα and otherwise replaces it (reference model for distortionary watermarks, resampling for distortion-free watermarks), with defaults α=1.0, K=10.
    • Main results: On C4, under a 100-prompt setting, for 8 watermarks on OPT-1.3B/Llama3-8B/Qwen2-1.5B and for Gumbel and X-SIR on OPT, Smoothing reduces most TPRs to about 5% or even 0% (Table 1, 2); on OPT-1.3B+Unigram, TPR 5% versus 53% for Paraphrasing, PPL 9.44 versus 14.51; the reference model is only OPT-125M.
    • Exceptions: Under the Gumbel watermark, Smoothing's PPL rises from 2.96 to 19.25 (the authors attribute this to the repetitiveness of Gumbel outputs); in a few cells (e.g., OPT-1.3B+Unbiased) TPR is higher than Paraphrasing.
    • Authors' conclusion: Existing watermarks may be fragile when confidence can be estimated, are hard to enforce in defensive practice that restricts probability access, and stronger watermark schemes that resist such attacks are needed.

Related papers

Show 3 more papers
Read originalarxiv.org