Multiscale Positive-Unlabeled Detection of AI-Generated Texts

Yuchuan Tian, Hanting Chen, Xutao Wang, Zheyuan Bai, Qinghua Zhang, Ruifeng Li, Chao Xu, Yunhe Wang

TL;DR

The Multiscale Positive-Unlabeled (MPU) framework addresses the notorious failure of AI-text detectors on short snippets like tweets and reviews. By rephrasing detection as a "Positive-Unlabeled" problem—treating short machine texts as ambiguous rather than definitively "fake"—and using a length-sensitive loss function, the authors significantly boost accuracy on short texts without sacrificing performance on long-form content.

What Problem Does This Paper Address?

As Large Language Models (LLMs) like ChatGPT become more sophisticated, distinguishing between human and machine-generated text is critical for maintaining information authenticity. However, existing detectors have a major blind spot: text length.

While long articles often contain statistical "tells" that reveal their AI origin, short texts (e.g., SMS, social media posts) are often indistinguishable from human writing. For example, a simple factual statement like "Independence Day is celebrated on July 4th" could be generated by either a human or an AI, making a binary "Real vs. Fake" label technically correct but practically useless for training. Most current detectors either fail on these short samples or simply refuse to process them by setting a minimum character limit.

Methods

The authors introduce two primary innovations to bridge this gap:

  1. Partial Positive-Unlabeled (PU) Learning: Instead of standard binary classification, they model the task as a PU problem. In this context, human text is "Positive," but short AI text is treated as "Unlabeled" because it lacks distinct features. This prevents the model from being forced to find non-existent patterns in ambiguous short AI snippets, which typically leads to overfitting and poor generalization.
  2. Length-Sensitive Multiscale PU Loss: They recognize that the "prior probability" ($\pi$) of a text being human changes with its length. They develop a recurrent model abstraction to automatically adjust this prior based on the number of tokens. As text gets shorter, the model treats the AI-generated samples as increasingly "unlabeled."
  3. Text Multiscaling Module: To ensure the model sees enough variety during training, they use a "random sentence deletion" strategy. This creates a diverse range of text lengths from long-form paragraphs, forcing the detector to learn features across multiple scales.

Datasets

The researchers evaluated their method on several key benchmarks:

  • TweepFake: A dataset of real and AI-generated tweets.
  • HC3 (Human ChatGPT Comparison Corpus): A dataset containing both English and Chinese samples.
  • HC3-Sent: A sentence-level variant of HC3 specifically designed to test short-text detection.

Key Insights and Ideas

  • The "Unlabeled" Property: The core "aha" moment is realizing that short AI text isn't just "fake"—it's ambiguous. Treating it as a definitive negative sample in a binary classifier actually harms the model's ability to learn.
  • Prior Probability is Dynamic: Most PU learning assumes a constant prior, but in text, the likelihood of a sample being indistinguishable from human writing is a function of its length.
  • Dataset Flaws: The authors discovered a significant flaw in the popular HC3 benchmark: human samples contained extra spaces before punctuation that AI samples did not. A simple rule-based detector looking for these spaces could achieve an 82.12% F1 score, potentially misleading researchers about their models' actual linguistic understanding.
Example 1 shows distinguishable short text, while Example 2 shows indistinguishable text that justifies the PU approach.

Key Results

The MPU framework consistently outperformed state-of-the-art baselines, particularly on short-form content:

  • TweepFake: RoBERTa trained with MPU achieved 91.4% accuracy, outperforming specialized stylometric detectors.
  • HC3-English: On sentence-level detection (HC3-En-Sent), MPU boosted the F1 score of RoBERTa from 58.60% to 85.31%, a massive improvement.
  • Cross-Lingual Success: The method proved effective in Chinese as well, reaching an F1 of 89.37% on short texts compared to the baseline's 83.07%.
Table 4 highlights the dramatic improvement MPU provides on short-text (HC3-En-Sent) compared to standard finetuning and zero-shot methods.

Ablation studies (shown in Table 7) confirmed that both the Multiscaling module and the MPU loss are necessary; using only one often leads to a performance trade-off between long and short texts.

Table 7 shows that the combination of Text Multiscaling and MPU loss provides the best balance across both full-length and sentence-level benchmarks.

Limitations and Future Work

  • Attribution Risks: The authors warn that while performance is high, detectors can still make mistakes. They recommend these tools be used as references rather than absolute arbiters, especially in sensitive contexts like plagiarism or fake news detection.
  • Dataset Cleaning: The discovery of the "space flaw" in HC3 suggests that existing benchmarks need more rigorous cleaning to ensure models are learning semantic features rather than just formatting quirks.
  • Generative Evolution: As LLMs continue to evolve to better mimic human nuances, the "unlabeled" boundary will likely shift, requiring continuous updates to the PU priors.

Summary updated

Abstract

Recent releases of Large Language Models (LLMs), e.g. ChatGPT, are astonishing at generating human-like texts, but they may impact the authenticity of texts. Previous works proposed methods to detect these AI-generated texts, including simple ML classifiers, pretrained-model-based zero-shot methods, and finetuned language classification models. However, mainstream detectors always fail on short texts, like SMSes, Tweets, and reviews. In this paper, a Multiscale Positive-Unlabeled (MPU) training framework is proposed to address the difficulty of short-text detection without sacrificing long-texts. Firstly, we acknowledge the human-resemblance property of short machine texts, and rephrase AI text detection as a partial Positive-Unlabeled (PU) problem by regarding these short machine texts as partially ``unlabeled". Then in this PU context, we propose the length-sensitive Multiscale PU Loss, where a recurrent model in abstraction is used to estimate positive priors of scale-variant corpora. Additionally, we introduce a Text Multiscaling module to enrich training corpora. Experiments show that our MPU method augments detection performance on long AI-generated texts, and significantly improves short-text detection of language model detectors. Language Models trained with MPU could outcompete existing detectors on various short-text and long-text detection benchmarks. The codes are available at https://github.com/mindspore-lab/mindone/tree/master/examples/detect_chatgpt and https://github.com/YuchuanTian/AIGC_text_detector.
BibTeX
@inproceedings{tian2024multiscale,
  author = {Yuchuan Tian and Hanting Chen and Xutao Wang and Zheyuan Bai and Qinghua Zhang and Ruifeng Li and Chao Xu and Yunhe Wang},
  title = {{Multiscale Positive-Unlabeled Detection of AI-Generated Texts}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=5Lp6qU9hzV},
}
Figure