Table of Contents
Fetching ...

Beyond Raw Detection Scores: Markov-Informed Calibration for Boosting Machine-Generated Text Detection

Chenwang Wu, Yiu-ming Cheung, Shuhai Zhang, Bo Han, Defu Lian

TL;DR

This work tackles the instability of token-level detection scores in metric-based machine-generated text detectors by revealing two context-score relationships: Neighbor Similarity and Initial Instability. It introduces a Markov Random Field–based score calibration, implemented via a light-weight mean-field inference, that can be stacked on top of existing detectors to produce calibrated token scores and a more discriminative final decision. The method demonstrates substantial, consistent gains across cross-LLM, cross-domain, mixed-text, and paraphrase scenarios with minimal computational overhead, and it generalizes better than NN-based calibrations while remaining compatible with a wide range of detectors. The approach offers a practical, extensible framework for robust MGT detection and highlights the value of modeling token-level dependencies in generation processes.

Abstract

While machine-generated texts (MGTs) offer great convenience, they also pose risks such as disinformation and phishing, highlighting the need for reliable detection. Metric-based methods, which extract statistically distinguishable features of MGTs, are often more practical than complex model-based methods that are prone to overfitting. Given their diverse designs, we first place representative metric-based methods within a unified framework, enabling a clear assessment of their advantages and limitations. Our analysis identifies a core challenge across these methods: the token-level detection score is easily biased by the inherent randomness of the MGTs generation process. To address this, we theoretically and empirically reveal two relationships of context detection scores that may aid calibration: Neighbor Similarity and Initial Instability. We then propose a Markov-informed score calibration strategy that models these relationships using Markov random fields, and implements it as a lightweight component via a mean-field approximation, allowing our method to be seamlessly integrated into existing detectors. Extensive experiments in various real-world scenarios, such as cross-LLM and paraphrasing attacks, demonstrate significant gains over baselines with negligible computational overhead. The code is available at https://github.com/tmlr-group/MRF_Calibration.

Beyond Raw Detection Scores: Markov-Informed Calibration for Boosting Machine-Generated Text Detection

TL;DR

This work tackles the instability of token-level detection scores in metric-based machine-generated text detectors by revealing two context-score relationships: Neighbor Similarity and Initial Instability. It introduces a Markov Random Field–based score calibration, implemented via a light-weight mean-field inference, that can be stacked on top of existing detectors to produce calibrated token scores and a more discriminative final decision. The method demonstrates substantial, consistent gains across cross-LLM, cross-domain, mixed-text, and paraphrase scenarios with minimal computational overhead, and it generalizes better than NN-based calibrations while remaining compatible with a wide range of detectors. The approach offers a practical, extensible framework for robust MGT detection and highlights the value of modeling token-level dependencies in generation processes.

Abstract

While machine-generated texts (MGTs) offer great convenience, they also pose risks such as disinformation and phishing, highlighting the need for reliable detection. Metric-based methods, which extract statistically distinguishable features of MGTs, are often more practical than complex model-based methods that are prone to overfitting. Given their diverse designs, we first place representative metric-based methods within a unified framework, enabling a clear assessment of their advantages and limitations. Our analysis identifies a core challenge across these methods: the token-level detection score is easily biased by the inherent randomness of the MGTs generation process. To address this, we theoretically and empirically reveal two relationships of context detection scores that may aid calibration: Neighbor Similarity and Initial Instability. We then propose a Markov-informed score calibration strategy that models these relationships using Markov random fields, and implements it as a lightweight component via a mean-field approximation, allowing our method to be seamlessly integrated into existing detectors. Extensive experiments in various real-world scenarios, such as cross-LLM and paraphrasing attacks, demonstrate significant gains over baselines with negligible computational overhead. The code is available at https://github.com/tmlr-group/MRF_Calibration.
Paper Structure (42 sections, 4 theorems, 29 equations, 35 figures, 24 tables, 1 algorithm)

This paper contains 42 sections, 4 theorems, 29 equations, 35 figures, 24 tables, 1 algorithm.

Key Result

Theorem 1

Let $\lambda_K, \lambda_Q, \lambda_V, \lambda_O$ be the largest singular values of parameters $W_K, W_Q, W_V, W_O$, respectively, and let $W=W_V W_O W_Q W_K^{\top}$. For the transformer defined in Eq. (eq: simplified_model), assuming normalized inputs ($\left\|x_t\right\|_2=1$ for all $t$) and const where

Figures (35)

  • Figure 1: Distribution of token scores obtained by the DetectGPT method without and with score calibration in the Essay dataset. The proposed calibration method enhances the discriminative nature of the token scores.
  • Figure 2: The detection score distances (Mean Absolute Difference) of neighbors at different hops in the Essay dataset. Log-likelihood and Log-Rank score are used.
  • Figure 3: The detection score distances (Mean Absolute Difference) of 1-hop neighbors at different normalized relative positions in Essay. Log-likelihood and Log-Rank score are used.
  • Figure 4: The performance improvement of the proposed method on Likelihood and Log-Rank. Values greater than 0 indicate an enhanced effect.
  • Figure 5: Detection performance concerning AUROC under different LLM mixed texts. All detectors are trained on Llama-2-70b texts.
  • ...and 30 more figures

Theorems & Definitions (5)

  • Theorem 1
  • Theorem
  • proof
  • Lemma 2: liu2023scissorhands
  • Lemma 3: liu2023scissorhands