Table of Contents
Fetching ...

Detecting LLM-Generated Text with Performance Guarantees

Hongyi Zhou, Jin Zhu, Ying Yang, Chengchun Shi

TL;DR

This paper tackles the challenge of detecting LLM-generated text with performance guarantees without relying on watermarks or model-specific information. It introduces a flexible, model-agnostic statistic $S(\bm{X})$ learned from a large, diverse dataset and fine-tuned using LoRA to maximize AUC, while providing statistically calibrated thresholds via empirical nulls for valid inference. Across eight domains, the detector achieves near-perfect AUC and controlled type-I error, and it demonstrates robustness to distribution shifts in the RAID benchmark. A public web interface showcases practical deployment and continual updating to adapt to evolving LLMs, highlighting the method’s scalability and real-world impact.

Abstract

Large language models (LLMs) such as GPT, Claude, Gemini, and Grok have been deeply integrated into our daily life. They now support a wide range of tasks -- from dialogue and email drafting to assisting with teaching and coding, serving as search engines, and much more. However, their ability to produce highly human-like text raises serious concerns, including the spread of fake news, the generation of misleading governmental reports, and academic misconduct. To address this practical problem, we train a classifier to determine whether a piece of text is authored by an LLM or a human. Our detector is deployed on an online CPU-based platform https://huggingface.co/spaces/stats-powered-ai/StatDetectLLM, and contains three novelties over existing detectors: (i) it does not rely on auxiliary information, such as watermarks or knowledge of the specific LLM used to generate the text; (ii) it more effectively distinguishes between human- and LLM-authored text; and (iii) it enables statistical inference, which is largely absent in the current literature. Empirically, our classifier achieves higher classification accuracy compared to existing detectors, while maintaining type-I error control, high statistical power, and computational efficiency.

Detecting LLM-Generated Text with Performance Guarantees

TL;DR

This paper tackles the challenge of detecting LLM-generated text with performance guarantees without relying on watermarks or model-specific information. It introduces a flexible, model-agnostic statistic learned from a large, diverse dataset and fine-tuned using LoRA to maximize AUC, while providing statistically calibrated thresholds via empirical nulls for valid inference. Across eight domains, the detector achieves near-perfect AUC and controlled type-I error, and it demonstrates robustness to distribution shifts in the RAID benchmark. A public web interface showcases practical deployment and continual updating to adapt to evolving LLMs, highlighting the method’s scalability and real-world impact.

Abstract

Large language models (LLMs) such as GPT, Claude, Gemini, and Grok have been deeply integrated into our daily life. They now support a wide range of tasks -- from dialogue and email drafting to assisting with teaching and coding, serving as search engines, and much more. However, their ability to produce highly human-like text raises serious concerns, including the spread of fake news, the generation of misleading governmental reports, and academic misconduct. To address this practical problem, we train a classifier to determine whether a piece of text is authored by an LLM or a human. Our detector is deployed on an online CPU-based platform https://huggingface.co/spaces/stats-powered-ai/StatDetectLLM, and contains three novelties over existing detectors: (i) it does not rely on auxiliary information, such as watermarks or knowledge of the specific LLM used to generate the text; (ii) it more effectively distinguishes between human- and LLM-authored text; and (iii) it enables statistical inference, which is largely absent in the current literature. Empirically, our classifier achieves higher classification accuracy compared to existing detectors, while maintaining type-I error control, high statistical power, and computational efficiency.
Paper Structure (29 sections, 5 theorems, 32 equations, 12 figures, 5 tables)

This paper contains 29 sections, 5 theorems, 32 equations, 12 figures, 5 tables.

Key Result

Theorem 1

Suppose the sampling model $\mathcal{S}$ is the same to the scoring model (i.e., the target model $\mathcal{M}$). Then as the temperature parameter $\tau\to 0^+$, we have where $\mathbb{Q}^{\mathcal{M}}$ denotes the probability distribution of text generated by the target model $\mathcal{M}$.

Figures (12)

  • Figure 1: Visualizations of three types of existing detectors (statistics-based, ML-based, watermarking-based) along with our proposed detector.
  • Figure 2: Website interface for our detector: users can enter text in the shaded area labeled “Paste your text here,” select the domain of the text (e.g., finance, law; by default, general), choose a significance lever $\alpha$, and click “Detect.” The detector then produce an output (see Figure \ref{['fig:website-bottom']}). If not specified, the significance level is set to $0.05$.
  • Figure 3: Histograms of the Fast-DetectGPT statistic evaluated on human-authored text and text generated by various LLMs, taken from bao2024fastdetectgpt.
  • Figure 4: Boxplots of the number of words in human-written texts for each domain in the collected dataset.
  • Figure 5: AUCs of various detectors when trained and evaluated on the eight domains of data described in Section \ref{['sec:data']}. Each panel reports the AUC for one domain. The right bottom panel reports the average AUC across the eight domains.
  • ...and 7 more figures

Theorems & Definitions (7)

  • Theorem 1
  • Theorem 2
  • Theorem 3
  • Lemma 1
  • proof
  • Lemma 2
  • proof