Intrinsic Dimension Estimation for Robust Detection of AI-Generated Texts

Eduard Tulchinskii, Kristian Kuznetsov, Laida Kushnareva, Daniil Cherniavskii, Serguei Barannikov, Irina Piontkovskaya, Sergey Nikolenko, Evgeny Burnaev

TL;DR

This paper introduces a novel method for detecting AI-generated text by measuring its "intrinsic dimension" – a geometric property of the text's underlying embedding space. They found that human-written texts consistently have a higher intrinsic dimension than AI-generated texts, allowing for a robust and generalizable detector that outperforms existing methods across various domains and models.

What Problem Does This Paper Address?

As AI language models become increasingly sophisticated, distinguishing between human-written and AI-generated text is becoming a significant challenge. This has implications for various fields, from academic integrity to the spread of misinformation. Existing AI text detection methods often struggle with generalization, performing poorly when faced with new AI models or different text domains than they were trained on. Furthermore, some methods can be vulnerable to adversarial attacks like paraphrasing, and may exhibit biases against non-native speakers. The authors aim to develop a detection method that is robust, generalizable, and less prone to these issues.

Methods

The core of the proposed method lies in estimating the intrinsic dimension (ID) of text samples. The authors represent each text as a collection of token embeddings derived from pre-trained language models (like RoBERTa and XLM-R). They then treat these embeddings as points in a high-dimensional space and analyze the geometric structure of the "manifold" they form.

Specifically, they employ persistent homology dimension (PHD), a technique from topological data analysis. PHD measures the complexity of the underlying shape formed by the data points. The key insight is that human-written texts, with their richer and more varied linguistic structures, tend to form more complex manifolds with higher intrinsic dimensions compared to AI-generated texts, which often exhibit more predictable patterns.

The authors developed an efficient algorithm for computing PHD and used it as a feature for a simple logistic regression classifier. This approach is designed to be model-agnostic, meaning it doesn't require knowledge of the specific AI model that generated the text.

Datasets

The paper utilizes several datasets for training and evaluation:

  • Wiki40b: Used as the primary dataset for human texts.
  • WritingPrompts (Reddit): Used for fiction stories.
  • Stack Exchange: Used for question-answering texts.
  • ChatGPT-generated texts: Generated for 10 languages using GPT3.5-turbo, with prompts derived from Wikipedia headers and first sentences.
  • Wikipedia and Reddit datasets (from Krishna et al., 2023): Used for cross-domain and paraphrase robustness experiments.
  • Data from Liang et al., 2023: Used to assess bias against non-native speakers.
  • TOEFL essays and US College Admission Essays: Used to evaluate non-native speaker bias.

The authors also mention creating a multilingual dataset of GPT-3.5 generations and natural texts for further research.

Key Insights and Ideas

  • Intrinsic Dimension as a Linguistic Fingerprint: The paper reveals that the intrinsic dimension of text embeddings is a surprisingly stable and informative feature that differentiates human and AI-generated text. This suggests a fundamental geometric difference in how LLMs structure language compared to humans.
  • Human Texts are "More Complex" Geometrically: Human writing, across various genres and languages, consistently exhibits a higher intrinsic dimension (around 9-10 for European languages, 7 for Chinese) than AI-generated text (around 1.5 lower). This implies that human language generation explores a larger "space" of possibilities.
  • Robustness to Adversarial Attacks: The PHD-based detector shows remarkable resilience to paraphrasing attacks (like DIPPER), with its performance even slightly improving in some cases, unlike many other detectors that suffer significant drops.
  • Mitigating Bias: The proposed method demonstrates a reduced bias against non-native speakers compared to existing detectors, which often incorrectly flag non-native texts as AI-generated.
  • Model-Agnostic Generalization: The detector's effectiveness is not tied to a specific generator model, making it a powerful tool for detecting text from unknown or future AI systems.

Key Results

  • High Accuracy: The PHD-based detector achieves high accuracy in artificial text detection, outperforming state-of-the-art (SOTA) detectors by a significant margin in model-agnostic and cross-domain scenarios. For instance, it shows a +10% improvement over baselines for GPT-3.5 generations.
  • Cross-Domain and Cross-Model Stability: The detector maintains its performance across different text domains (Wikipedia, Reddit, Stack Exchange) and when tested on text generated by various models (GPT-2, OPT, GPT-3.5), unlike supervised classifiers that fail in cross-domain evaluations.
  • Multilingual Performance: The method works well across 10 different languages, with ROC-AUC scores generally above 0.78 for PHD.
  • Reduced Non-Native Speaker Bias: The detector shows a 2x reduction in false positive rates for non-native English speakers compared to OpenAI and GPTZero.
  • Noise Tolerance: The PHD estimator is shown to be tolerant to noise and performs well even with limited sample sizes, outperforming other ID estimators in noisy settings.

Limitations and Future Work

  • Stochastic Nature: The estimation of PHD is stochastic, meaning results can vary slightly. Rerunning the estimation multiple times can improve stability but increases computation time.
  • "Good" Generators: The current method is most effective for "good" (fluent) generators with low temperature settings. High-temperature or "bad" generators might produce texts with higher ID, requiring recalibration.
  • Low-Resource Languages: The study primarily focused on high-resource languages. Further research is needed to understand how the method transfers to low-resource languages.
  • Short Texts: The method's stability is affected by text length; very short texts can lead to misclassifications or less accurate ID estimations.
  • Rare Tokens/Numbers: Texts with an unusually high number of rare tokens or numbers might be misclassified.

Future work could explore these limitations, investigate the phenomenon of ID varying with language, and further analyze edge cases and failure modes. The authors believe their method offers a promising new tool for fake content detection that is robust and less discriminatory.

Summary updated

Abstract

Rapidly increasing quality of AI-generated content makes it difficult to distinguish between human and AI-generated texts, which may lead to undesirable consequences for society. Therefore, it becomes increasingly important to study the properties of human texts that are invariant over text domains and various proficiency of human writers, can be easily calculated for any language, and can robustly separate natural and AI-generated texts regardless of the generation model and sampling method. In this work, we propose such an invariant of human texts, namely the intrinsic dimensionality of the manifold underlying the set of embeddings of a given text sample. We show that the average intrinsic dimensionality of fluent texts in natural language is hovering around the value $9$ for several alphabet-based languages and around $7$ for Chinese, while the average intrinsic dimensionality of AI-generated texts for each language is $\approx 1.5$ lower, with a clear statistical separation between human-generated and AI-generated distributions. This property allows us to build a score-based artificial text detector. The proposed detector's accuracy is stable over text domains, generator models, and human writer proficiency levels, outperforming SOTA detectors in model-agnostic and cross-domain scenarios by a significant margin.
BibTeX
@inproceedings{tulchinskii2023intrinsic,
  author = {Eduard Tulchinskii and Kristian Kuznetsov and Laida Kushnareva and Daniil Cherniavskii and Serguei Barannikov and Irina Piontkovskaya and Sergey Nikolenko and Evgeny Burnaev},
  title = {{Intrinsic Dimension Estimation for Robust Detection of AI-Generated Texts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=8uOZ0kNji6},
}
Figure