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.
翻译:大型语言模型(LLM)的水印算法在检测LLM生成文本方面已达到较高准确率。然而,现有方法主要侧重于区分完全水印文本与非水印文本,忽视了现实场景中LLM仅在大型文档内部生成小段文本的情况。在此场景下,平衡时间复杂度和检测性能构成了重大挑战。本文提出WaterSeeker,一种在大量自然文本中高效检测并定位水印片段的新方法。该方法首先应用高效异常提取技术初步定位可疑水印区域,随后进行局部遍历并执行全文检测以实现更精确的验证。理论分析与实验结果表明,WaterSeeker在检测精度与计算效率之间实现了更优的平衡。此外,其定位能力为构建可解释的AI检测系统奠定了基础。我们的代码公开于https://github.com/THU-BPM/WaterSeeker。