Unveiling Large Language Models Generated Texts: A Multi-Level Fine-Grained Detection Framework

Zhen Tao, Zhiyu Li, Runyu Chen, Dinghao Xi, Wei Xu

TL;DR

This paper introduces a novel "Multi-level Fine-grained Detection" (MFD) framework to accurately identify text generated by Large Language Models (LLMs). By integrating low-level structural, high-level semantic, and deep linguistic features, MFD offers a more robust and granular detection capability than existing methods, crucial for maintaining academic integrity.

What Problem Does This Paper Address?

The proliferation of LLMs like ChatGPT has revolutionized text generation, offering benefits in grammar correction and content expansion. However, this also raises significant concerns about authorship, originality, and academic integrity. Existing detection methods often rely on single-feature analysis or binary classification, failing to effectively identify LLM-generated text, especially in academic contexts where subtle nuances and paraphrasing are common. This makes it difficult to distinguish between human and machine-generated content, potentially undermining scholarly standards. The paper aims to address this by providing a more sophisticated, multi-faceted approach to LLM detection.

Methods

The MFD framework employs a multi-pronged strategy:

  • Multi-level Feature Extraction: It extracts features from three distinct levels:
  • Low-level Statistical Features: Utilizes metrics from libraries like textstat and authorstyle to analyze readability (e.g., Flesch-Kincaid Grade) and authorial style (e.g., word length, POS tag frequency). This captures structural and stylistic patterns.
  • High-level Semantic Features: Employs a contrastive learning encoder trained on original LLM text, human-like paraphrased text, rewritten text, and genuine human text. This helps the model learn to distinguish subtle semantic differences and become robust against paraphrasing.
  • Deep-level Linguistic Features: Leverages an advanced LLM (specifically, Llama-3.1-8B-Instruct) to analyze the entire text, extracting features related to lexicon, grammar, and syntax. This captures deeper contextual relationships.
  • Attention-Based Fusion: A mechanism fuses these multi-level features, prioritizing the most informative signals.
  • LLM Involvement Predictor: A multi-task learning model then predicts the degree of LLM involvement at the sentence level across lexicon, grammar, and syntax dimensions.

To enhance robustness against evasion, the framework generates "human-like" and "rewritten" versions of LLM text using specific prompts and trains the contrastive learning encoder on these variations alongside original texts.

Datasets

  • PASTED (Paraphrased Text Span Detection): Used as the primary dataset for training and testing. It provides continuous regression labels (0-1) for lexical, syntactic, and grammatical LLM involvement.
  • Multi-Paraphrase (MP): Used for testing generalization. It contains texts rewritten by contemporary LLMs (like GLM) with binary labels.
  • Out of Distribution-GPT4 (OOD-GPT4): Also used for testing generalization, featuring texts edited or rewritten by GPT-4 with binary labels.

Key Insights and Ideas

  • Multi-level is Key: The paper strongly advocates that combining low-level structural, high-level semantic, and deep linguistic features is crucial for effective LLM detection, outperforming single-feature approaches.
  • Contrastive Learning for Robustness: Using contrastive learning with paraphrased and human-like LLM text significantly improves the model's ability to detect LLM-generated content even after modifications.
  • Sentence-Level Granularity Matters: Detecting LLM involvement at the sentence level, rather than just the document level, provides a more precise and actionable assessment for academic integrity.
  • LLMs as Detectors: Leveraging advanced LLMs to extract deep linguistic features offers a powerful way to capture subtle patterns missed by traditional methods.

Key Results

The proposed MFD model achieved state-of-the-art performance on the PASTED dataset, reporting an MAE of 0.1346 and an accuracy of 88.56%. It also demonstrated strong generalization capabilities on the MP and OOD-GPT4 datasets. Ablation studies confirmed the critical role of combining multi-level features, with the full model achieving the best accuracy (0.8856). The T5 encoder and Llama-3.1-8B-Instruct LLM were found to be particularly effective within the framework.

Limitations and Future Work

The authors acknowledge that while their model shows strong performance, there's room for improvement. Future work includes:

  • Cross-Linguistic Detection: Extending the framework to detect LLM-generated text across multiple languages.
  • Adaptive Learning: Developing techniques to enhance resilience against future advancements in LLM technologies and adversarial evasion methods.
  • Real-time Integration: Incorporating real-time detection functionalities into academic writing tools for immediate feedback.
  • Exploring Thresholds: Further optimizing accuracy thresholds for different linguistic levels and tasks, as the study found a threshold of 0.8 yielded the highest mean accuracy in some scenarios, though 0.5 was chosen for balance.
  • Broader Datasets: Expanding evaluation to more diverse and complex datasets to assess robustness across various writing styles and domains.

Summary updated

Abstract

Large language models (LLMs) have transformed human writing by enhancing grammar correction, content expansion, and stylistic refinement. However, their widespread use raises concerns about authorship, originality, and ethics, even potentially threatening scholarly integrity. Existing detection methods, which mainly rely on single-feature analysis and binary classification, often fail to effectively identify LLM-generated text in academic contexts. To address these challenges, we propose a novel Multi-level Fine-grained Detection (MFD) framework that detects LLM-generated text by integrating low-level structural, high-level semantic, and deep-level linguistic features, while conducting sentence-level evaluations of lexicon, grammar, and syntax for comprehensive analysis. To improve detection of subtle differences in LLM-generated text and enhance robustness against paraphrasing, we apply two mainstream evasion techniques to rewrite the text. These variations, along with original texts, are used to train a text encoder via contrastive learning, extracting high-level semantic features of sentence to boost detection generalization. Furthermore, we leverage advanced LLM to analyze the entire text and extract deep-level linguistic features, enhancing the model's ability to capture complex patterns and nuances while effectively incorporating contextual information. Extensive experiments on public datasets show that the MFD model outperforms existing methods, achieving an MAE of 0.1346 and an accuracy of 88.56%. Our research provides institutions and publishers with an effective mechanism to detect LLM-generated text, mitigating risks of compromised authorship. Educators and editors can use the model's predictions to refine verification and plagiarism prevention protocols, ensuring adherence to standards.
BibTeX
@inproceedings{tao2024unveiling,
  author = {Zhen Tao and Zhiyu Li and Runyu Chen and Dinghao Xi and Wei Xu},
  title = {{Unveiling Large Language Models Generated Texts: A Multi-Level Fine-Grained Detection Framework}},
  booktitle = {Decision},
  year = {2024},
}
Figure