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

Xin Chen, Junchao Wu, Shu Yang, Runzhe Zhan, Zeyu Wu +5 more
8/18/2025
cs.CLcs.AI

Official code: NLP2CT/RepreGuard (16 stars, last commit 2026-01-27). 1 more implementation below.

Abstract

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

View on arXivView PDF

Code Implementations(2)

NLP2CT/RepreGuardOfficial100%

[TACL 2025] RepreGuard: Detecting LLM-Generated Text by Revealing Hidden Representation Patterns

161Shell, PythonAug 14, 20258 months ago
MIT

[TACL 2025] RepreGuard: Detecting LLM-Generated Text by Revealing Hidden Representation Patterns

112Shell, PythonAug 13, 20255 months agoMIT

Cite this paper

@article{chen2025repreguard,
  title  = {RepreGuard: Detecting LLM-Generated Text by Revealing Hidden Representation Patterns},
  author = {Xin Chen and Junchao Wu and Shu Yang and Runzhe Zhan and Zeyu Wu and Ziyang Luo and Di Wang and Min Yang and Lidia S. Chao and Derek F. Wong},
  year   = {2025},
  eprint = {2508.13152},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.13152v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2508.13152.svg)](https://codeofpaper.com/paper/2508.13152)

Discussion