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 tackles the challenge of detecting watermarked segments embedded in long documents by introducing a coarse-to-fine, two-stage pipeline that first localizes suspicious regions and then performs targeted full-text watermark verification. The method is grounded in a theoretical Gold Index framework showing that maximizing the z-score occurs when the window size matches the ground-truth segment length, guiding a low-complexity localization step followed by precise local detection. Empirical results show WaterSeeker significantly outperforms full-text detectors and operates with far lower runtime than WinMax, while achieving comparable localization accuracy and robustness to text edits. The work contributes a practical detector for segment-level watermarking with localization, enabling more interpretable AI detection in real-world document workloads and laying groundwork for scalable, transparent detection systems.
Abstract
Watermarking algorithms for large language models (LLMs) have attained high accuracy in detecting LLM-generated text. However, existing methods primarily focus on distinguishing fully watermarked text from non-watermarked text, overlooking real-world scenarios where LLMs generate only small sections within large documents. In this scenario, balancing time complexity and detection performance poses significant challenges. This paper presents WaterSeeker, a novel approach to efficiently detect and locate watermarked segments amid extensive natural text. It first applies an efficient anomaly extraction method to preliminarily locate suspicious watermarked regions. Following this, it conducts a local traversal and performs full-text detection for more precise verification. Theoretical analysis and experimental results demonstrate that WaterSeeker achieves a superior balance between detection accuracy and computational efficiency. Moreover, its localization capability lays the foundation for building interpretable AI detection systems. Our code is available at https://github.com/THU-BPM/WaterSeeker.
