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, Lijie Wen, Irwin King, Philip S. Yu

Abstract

As Large Language Models (LLMs) proliferate, the need to distinguish AI-generated content from human-written text has become critical. While statistical watermarking is a leading technique, its effectiveness is significantly diminished when small AI-generated "needles" are hidden within large human-authored "haystacks"—a challenge termed the "dilution effect." Current state-of-the-art methods for segment detection are computationally prohibitive, often scaling quadratically with document length. This paper introduces WaterSeeker, a coarse-to-fine framework that utilizes a "locate-then-detect" strategy. WaterSeeker achieves detection accuracy comparable to exhaustive search methods while providing up to a 1,000x speedup, reducing processing time for large documents from minutes to seconds.

1. Introduction

Watermarking has emerged as a primary defense against the misuse of LLMs, involving the embedding of subtle statistical signals into generated text. However, the practical application of watermarking faces a significant hurdle: the "dilution effect." In real-world scenarios, AI-generated text is rarely presented in isolation; instead, it is often interspersed with human-written content. Standard detectors, which average statistical signals across an entire document, often fail to identify these localized segments because the human-written text "washes out" the watermark signal.

While recent algorithms like WinMax have attempted to solve this by checking every possible window size, their $O(N^2)$ computational complexity makes them impractical for long documents. For a 10,000-token report, such methods can take nearly 30 minutes to process a single sample. WaterSeeker addresses this bottleneck by introducing an efficient, scalable approach to segment detection.

2. The WaterSeeker Framework

WaterSeeker moves away from exhaustive searching in favor of a coarse-to-fine approach, mirroring the human process of skimming for keywords before performing a close reading.

2.1 Suspicious Region Localization (Coarse Stage)

The first stage involves a fast, linear-time ($O(N)$) pass to identify potential areas of interest. Instead of calculating complex statistics for every possible window, WaterSeeker generates a "score list" using a small sliding window to smooth out local noise. It then identifies "spikes" in watermark intensity that deviate significantly from the document's mean. This step effectively filters out the vast majority of the human-written "haystack."

2.2 Local Traverse Detection (Fine Stage)

Once a suspicious region is flagged, the algorithm performs a precise "local traversal." It examines window boundaries only within the identified area to find the exact start and end points that maximize statistical significance. The authors provide a mathematical proof that the "Gold Index"—the point of highest detection confidence—occurs exactly when the detection window aligns with the actual boundaries of the watermarked segment.

By narrowing the search space early, the total complexity is reduced to $O(N + W^2)$, where $W$ is the size of the suspicious window. This allows the system to scale linearly with document length.

3. Experimental Evaluation

The researchers evaluated WaterSeeker against prominent benchmarks, including WinMax and Fixed-Length Sliding Window (FLSW) methods.

  • Datasets: Prompts were sourced from the C4 dataset, with background "natural" text drawn from Wikipedia passages of 10,000 tokens.
  • Models: Text generation was performed using Llama-2-7b and Mistral-7b.
  • Watermarking Schemes: The framework was tested against the KGW (green/red vocabulary lists) and Aar (pseudo-random sequences and Gumbel noise) families of watermarking.

4. Key Results and Insights

The experimental results demonstrate that WaterSeeker provides a transformative improvement in efficiency without sacrificing detection quality.

  • Massive Speedup: On a 10,000-token document, WinMax-1 required approximately 1,632 seconds (~27 minutes) per sample. In contrast, WaterSeeker completed the same task in just 1.75 seconds.
  • High Accuracy: WaterSeeker maintained an F1 score of 0.872, nearly identical to WinMax-1’s 0.885, proving that the coarse-to-fine heuristic does not significantly degrade performance.
  • Superior Localization: Using the Intersection over Union (IoU) metric, WaterSeeker proved highly accurate at pinpointing the exact start and end of AI segments, outperforming fixed-length window methods by a wide margin. It also naturally identifies multiple distinct AI-generated segments within the same document.
  • Robustness to Edit Attacks: The paper shows that even if an attacker deletes or substitutes words within the AI segment to try and "break" the watermark, WaterSeeker’s smoothing and localization steps remain highly effective.

5. Limitations and Future Work

Despite its advantages, WaterSeeker faces challenges common to statistical detection. It struggles with extremely short AI segments (e.g., under 50 tokens) or very low watermark strengths, where the signal is indistinguishable from random noise. Additionally, the performance is sensitive to the anomaly detection threshold; setting this threshold too low can increase false positives in diverse or "noisy" text environments.

Future research may explore the integration of semantic analysis or advanced change-point detection algorithms to further refine the localization process and improve sensitivity to shorter snippets.

6. Conclusion

WaterSeeker represents a significant step forward in making AI watermark detection practical for real-world applications. By reducing the computational complexity from quadratic to effectively linear, it enables the rapid scanning of large documents for embedded AI content, providing a scalable tool for content moderation and digital forensics.

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: 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