RepreGuard: Detecting LLM-Generated Text by Revealing Hidden Representation Patterns

📄 arXiv: 2508.13152v1 📥 PDF

作者: Xin Chen, Junchao Wu, Shu Yang, Runzhe Zhan, Zeyu Wu, Ziyang Luo, Di Wang, Min Yang, Lidia S. Chao, Derek F. Wong

分类: cs.CL, cs.AI

发布日期: 2025-08-18

备注: Accepted to TACL 2025. This version is a pre-MIT Press publication version

🔗 代码/项目: GITHUB


💡 一句话要点

提出RepreGuard以解决LLM生成文本检测的鲁棒性问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 文本检测 大型语言模型 内部表示 神经激活 统计特征 鲁棒性 内容审核 虚假信息

📋 核心要点

  1. 现有的LLM生成文本检测方法在分布外场景中的鲁棒性不足,难以有效区分生成文本与人类文本。
  2. 本文提出RepreGuard,通过收集LLM的内部表示,提取独特的激活特征来识别LLM生成文本。
  3. 实验结果显示,RepreGuard在多种场景下表现优异,平均AUROC达到94.92%,显著优于现有方法。

📝 摘要(中文)

检测大型语言模型(LLMs)生成的内容对于防止滥用和构建可信的人工智能系统至关重要。尽管现有检测方法表现良好,但在分布外(OOD)场景中的鲁棒性仍然不足。本文假设,与现有检测方法使用的特征相比,LLMs的内部表示包含更全面和原始的特征,能够更有效地捕捉和区分LLM生成文本(LGT)与人类撰写文本(HWT)之间的统计模式差异。我们在不同的LLMs上验证了这一假设,观察到处理这两种文本时神经激活模式存在显著差异。基于此,我们提出了RepreGuard,一种高效的基于统计的检测方法。实验结果表明,RepreGuard在分布内(ID)和分布外(OOD)场景中均优于所有基线,平均AUROC达到94.92%,同时在各种文本大小和主流攻击下表现出良好的鲁棒性。

🔬 方法详解

问题定义:本文旨在解决现有LLM生成文本检测方法在分布外场景中的鲁棒性不足问题。现有方法主要依赖于表面特征,难以捕捉深层次的统计模式差异。

核心思路:我们假设LLMs的内部表示包含更丰富的特征,能够更有效地区分LGT与HWT。通过分析神经激活模式,我们提取出能够有效识别LGT的特征。

技术框架:RepreGuard的整体架构包括数据收集、特征提取和分类三个主要模块。首先使用代理模型收集LGT和HWT的表示,然后提取激活特征,最后通过计算投影分数进行分类。

关键创新:RepreGuard的主要创新在于利用LLM的内部表示进行文本检测,这一方法与传统基于表面特征的检测方法本质上不同,能够更全面地捕捉文本的统计特征。

关键设计:在设计中,我们设置了特征提取的阈值,并采用了适合的损失函数来优化分类性能。网络结构方面,使用了适配于不同LLM的代理模型,以确保特征提取的有效性。

📊 实验亮点

实验结果表明,RepreGuard在分布内和分布外场景中的平均AUROC达到了94.92%,显著优于所有基线方法,展示了其在不同文本大小和主流攻击下的鲁棒性,验证了其有效性。

🎯 应用场景

RepreGuard的研究成果在多个领域具有潜在应用价值,包括内容审核、虚假信息检测和教育领域的作业检测等。随着LLM技术的不断发展,能够有效识别生成文本的工具将有助于维护信息的真实性和可信度,促进AI系统的安全使用。

📄 摘要(原文)

Detecting content generated by large language models (LLMs) is crucial for preventing misuse and building trustworthy AI systems. Although existing detection methods perform well, their robustness in out-of-distribution (OOD) scenarios is still lacking. In this paper, we hypothesize that, compared to features used by existing detection methods, the internal representations of LLMs contain more comprehensive and raw features that can more effectively capture and distinguish the statistical pattern differences between LLM-generated texts (LGT) and human-written texts (HWT). We validated this hypothesis across different LLMs and observed significant differences in neural activation patterns when processing these two types of texts. Based on this, we propose RepreGuard, an efficient statistics-based detection method. Specifically, we first employ a surrogate model to collect representation of LGT and HWT, and extract the distinct activation feature that can better identify LGT. We can classify the text by calculating the projection score of the text representations along this feature direction and comparing with a precomputed threshold. Experimental results show that RepreGuard outperforms all baselines with average 94.92% AUROC on both in-distribution (ID) and OOD scenarios, while also demonstrating robust resilience to various text sizes and mainstream attacks. Data and code are publicly available at: https://github.com/NLP2CT/RepreGuard