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

WaterSeeker: Pioneering Efficient Detection of Watermarked Segments in Large Documents

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

TL;DR

WaterSeeker is a new framework designed to find small snippets of AI-generated, watermarked text hidden within large human-written documents. By employing a "first locate, then detect" strategy, it achieves near-optimal detection accuracy while being up to 1,000 times faster than previous state-of-the-art methods.

What Problem Does This Paper Address?

As Large Language Models (LLMs) become ubiquitous, watermarking—embedding a hidden statistical signal during text generation—has emerged as a key tool for identifying AI-generated content. However, most existing detectors assume a "binary" scenario: the entire document is either AI-generated or human-written.

In the real world, people often "copy-paste" small AI-generated segments into much larger human-written reports or articles. Standard detectors fail here due to the dilution effect: the strong statistical signal of a small watermarked segment gets "washed out" when averaged across a massive document. While the previous state-of-the-art algorithm, WinMax, solves this by checking every possible window size, its computational complexity is $O(N^2)$. For a document with tens of thousands of tokens, WinMax becomes prohibitively slow.

Methods

WaterSeeker introduces a coarse-to-fine approach that matches the theoretical lower bound for time complexity, $O(N)$. The process works in two main stages:

  1. Suspicious Region Localization (Coarse): Instead of checking every window, WaterSeeker uses a fast anomaly extraction algorithm inspired by plagiarism detection. It computes a smoothed "score list" using a small sliding window and identifies outliers where the watermark intensity significantly deviates from the document's mean. This narrows the search area from the entire document to a few small, suspicious segments.
  2. Local Traverse Detection (Fine): Once a suspicious region is identified, the algorithm performs a precise traversal within that specific area to find the exact boundaries (the "gold index") that maximize the watermark signal.
Figure 1: While full-text detection methods effectively differentiate between fully watermarked and non- watermarked texts, they often struggle with watermarked segment detection due to the dilution effect. To address this, WaterSeeker employs a "first locate, then detect" strategy, which narrows the detection range before conducting local traversal for further verification.

Datasets

The authors evaluated WaterSeeker using four custom-built datasets based on the C4 dataset (for prompts) and Wikipedia (for background text). They generated watermarked segments using Llama-2-7b and Mistral-7b across three strength levels for two major watermarking families:

  • KGW: A "red-green list" based approach.
  • Aar: A pseudo-random sequence based approach.

Each dataset contained 600 examples (300 positive, 300 negative), where positive examples had a 100–400 token watermarked segment inserted into a 10,000-token Wikipedia passage.

Key Insights and Ideas

  • The Gold Index: Theoretical analysis shows that a watermark's statistical significance (z-score) peaks exactly when the detection window matches the start and end of the watermarked segment.
  • Dilution is the Enemy: Figure 1 illustrates how full-text detection fails because the "non-watermarked" parts of a document act as noise that drowns out the signal.
  • Complexity Breakthrough: By moving from an exhaustive search ($O(N^2)$) to an anomaly-driven search ($O(N)$), the authors make watermark detection practical for long-form content like books or long legal documents.
  • Multi-Segment Handling: Unlike WinMax, which is designed to find the single "best" window, WaterSeeker's localization step naturally allows it to detect multiple disconnected AI-generated segments within the same document.

Key Results

  • Efficiency: WaterSeeker is significantly faster than WinMax. For a 10,000-token document, WaterSeeker processed samples in roughly 1.75 seconds, whereas the most accurate version of WinMax took over 1,600 seconds (a ~1000x speedup).
  • Accuracy: Despite the speedup, WaterSeeker maintains high performance. In KGW tests, it achieved an F1 score of 0.872, very close to WinMax-1’s 0.885.
  • Robustness: The system remains effective even if the text is edited. It maintained an F1 score above 0.9 against attacks involving 30% word deletion or substitution.
  • Scalability: As document length ($N$) increases, WaterSeeker’s time cost grows linearly, while WinMax’s cost grows quadratically, as shown in the comparison below.
Comparison of F1 score and time cost. WaterSeeker (red star) sits in the "sweet spot" of high accuracy and low time cost.

Limitations and Future Work

  • Model Generalization: The study focused on 7B parameter models (Llama-2 and Mistral). The authors note that effectiveness on larger, more sophisticated models still needs verification.
  • Short/Weak Watermarks: WaterSeeker's sensitivity may decrease if the AI-generated segment is extremely short (e.g., a single sentence) or if the watermark strength is very low.
  • Hyperparameter Tuning: The algorithm relies on threshold settings to control false positives. Finding the perfect threshold for different document types and environments remains a challenge.
  • Future Directions: The authors suggest exploring more advanced localization methods, perhaps using neural networks, to further improve detection of subtle AI interventions.

Summary updated

BibTeX
@inproceedings{pan2025waterseeker,
  author = {Leyi Pan and Aiwei Liu and Yijian Lu and Zitian Gao and Yichen Di and Shiyu Huang and Lijie Wen and Irwin King and Philip S. Yu},
  title = {{WaterSeeker: Pioneering 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