Fine-tuning Language Models for AI vs Human Generated Text detection

Sankalp Bahad, Yash Bhaskar, Parameswari KrishnamurthyNAACL 2024

TL;DR

This paper introduces a system for detecting AI-generated text across three challenging subtasks: binary classification, multi-way classification, and mixed human-AI text detection. Leveraging a fine-tuned XLM-RoBERTa model on a diverse dataset, the system demonstrates promising performance, offering a crucial tool to combat the potential misuse of increasingly sophisticated large language models.

What Problem Does This Paper Address?

The rapid advancement and widespread accessibility of Large Language Models (LLMs) like ChatGPT and GPT-4 have led to an explosion of AI-generated content across various platforms. While these models offer significant benefits, they also raise serious concerns about potential misuse, including the spread of misinformation, academic dishonesty, and automated malicious campaigns. A critical challenge is that humans are only marginally better than chance at distinguishing AI-generated text from human-written text. This paper addresses the urgent need for reliable automatic systems to detect AI-generated content, thereby mitigating its potential negative impacts.

Methods

The authors employ a fine-tuning approach using the XLM-RoBERTa Base model, a multilingual language model pre-trained on a massive dataset. This model is chosen for its robust architecture and proven performance in text classification tasks. The fine-tuning process is applied separately to each of the three subtasks:

  • Binary Classification (Subtask A): Distinguishing between human-written and machine-generated text.
  • Multi-Way Classification (Subtask B): Identifying the specific LLM source (including human) that generated the text.
  • Human-Machine Mixed Text Detection (Subtask C): Identifying the boundary where human-written text transitions to machine-generated text within a single document.

The fine-tuning process involves optimizing model parameters using stochastic gradient descent (SGD) with backpropagation, employing task-specific loss functions (cross-entropy for classification, MSE for mixed text detection), and utilizing techniques like dropout regularization and gradient clipping to prevent overfitting and stabilize training. Hyperparameters are tuned using grid or random search.

Datasets

The dataset for this task was provided by the organizers and is designed to be diverse, encompassing various domains, languages, and sources. It is structured to address the three subtasks:

  • Subtask A (Binary Classification): A balanced corpus of human-written texts (from publications, academic papers, forums, social media) and machine-generated texts from LLMs like ChatGPT, GPT-4, Cohere, Davinci, Bloomz, and Dolly.
  • Subtask B (Multi-Way Classification): Texts generated by each of the six specified language models (ChatGPT, Cohere, Davinci, Bloomz, Dolly) and human-written texts. Annotations indicate the source of each text.
  • Subtask C (Human-Machine Mixed Text Detection): Texts where the initial part is human-written, followed by a machine-generated segment. Annotations mark the transition boundary.

The dataset is preprocessed to remove noise, standardize formatting, and ensure consistency. Table 1 provides statistics on the number of training and development examples for each subtask.

Key Insights and Ideas

  • The "Human-Like" Threat: The paper underscores that the very fluency and coherence of LLM outputs, while impressive, are precisely what make them dangerous for spreading misinformation and enabling academic dishonesty.
  • Multitasking for Detection: The approach of tackling binary, multi-way, and mixed-text detection as separate but related subtasks highlights the multifaceted nature of AI text detection.
  • XLM-RoBERTa's Versatility: The choice of XLM-RoBERTa as the base model demonstrates its effectiveness not only for multilingual tasks but also for specialized text classification challenges like AI detection.
  • The Overfitting Tendency: The observed decrease in performance with an increasing number of training epochs in Subtask A (Monolingual) suggests a potential for overfitting, a common challenge in fine-tuning large models.

Key Results

The paper presents performance metrics for each subtask, primarily focusing on F1 scores (macro and micro) and accuracy.

  • Subtask A (Binary Classification):
    • Monolingual: Achieved the best scores with models trained for only 1 epoch, with F1 scores and accuracy in the range of 0.8 to 0.85. This suggests that longer training might lead to overfitting.
  • Multilingual: The best scores were observed in models trained for 2 epochs.
  • Subtask B (Multi-Way Classification): The model trained for 5 epochs performed best, showing increasing Macro and Micro F1 scores, indicating improved predictive capability across individual classes and overall.
  • Subtask C (Human-Machine Mixed Text Detection): The Mean Squared Error (MSE) decreased with each epoch, with the lowest MSE observed at epoch 5 (27.12254). The significant drop in MSE between epoch 1 and 2 also points to potential overfitting.

Limitations and Future Work

  • Overfitting Concerns: The authors acknowledge that the performance patterns in Subtask A and C suggest potential overfitting on the training data, particularly with shorter training epochs yielding better results in some cases.
  • Subtask C Improvement: While the system showed reasonable performance in detecting boundaries in mixed human-AI text, the authors suggest that future work could focus on refining the model architecture and exploring additional features to enhance performance in this challenging task.
  • Interdisciplinary Collaboration: The paper implicitly highlights the need for collaboration across machine learning, ethics, media studies, and education to fully address the implications of LLMs.

Summary updated

BibTeX
@inproceedings{bahad2024fine,
  author = {Sankalp Bahad and Yash Bhaskar and Parameswari Krishnamurthy},
  title = {{Fine-tuning Language Models for AI vs Human Generated Text detection}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
}
Figure