Source-linked AI summary

On the Possibilities of AI-Generated Text Detection

Souradip Chakraborty, Amrit Singh Bedi, Sicheng Zhu, Bang An, Dinesh Manocha, Furong Huang

arXiv:2304.04736v3cs.CLcs.AIcs.LG

TL;DR

The paper addresses whether AI-generated text can be reliably distinguished from human text, a question important for responsible LLM use. It develops information-theoretic sample-complexity bounds and evaluates multi-sample detection across datasets and models. The results support detection in most settings, while closeness between human and machine distributions, paraphrasing, and successive attacks constrain performance.

  • Problem

    The paper asks whether AI-generated text can be detected in practice despite concerns that human and machine text distributions may be difficult to distinguish.

  • Method

    The paper uses mathematical analysis to derive sample-complexity bounds for IID and non-IID detection and evaluates detectors across multiple datasets, generators, and sequence lengths.

  • Results

    Detection performance improves substantially with more samples or longer sequences, rising from around 50% to 90% on Xsum and Squad human-machine datasets.

  • Takeaways & Limitations

    The findings support multi-sample AI-text detection even when human and machine distributions are close, with applications to responsible LLM use.

  • Takeaways & Limitations

    Detection becomes harder when m(s) is close to h(s), and paraphrasing or successive attacks can reduce detection performance.

Abstract

from arXiv · show

Our work addresses the critical issue of distinguishing text generated by Large Language Models (LLMs) from human-produced text, a task essential for numerous applications. Despite ongoing debate about the feasibility of such differentiation, we present evidence supporting its consistent achievability, except when human and machine text distributions are indistinguishable across their entire support. Drawing from information theory, we argue that as machine-generated text approximates human-like quality, the sample size needed for detection increases. We establish precise sample complexity bounds for detecting AI-generated text, laying groundwork for future research aimed at developing advanced, multi-sample detectors. Our empirical evaluations across multiple datasets (Xsum, Squad, IMDb, and Kaggle FakeNews) confirm the viability of enhanced detection methods. We test various state-of-the-art text generators, including GPT-2, GPT-3.5-Turbo, Llama, Llama-2-13B-Chat-HF, and Llama-2-70B-Chat-HF, against detectors, including oBERTa-Large/Base-Detector, GPTZero. Our findings align with OpenAI's empirical data related to sequence length, marking the first theoretical substantiation for these observations.

1 Introduction

The paper frames AI-text detection as important for mitigating LLM misuse and answers its feasibility question affirmatively. It proposes rigorous sample-complexity analysis and evaluates detectors across datasets, generators, and detector models.

  • LLM misuse can spread misinformation, deceptive reviews, plagiarism, and manipulated web content, motivating reliable detection.
  • The paper asks whether AI-generated text can be detected in practice and answers affirmatively when multiple samples are collected.The authors connect this setting to applications such as identifying machine-generated social-media posts.
  • A mathematically rigorous analysis concludes that detection remains possible and improves with text sequence length.
  • The paper derives sample-complexity bounds for detecting AI-generated text in both IID and non-IID settings.
  • Experiments cover Xsum, Squad, IMDb, and Fake News datasets with GPT-2, GPT3.5 Turbo, Llama variants, RoBERTa detectors, and ZeroGPT.

2 Background on AI-Generated Text Detectors and Related Works

Related work spans statistical, classifier-based, and watermark-based detection methods. The paper positions its contribution as showing a hidden detection possibility even when human and machine text distributions are close in total variation distance.

  • Traditional approaches: Statistical detectors use entropy, perplexity, n-gram frequency, or perturbation-based log-probability comparisons to distinguish human and machine text.
  • Classifier-based detectors: Classifier-based detectors use trained discrimination systems, sometimes combined with human evaluation, to identify machine-generated text.
  • Watermark-based identification: Watermark-based identification embeds detectable signals in generated text, including schemes based on logits, hash verification, or token selection.
  • Prior work reported vulnerabilities of watermark-based and other detectors under vanilla paraphrasing attacks.
  • The paper argues that AI-generated text can remain detectable even when the total-variation distance between human and machine distributions is small.

3 Proposed Approach: Methodology and Analysis

The paper models AI-text detection as hypothesis testing over human and machine distributions and shows that multiple samples can make detection feasible even when single-sample distributions are close. It derives AUROC and sample-complexity results for IID and non-IID samples, with likelihood-ratio detectors attaining the theoretical bound.

  • 3.1 Notations and Definitions: The detector D(s) thresholds a score to classify samples as machine-generated or human-generated, with AUROC summarizing the ROC trade-off.TPR should be high and FPR low; AUROC ranges from 1/2 for random detection to 1 for perfect detection.
  • 3.2 Hidden Possibilities of AI-Generated Text Detection: Multiple samples transform the test into distinguishing product distributions m⊗n and h⊗n, whose total variation determines the minimum combined Type-I and Type-II error.The IID setup assumes samples are drawn independently from either the human or machine distribution.
  • 3.2 Hidden Possibilities of AI-Generated Text Detection: TV(m⊗n, h⊗n) increases with n and converges to 1, so collecting more samples can enable detection even when human and machine distributions are close.The argument applies whenever the distributions are not exactly identical.
  • 3.2 Hidden Possibilities of AI-Generated Text Detection: TV(m⊗n, h⊗n) = 1−exp(−nIc(m, h) + o(n)), yielding an AUROC upper bound that increases exponentially with the number of samples.Ic(m, h) is the Chernoff information, and the bound is attainable by likelihood-ratio-based detectors.
  • 3.3 Attainability and Sample Complexity: Theorem 1 establishes that for any δ = TV(m, h) > 0 and target ϵ ∈[0.5, 1), a finite sample size can achieve the target AUROC with the best possible detector.The detector is likelihood-ratio-based, and the result implies detection is possible for every nonzero distributional difference.

