用频域分析识别大模型文本,速度快且无需训练。
SpecDetect: Simple, Fast, and Training-Free Detection of LLM-Generated Text via Spectral Analysis
- 通过傅里叶变换分析词元概率序列的频谱特性,发现人类写作波动更大。
- 仅用全局DFT总能量作为特征,检测准确率超越现有方法。
- 算法高效可解释,适合需要快速部署的场景。
大语言模型生成的高质量文本泛滥,亟需可靠高效的检测方法。现有无训练方法多依赖表面统计特征,忽视文本生成过程的本质信号属性。本文将检测重构为信号处理问题,提出基于频域分析的新范式:利用全局离散傅里叶变换(DFT)和局部短时傅里叶变换(STFT)系统分析词元对数概率序列的谱特性。实验发现,人类写作文本的谱能量显著高于大模型生成文本,反映其更强的幅度波动性。据此构建SpecDetect,核心特征为全局DFT总能量;进一步提出SpecDetect++,引入采样偏差机制增强鲁棒性。大量实验证明,该方法在近乎一半时间内优于当前最优模型,展示了经典信号处理技术在现代文本检测中的强大潜力。
原文摘要 · Abstract (English)
The proliferation of high-quality text from Large Language Models (LLMs) demands reliable and efficient detection methods. While existing training-free approaches show promise, they often rely on surface-level statistics and overlook fundamental signal properties of the text generation process. In this work, we reframe detection as a signal processing problem, introducing a novel paradigm that analyzes the sequence of token log-probabilities in the frequency domain. By systematically analyzing the signal's spectral properties using the global Discrete Fourier Transform (DFT) and the local Short-Time Fourier Transform (STFT), we find that human-written text consistently exhibits significantly higher spectral energy. This higher energy reflects the larger-amplitude fluctuations inherent in human writing compared to the suppressed dynamics of LLM-generated text. Based on this key insight, we construct SpecDetect, a detector built on a single, robust feature from the global DFT: DFT total energy. We also propose an enhanced version, SpecDetect++, which incorporates a sampling discrepancy mechanism to further boost robustness. Extensive experiments show that our approach outperforms the state-of-the-art model while running in nearly half the time. Our work introduces a new, efficient, and interpretable pathway for LLM-generated text detection, showing that classical signal processing techniques offer a surprisingly powerful solution to this modern challenge.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。