TL;DR
AdaDetectGPT enhances logits-based LLM text detectors by learning an adaptive "witness function" from training data to transform raw token log-probabilities into a more discriminative space. By framing sequential token generation as a martingale process, the method provides rigorous statistical guarantees on error rates while boosting detection accuracy (AUC) by up to 37% over state-of-the-art baselines.
What Problem Does This Paper Address?
As large language models (LLMs) become increasingly adept at mimicking human writing, the risks of misinformation, academic dishonesty, and eroded trust grow. Consequently, building reliable tools to differentiate between human- and LLM-generated text is a critical challenge.
Existing zero-shot, statistics-based detectors (such as DetectGPT and Fast-DetectGPT) typically analyze the log-probabilities (logits) of tokens under a source LLM. They operate on the empirical observation that machine-generated text tends to yield higher log-probabilities or distinct conditional probability curvatures compared to human text. However, relying purely on raw log-probabilities is sub-optimal; human and machine text distributions often overlap in complex ways that raw logits fail to capture. Furthermore, the field largely lacks systematic statistical analysis, leaving detectors without formal performance guarantees on standard classification metrics like the False Negative Rate (FNR).
Methods
AdaDetectGPT bridges the gap between purely statistics-based and machine learning-based detection. Instead of using raw log-probabilities directly, it introduces a learned, one-dimensional witness function ($w$) that transforms the logits to maximize the separation between human and machine text.
The core methodology consists of two main components:
- Adaptive Learning via TNR Optimization: The authors derive a theoretical lower bound on the True Negative Rate (TNR). AdaDetectGPT learns the witness function by maximizing this lower bound using external training data. By parameterizing the witness function with a B-spline basis, this optimization elegantly reduces to solving a simple system of linear equations.
- FNR Control via Martingale Theory: Because text is generated sequentially, the authors model the token log-probabilities as a time-dependent sequence. By applying the Martingale Central Limit Theorem (MCLT), they prove that the detection statistic asymptotically follows a standard normal distribution when evaluating machine-generated text. This allows users to analytically select a classification threshold that strictly controls the FNR at a pre-specified significance level ($\alpha$).
The method supports both white-box settings (where the detector has full access to the target LLM's logits) and black-box settings (where an open-source surrogate model is used to approximate the hidden target LLM's logits).
Datasets
The authors evaluated AdaDetectGPT across five widely used text datasets, spanning various generation tasks:
- SQuAD: Wikipedia-style question answering.
- WritingPrompts: Creative story generation.
- XSum: Professional news summarization.
- Yelp: Crowd-sourced product and service reviews.
- Essay: High school and university-level student essays.
To simulate a challenging, realistic setup, paragraphs were generated by providing an LLM with the first 120 tokens of a human-written text and letting it complete the passage with up to 200 tokens. The witness function was always trained on two datasets completely distinct from the test dataset to ensure generalization.
Key Insights and Ideas
- The Limitation of Raw Logits: The authors present an analytical "Kingdom of Bit" example showing that if an LLM's token distribution approaches a uniform state, traditional detectors relying on raw log-probabilities fail entirely—regardless of the actual distance between the human and machine distributions. An adaptive witness function bypasses this bottleneck by learning non-linear transformations that expose subtle distributional differences.
- Text as a Martingale: Framing sequential token probabilities as a martingale difference sequence provides a mathematically principled foundation for text detection. It unlocks the power of normal approximations for threshold selection, moving the field away from heuristic threshold tuning.
Key Results
- Superior White-Box Accuracy: AdaDetectGPT consistently achieved the highest Area Under the Curve (AUC) across all combinations of datasets and source models (including GPT-2, OPT, GPT-Neo, GPT-J, LLaMA3, Qwen2.5, and Mistral), outperforming Fast-DetectGPT by 12.5% to 37%.
- Robust Black-Box Detection: When testing against closed-source models like GPT-4o and Claude-3.5-Haiku using an open-source surrogate (Gemma-2-9b), AdaDetectGPT maintained a clear edge, providing AUC improvements of up to 20% generally, and up to 37.8% on the Essay dataset.
- Empirical FNR Control: As predicted by the Martingale CLT, the empirical FNR tightly tracked the target significance level $\alpha$ across multiple datasets and models, proving the reliability of the statistical guarantees in practice.
- High Efficiency: Training the adaptive witness function is incredibly fast, typically taking less than one minute and consuming under 0.5 GB of memory.
Limitations and Future Work
- Sampling Parameter Mismatch: The strict mathematical guarantees assume that the text generation exactly follows the target model's true conditional probabilities. However, real-world LLM deployment often utilizes sampling parameters like temperature tuning or top-$k$/top-$p$ filtering. The authors note that while this mismatch technically invalidates the strict MCLT assumptions, empirically it causes the statistic to shift toward a positive mean, making the FNR control conservative rather than inaccurate.
- Surrogate Quality in Black-Box Settings: In black-box scenarios, the detector's performance remains bounded by how well the open-source surrogate model mirrors the vocabulary and style of the closed-source target model. Future work could explore optimizing surrogate selection or combining multiple surrogates to improve black-box robustness.
Summary updated