Generated texts from large language models (LLMs) are remarkably close to high-quality human-authored text, raising concerns about their potential misuse in spreading false information and academic misconduct. Consequently, there is an urgent need for a highly practical detection tool capable of accurately identifying the source of a given text. However, existing detection tools typically rely on access to LLMs and can only differentiate between machine-generated and human-authored text, failing to meet the requirements of fine-grained tracing, intermediary judgment, and rapid detection. Therefore, we propose LLMDet, a model-specific, secure, efficient, and extendable detection tool, that can source text from specific LLMs, such as GPT-2, OPT, LLaMA, and others. In LLMDet, we record the next-token probabilities of salient n-grams as features to calculate proxy perplexity for each LLM. By jointly analyzing the proxy perplexities of LLMs, we can determine the source of the generated text. Experimental results show that LLMDet yields impressive detection performance while ensuring speed and security, achieving 98.54% precision and x5.0 faster for recognizing human-authored text. Additionally, LLMDet can effortlessly extend its detection capabilities to a new open-source model. We will provide an open-source tool at https://github.com/TrustedLLM/LLMDet.
翻译:大语言模型(LLM)生成的文本与高质量人类撰写文本极为接近,引发了对它们在传播虚假信息和学术不端行为中潜在滥用的担忧。因此,迫切需要一种高度实用的检测工具,能够准确识别给定文本的来源。然而,现有检测工具通常依赖于访问LLM,且仅能区分机器生成文本与人类撰写文本,无法满足细粒度溯源、中介判断和快速检测的需求。为此,我们提出LLMDet——一种模型特定、安全、高效且可扩展的检测工具,能够对GPT-2、OPT、LLaMA等特定LLM生成的文本进行溯源。在LLMDet中,我们记录显著n元组的下一词概率作为特征,为每个LLM计算代理困惑度。通过联合分析各LLM的代理困惑度,可确定生成文本的来源。实验结果表明,LLMDet在保证检测速度和安全性的同时取得了优异性能,对人类撰写文本的识别精度达98.54%,检测速度提升5.0倍。此外,LLMDet可轻松扩展其检测能力至新的开源模型。我们将在https://github.com/TrustedLLM/LLMDet 提供开源工具。