Group-Adaptive Threshold Optimization for Robust AI-Generated Text Detection

Minseok Jung, Cynthia Fuertes Panizo, Liam Dugan, Yi R., Fung, Pin-Yu Chen, Paul Pu Liang

TL;DR

Standard AI text detectors use a single, fixed threshold to classify content, which inadvertently introduces severe biases against specific writing styles and shorter text lengths. This paper introduces FairOPT, a post-processing algorithm that learns group-specific decision thresholds to mitigate these disparities. Across nine different detectors, FairOPT reduces fairness discrepancies by an average of 27.4% while incurring a negligible (<0.1%) sacrifice in overall accuracy.

What Problem Does This Paper Address?

As large language models (LLMs) proliferate, distinguishing human-written text from machine-generated prose has become a critical challenge for academic integrity, cybersecurity, and misinformation moderation. Most current AI text detectors output a probability score and apply a universal global threshold (typically $\theta = 0.5$) to make a binary classification.

However, this one-size-fits-all approach ignores the natural heterogeneity of text. The probability distributions of detector scores shift dramatically depending on structural and stylistic attributes like document length, formality, and writing style. For instance, short human-written texts are systematically flagged as AI-generated far more often than longer pieces. Relying on a single global threshold creates systemic biases, disproportionately penalizing certain subgroups of human writers.

Methods

The authors propose FairOPT (Group-Adaptive Threshold Optimization), a post-hoc, model-agnostic framework that calibrates distinct decision boundaries for predefined subgroups without requiring the underlying detectors to be retrained.

Figure 1. Using a single probability threshold (often θ = 0.5) for AI text classification ignores subgroup-specific score distributions (e.g., by length or style), increasing error rates for certain demo- graphics. We propose FairOPT, which learns subgroup-specific decision thresholds that reduce these disparities (Figure 2) while incurring negligible drop in accuracy (Figure 3).

The core methodology consists of:

  1. Subgroup Partitioning: Data is split into subgroups based on text length and stylistic features.
  2. Minimax Optimization: Instead of optimizing for average fairness, FairOPT formulates a minimax objective to minimize the maximum inter-group discrepancy across five complementary fairness metrics: Demographic Parity (DP), Balanced Error Rate (BER), Equalized Odds (EO), False Positive Rate (FPR), and Predictive Parity (PP).
  3. Relaxed Fairness Criterion: To navigate the classic performance-fairness trade-off, the algorithm implements a relaxed 80% fairness rule. This ensures that the ratio of the minimum to maximum fairness metric value across subgroups does not fall below a flexibility parameter ($\tau = 0.8$).
  4. Gradient-Based Updates: Thresholds are iteratively optimized using a finite-difference approximation of the gradient to penalize low accuracy and insufficient F1 scores within each subgroup.

Datasets

The authors evaluated FairOPT using a balanced corpus of 19,117 training instances and 4,779 test samples compiled from three prominent benchmarks:

  • RAID: A shared benchmark for robust evaluation of machine-generated text detectors.
  • MAGE: Machine-generated text detection in the wild.
  • SemEval24: Multi-generator, multi-domain, and multi-lingual black-box machine-generated text detection.

The corpus spans diverse domains (Reddit, Wikipedia, arXiv, Yelp, WikiHow) and features text generated by multiple LLMs (including GPT and Text-Davinci variants). Subgroups were engineered using four specific attributes: text length (character count), writing style (inferred Big Five personality traits via a BERT classifier), formality score, and sentiment polarity.

Key Insights and Ideas

  • The Short-Text Penalty: Exploratory data analysis confirmed that short human-authored texts exhibit significantly elevated false positive rates under static thresholding. The detector's probability distributions vary fundamentally by length, making a single threshold inherently unfair.
  • Post-Hoc Efficiency: FairOPT demonstrates that fairness disparities can be resolved entirely at the post-inference stage. This eliminates the need for computationally expensive retraining or fine-tuning of massive language models or detector architectures.
  • Bypassing Global Trade-offs: Traditional threshold optimization techniques (like ROC-based methods) optimize globally but often exacerbate subgroup tail-end risks. Group-adaptive thresholding successfully decouples these groups to optimize boundaries independently.

Key Results

  • Substantial Disparity Mitigation: FairOPT reduced the average classification discrepancy across five key fairness metrics to $\mu = 0.613$, significantly outperforming the static threshold baseline ($\mu = 0.887$) and ROC-based optimization ($\mu = 0.920$).
Figure 2. FairOPT decreases overall discrepancy of AI detectors compared to other thresholding methods. FairOPT reduces average classification discrepancy of five fairness metrics to µ = 0.613, outperforming ROCFPR (µ = 0.920) and Static (µ = 0.887). Each bar shows average of five key fairness metrics that has been introduced in 3.1.4.
  • Preserved Accuracy: The fairness improvements required virtually no sacrifice in predictive performance. FairOPT achieved an overall accuracy of 63.41%, which is nearly identical to the static threshold's 63.76% (a marginal relative drop of just 0.35%).
  • Consistent Across Architectures: The framework proved robust across nine distinct open- and closed-source detectors. Notably, it achieved an 85% reduction in discrepancy for E5LoRA and meaningfully improved closed-source models like GPT4o-mini and GPT4.1-nano.

Limitations and Future Work

  • Language Scope: The current evaluation was restricted exclusively to English-language datasets and detectors. Performance on multi-lingual or code-switched text remains unexamined.
  • Modality Expansion: While evaluated on text, FairOPT is fundamentally modality-agnostic. The authors highlight the extension of this framework to image, video, and audio deepfake detection as a promising future direction.
  • Real-World Deployment: Future work will require user-centered case studies to validate how these adaptive thresholds hold up in live, practical environments like automated content moderation pipelines or classroom settings.

Summary updated

BibTeX
@misc{jung2025group,
  author = {Minseok Jung and Cynthia Fuertes Panizo and Liam Dugan and Yi R. and Fung and Pin-Yu Chen and Paul Pu Liang},
  title = {{Group-Adaptive Threshold Optimization for Robust AI-Generated Text Detection}},
  year = {2025},
  eprint = {2502.04528},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.04528},
}
Figure