4 Experimental Studies

The experiments evaluate detectability across multiple datasets, generators, detectors, sample configurations, and paraphrasing conditions. Across these settings, detection performance generally improves with longer sequences or more samples, while paraphrasing reduces but does not eliminate this trend.

  • Experimental setup: Experiments span XSum, Squad, IMDb, and Kaggle FakeNews datasets, using multiple human-machine and general-language detection settings.The study also uses several state-of-the-art generators and detectors.
  • Pairwise IID samples: 73% to 97%: using two IID sequences instead of one substantially improves the AUROC of a real detector.The experiment uses pairwise samples with limited bag-of-words features and logistic regression.
  • Supervised detection: 58% to 97%: best-detector AUROC increases as n-gram length grows from word-level toward sentence- or paragraph-level features on XSum and Squad.Real classifiers also show increasing test AUROC with sequence length.
  • Zero-shot detection: Around 50% to 90%: zero-shot detection performance improves with more samples or longer sequences across XSum and Squad.The pattern appears with RoBERTa-Large, RoBERTa-Base, and ZeroGPT, although RoBERTa-Large performs better than RoBERTa-Base.
  • Detection with paraphrasing: Paraphrasing lowers detection performance by approximately 15%, but performance still improves as sequence length increases.The study reports that the degradation is much smaller with pairwise IID samples.

5 Conclusion

The conclusion states that detection remains possible as human and machine distributions become close, but requires more samples and is weakened by paraphrasing or successive attacks. It also notes that exact distributional equality is difficult to achieve and that detectors face misidentification and false-alarm risks.

  • Distributional closeness: Detection becomes harder when m(s) is close to h(s), requiring potentially large sample sizes from an information-theoretic perspective.The paper links this difficulty to the closeness of machine-generated and human-generated distributions.
  • Detection limits: Paraphrasing reduces detection performance, while collecting more samples can increase AUROC above 1/2 when machine and human distributions are sufficiently distinct.The conclusion presents this as the practical condition under which detection remains possible.
  • Detector risks: The conclusion identifies misidentification and false alarms as potential risks associated with AI-text detectors.It frames more powerful, robust, and fair detectors as a desired direction.

A Additional Insights and Remarks

The remarks connect the theory to watermarking, detector design, task-specific detectability, and settings where machine and human distributions differ. They emphasize reducing sample costs, addressing detector bias, and preserving distributional differences that support separation.

  • Insights for watermark design: Watermarking can increase Chernoff information, thereby increasing δ and reducing the number of samples needed for detection.The remark presents watermarking as a way to mitigate the cost of collecting extremely many samples.
  • Insights for detector design: Detector design should account for bias because some existing detectors misclassify non-native English writing as AI-generated.The cited discussion warns that reliance on low perplexity can produce unfair classifications, including for academic writing.
  • Task-specific detectability: When machine-generated and human-generated distributions are very close, detection is hard but remains possible by collecting more samples.Figure 5 distinguishes this regime from the easier case in which LLMs learn a different distribution.
  • Realistic distributional differences: Small differences between m(s) and h(s) can support detection, and controllable machine generation can create such differences in practical applications.The remark gives reducing biased language in machine-generated text as an example of a distributional difference.

B Detailed Proofs

The proof establishes the optimal detector for distinguishing machine-generated from human-generated text using Le Cam’s lemma and a likelihood-ratio acceptance region. It then connects this result to threshold detectors and the Neyman–Pearson lemma.

  • Le Cam’s lemma: Le Cam’s lemma identifies the detector minimizing the sum of machine and human classification errors over all measurable binary detectors.The proof represents detectors through acceptance regions and takes an infimum over those regions.
  • Optimal detector: The optimal acceptance region is A* = {s : m(s) ≥ h(s)}, yielding the likelihood-ratio-based detector Ψ*.The proof establishes measurability and compares an arbitrary measurable set with A* using measure additivity.
  • Proof steps: The proof obtains the upper bound by using the sign of m-h on regions outside and inside A*, then applying sigma-additivity.The argument drops or adds terms according to whether their signs are nonnegative.
  • Threshold representation: A threshold detector can represent any binary detector, so Le Cam’s lemma applies to the paper’s detector D with threshold γ.The proof notes that choosing D equal to a binary detector and γ = 0.5 gives the required representation.
  • Optimality connection: The resulting Ψ* is also the likelihood-ratio detector that is optimal for this simple-versus-simple hypothesis test under the Neyman–Pearson lemma.The proof concludes optimality after combining the lower and upper bounds.

