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).
