NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

WaterSeeker: Efficient Detection of Watermarked Segments in Large Documents

Leyi Pan, Aiwei Liu, Yijian Lu, Zitian Gao, Yichen Di, Lijie Wen, Irwin King, Philip S. Yu · DOI

TL;DR

This paper introduces WaterSeeker, a novel "locate then detect" approach for efficiently identifying small segments of LLM-generated text within large documents. It achieves a superior balance between detection accuracy and computational efficiency, outperforming existing methods by a significant margin, especially in real-world scenarios where watermarked text is diluted.

What Problem Does This Paper Address?

Large language models (LLMs) are increasingly used to generate text, raising concerns about misinformation and copyright. Watermarking is a technique to embed hidden signals into LLM-generated text for detection. However, current watermark detection methods are primarily designed for scenarios where the entire document is watermarked. They struggle when LLMs generate only small segments within much larger, naturally written documents. This "dilution effect" makes it difficult to accurately detect and locate these watermarked portions without incurring prohibitive computational costs. The paper addresses this challenge by proposing an efficient method to find these subtly embedded watermarks in extensive documents.

Methods

WaterSeeker employs a two-stage "coarse-to-fine" strategy:

  1. Suspicious Region Localization (Coarse Step): This stage uses a low-complexity anomaly extraction method to identify potential regions containing watermarks. It involves:
  2. Score List Computation: Calculating watermark scores for individual tokens and then smoothing them using a small sliding window (W=50).
  3. Anomaly Extraction: Identifying "outlier" scores that deviate significantly from the norm, using a combination of mean and top-k mean scores.
  4. Fragment Connection: Connecting adjacent outlier segments and filtering out very short ones to form initial candidate regions. This step is designed to ensure that the identified regions likely cover the true watermarked segments with minimal deviation.
  5. Local Traverse Detection (Fine Step): Once suspicious regions are identified, a more precise full-text detection is performed within these localized areas. The algorithm examines segments around the predicted start and end points and selects the highest confidence result to determine if a watermark is present.

This approach aims to narrow down the search space significantly before applying more computationally intensive detection, thereby improving efficiency.

Datasets

The paper uses the C4 dataset for generating prompts to create watermarked text. For evaluation, they construct four specific datasets: KGW-Llama, KGW-Mistral, Aar-Llama, and Aar-Mistral. These datasets consist of 10,000-token Wikipedia passages with either a single watermarked segment inserted or multiple segments. Negative examples are unmodified Wikipedia passages.

Key Insights and Ideas

  • Dilution is the Enemy: The core problem is that existing methods fail when watermarked text is a small fraction of a large document. WaterSeeker directly tackles this "dilution effect."
  • "Locate then Detect" is Key: The two-stage approach is crucial. First, efficiently finding where to look, then performing accurate detection within that narrowed scope. This is more efficient than scanning the entire document exhaustively.
  • Anomaly Detection for Localization: Using statistical anomalies in watermark scores is an effective way to pinpoint potential watermark locations, even when the signal is weak.
  • Theoretical Lower Bound Achieved: WaterSeeker's O(N) time complexity matches the theoretical lower bound for this problem, meaning it's as efficient as possible in terms of processing time.
  • Robustness Beyond Detection: The localization capability of WaterSeeker is highlighted as a foundation for building more interpretable AI detection systems.

Key Results

  • Superior Efficiency: WaterSeeker achieves a time complexity of O(N), significantly outperforming methods like WinMax (O(N^2)) and matching the theoretical lower bound. It offers a time saving of up to 1000 times compared to WinMax.
  • Balanced Performance: WaterSeeker demonstrates a better balance between detection performance (F1 score, IoU) and time cost compared to WinMax, as visualized in Figure 3(a).
  • High Accuracy: WaterSeeker achieves competitive detection performance (F1 scores often above 0.8) and localization accuracy (IoU around 0.6-0.7) across various watermark strengths and document lengths.
  • Robustness: The method shows strong robustness against text edit attacks (word deletion and substitution), maintaining high F1 scores.
  • Effectiveness on Multiple Segments: Unlike WinMax, WaterSeeker can effectively handle documents with multiple watermarked segments.

Limitations and Future Work

  • Model and Watermark Strength: The current evaluation is primarily on Llama-2-7B and Mistral-7B models. Future work could verify effectiveness on larger, more powerful models. Performance might decrease with very short or weak watermarks, suggesting a need to enhance sensitivity for such cases.
  • Parameter Tuning: Parameter selection, especially threshold settings, is crucial and can be challenging. Stricter thresholds might reduce detection rates, requiring careful adjustment based on specific needs.
  • Advanced Localization: The authors suggest exploring more advanced localization methods to potentially further improve detection results.

Summary updated

BibTeX
@inproceedings{pan2025waterseeker,
  author = {Leyi Pan and Aiwei Liu and Yijian Lu and Zitian Gao and Yichen Di and Lijie Wen and Irwin King and Philip S. Yu},
  title = {{WaterSeeker: Efficient Detection of Watermarked Segments in Large Documents}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.156},
}
Figure