Table of Contents
Fetching ...

Learn-to-Distance: Distance Learning for Detecting LLM-Generated Text

Hongyi Zhou, Jin Zhu, Erhan Xu, Kai Ye, Ying Yang, Chengchun Shi

TL;DR

The paper tackles the challenge of detecting LLM-generated text by proposing a rewrite-based detector that adaptively learns the distance between original and rewritten text. A geometric framework shows why rewrite-based reconstruction distances separate human and LLM text and why the approach generalizes to unseen prompts; the paper formalizes this with propositions and an adaptive distance formulation. Empirically, it achieves state-of-the-art performance across 24 datasets, 7 target LLMs, and unseen prompts, with substantial gains over fixed-distance rewritedetectors and strong robustness to adversarial attacks. While the method is computationally intensive, the results indicate meaningful potential for reliable, prompt-robust LLM-detection in real-world settings and offer avenues for efficiency improvements and broader applicability.

Abstract

Modern large language models (LLMs) such as GPT, Claude, and Gemini have transformed the way we learn, work, and communicate. Yet, their ability to produce highly human-like text raises serious concerns about misinformation and academic integrity, making it an urgent need for reliable algorithms to detect LLM-generated content. In this paper, we start by presenting a geometric approach to demystify rewrite-based detection algorithms, revealing their underlying rationale and demonstrating their generalization ability. Building on this insight, we introduce a novel rewrite-based detection algorithm that adaptively learns the distance between the original and rewritten text. Theoretically, we demonstrate that employing an adaptively learned distance function is more effective for detection than using a fixed distance. Empirically, we conduct extensive experiments with over 100 settings, and find that our approach demonstrates superior performance over baseline algorithms in the majority of scenarios. In particular, it achieves relative improvements from 57.8\% to 80.6\% over the strongest baseline across different target LLMs (e.g., GPT, Claude, and Gemini).

Learn-to-Distance: Distance Learning for Detecting LLM-Generated Text

TL;DR

The paper tackles the challenge of detecting LLM-generated text by proposing a rewrite-based detector that adaptively learns the distance between original and rewritten text. A geometric framework shows why rewrite-based reconstruction distances separate human and LLM text and why the approach generalizes to unseen prompts; the paper formalizes this with propositions and an adaptive distance formulation. Empirically, it achieves state-of-the-art performance across 24 datasets, 7 target LLMs, and unseen prompts, with substantial gains over fixed-distance rewritedetectors and strong robustness to adversarial attacks. While the method is computationally intensive, the results indicate meaningful potential for reliable, prompt-robust LLM-detection in real-world settings and offer avenues for efficiency improvements and broader applicability.

Abstract

Modern large language models (LLMs) such as GPT, Claude, and Gemini have transformed the way we learn, work, and communicate. Yet, their ability to produce highly human-like text raises serious concerns about misinformation and academic integrity, making it an urgent need for reliable algorithms to detect LLM-generated content. In this paper, we start by presenting a geometric approach to demystify rewrite-based detection algorithms, revealing their underlying rationale and demonstrating their generalization ability. Building on this insight, we introduce a novel rewrite-based detection algorithm that adaptively learns the distance between the original and rewritten text. Theoretically, we demonstrate that employing an adaptively learned distance function is more effective for detection than using a fixed distance. Empirically, we conduct extensive experiments with over 100 settings, and find that our approach demonstrates superior performance over baseline algorithms in the majority of scenarios. In particular, it achieves relative improvements from 57.8\% to 80.6\% over the strongest baseline across different target LLMs (e.g., GPT, Claude, and Gemini).
Paper Structure (19 sections, 3 theorems, 22 equations, 6 figures, 9 tables)

This paper contains 19 sections, 3 theorems, 22 equations, 6 figures, 9 tables.

Key Result

Proposition 1

Under Assumptions ass:textspace, ass:q=proj_p and ass:rewrite, we have with equality if and only if $p$ is supported on $\mathcal{M}$.

Figures (6)

  • Figure 1: The rationale behind rewrite-based methods: the brown dot represents a human-authored text after embedding, while the two green dots represent its projection onto the LLM subspace and an LLM-generated text produced from an unobserved prompt, respectively. From left to right, the purple dots denote the reconstructions of the first green dot, the brown dot and the second green dot. As illustrated, $d_1 > d_2$, indicating that the reconstruction error for human text is larger than that for LLM-generated text, which aligns with Proposition \ref{['prop:rewrite-gap']}. Additionally, $d_1 > d_3$ suggests that rewrite-based methods remain robust to prompt-induced distribution shifts, as formalized in Proposition \ref{['prop:promptrobust']}.
  • Figure 2: Histograms comparing the statistics constructed by Fast-DetectGPT (a state-of-the-art logits-based detector) and the reconstruction errors of rewrite-based methods between human-written and LLM-rewritten news text. The first two panels show that Fast-DetectGPT effectively distinguishes human- from LLM-authored text only when the prompt to produce LLM-generated text is known. The last two panels show that the proposed learned distance provides a much clearer separation than using a fixed distance.
  • Figure 3: Workflow of the proposal. Our method adaptively learn a distance metric to measure the discrepancy between human and LLM-generated texts for detection.
  • Figure 4: AUCs of ImBD, RAIDAR and our approach under paraphrasing (top panels) and decoherence (bottom panels). Each column represents a dataset. For each method, two bars are plotted: the lighter one indicates AUC without attack, and the darker one indicates AUC under attack. The best method under attack is highlighted with a bold bar edge, and its AUC value is displayed above the bar.
  • Figure B1: AUC, runtime for training, and memory usage during training when $K$ increases.
  • ...and 1 more figures

Theorems & Definitions (3)

  • Proposition 1
  • Proposition 2
  • Proposition 3