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 x3.5 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.
翻译:大语言模型生成的文本与高质量人类撰写的文本极为相似,这引发了人们对它们可能被滥用于传播虚假信息和学术不端行为的担忧。因此,迫切需要一种高度实用的检测工具,能够准确识别给定文本的来源。然而,现有的检测工具通常依赖于对大语言模型的访问,并且只能区分机器生成文本与人类撰写的文本,无法满足细粒度溯源、中间判断和快速检测的需求。为此,我们提出了LLMDet,一种模型特定、安全、高效且可扩展的检测工具,能够对来自特定大语言模型(如GPT-2、OPT、LLaMA等)的文本进行溯源。在LLMDet中,我们记录显著n-gram的下一词元概率作为特征,为每个大语言模型计算代理困惑度。通过联合分析各模型的代理困惑度,我们可以确定生成文本的来源。实验结果表明,LLMDet在保证速度和安全性的前提下展现了出色的检测性能,在识别人类撰写文本时达到了98.54%的精确率,速度提升了3.5倍。此外,LLMDet能够轻松将其检测能力扩展到新的开源模型。我们将在https://github.com/TrustedLLM/LLMDet 提供开源工具。