B.2 Proof of Theorem 1

The proof derives detection guarantees by separating human and machine samples on a measurable set and applying concentration bounds to their sample counts. It then relates the resulting total-variation bound to the target AUROC and solves for the required sample size.

  • Set construction: The proof chooses a set A whose probabilities differ by δ between machine and human text distributions.For human samples, P(sh ∈ A)=p; for machine samples, P(sm ∈ A)=p+δ.
  • Sample counts: With n samples, the expected counts in A are (p+δ)n for machine text and pn for human text.The proof compares these count distributions using concentration inequalities.
  • Concentration bound: Chernoff bounds control the probabilities that the two sample-count distributions cross a separating threshold.The argument constructs a set A′ of n-tuples containing sufficiently many samples from A.
  • Total variation: The resulting lower bound on TV(m⊗n, h⊗n) determines the minimum separation achievable with n samples.The proof uses this bound as the basis for the best-detector AUROC guarantee.
  • AUROC guarantee: Solving the AUROC condition requires using monotonicity, expanding and rearranging the bound, and taking logarithms.The algebraic steps reduce the target detection requirement to an explicit sample-size condition.

B.3 Proof of Theorem 2

The non-IID proof extends the concentration argument to sequentially dependent samples by bounding dependence through association strength and dependent-sequence size. It then applies the resulting bound to derive sample complexity for detection.

  • Non-IID setting: The proof analyzes samples drawn sequentially from a non-IID joint distribution rather than assuming independent observations.Lemma 2 states an upper bound for the non-IID scenario.
  • Dependence structure: Dependent samples are partitioned into independent subsets containing dependent sequences, allowing dependence to enter through sequence-level parameters.The notation introduces independent subsets τ_j and dependent-sequence sizes c_j.
  • Sample complexity: The sample-complexity argument again compares event probabilities p+δ and p for machine and human samples collected sequentially.The expected counts in the distinguishing set remain (p+δ)n and pn, respectively.
  • AUROC guarantee: The proof converts the non-IID total-variation lower bound into an AUROC requirement and solves the resulting algebraic inequality.The derivation uses monotonicity, expansion, logarithms, and the solution of a quadratic equation.
  • Concentration bound: The resulting bound is exponential in n and additionally depends on association strength ρ_j and dependent-sequence size c_j.When ρ=0, the expression reduces exactly to the standard Chernoff bound.

C.1 Additional Experimental Details

Additional experiments compare word-level and paragraph-level detection across IMDb and Fake News settings, including harder reviews with fewer sentences. Paragraph-level detectors substantially outperform word-level limits, while performance declines as inputs become shorter or distributions become closer.

  • IMDb setup: The IMDb experiments compare detection using individual words with detection using paragraphs or groups of sentences.The study represents paragraphs with a Bag-of-Words count vectorizer and evaluates positive-versus-negative review classes.
  • IMDb results: 0.585 AUROC is the best word-level detector result on IMDb, whereas paragraph-level detectors achieve test AUROC above 0.8.Random forest and MLP reach train AUROC ≥0.93, while all real detectors exceed 0.85 on training data.
  • Fake News results: The Fake News experiments reproduce the same pattern, with paragraph-level AUC reaching 90% compared with 59.73% word-level AUROC.These results support the feasibility of detection for a broader class of NLP tasks.
  • Increased hardness: Reducing the number of sentences lowers detection performance, but every tested method still achieves test AUROC greater than 0.7.The harder setting uses randomly shortened reviews to make classification more difficult.
  • Experimental aim: The experiments are intended to demonstrate detection feasibility rather than establish state-of-the-art classification accuracy.The authors note that high classification accuracy is already achievable with simple pretrained BERT-based models.

D Detailed Conclusion & Scope of Future Works

The conclusion frames detectability as increasing with sample count when human and machine distributions differ, while emphasizing that close distributions and paraphrasing make detection harder. It points toward robust detectors and watermarking as future directions.

  • Scope and difficulty: When m(s) is close to h(s), detecting AI-generated text becomes harder and requires more samples.The paper treats exact equality of the distributions as the boundary where its detectability claim does not apply.
  • Adversarial setting: Paraphrasing attacks can reduce detection performance, although additional samples are asserted to increase attainable AUROC above 1/2.The authors connect this difficulty to the closeness of machine and human distributions.
  • Distributional boundary: The authors argue that human population diversity may prevent exact equality between human and machine text distributions.They present this diversity as a possible basis for showing sufficient distributional separation.
  • Future scope: Theoretical and empirical results indicate that collecting more samples should improve AI-generated text detection.The conclusion links this claim to observed sequence-length improvements in zero-shot detectors.
  • Future directions: Future work should pursue more powerful, robust, fair detectors and watermarking methods while addressing representation space and interpretability.The authors also flag misidentification and false alarms as risks associated with detectors.
Loading 2304.04736v3…