Abstract
Detecting Machine-Generated Text (MGT) has emerged as a significant area of study within Natural Language Processing. While language models generate text, they often leave discernible traces, which can be scrutinized using either traditional feature-based methods or more advanced neural language models. In this research, we explore the effectiveness of fine-tuning a RoBERTa-base transformer, a powerful neural architecture, to address MGT detection as a binary classification task. Focusing specifically on Subtask A (Monolingual-English) within the SemEval-2024 competition framework, our proposed system achieves an accuracy of 78.9% on the test dataset, positioning us at 57th among participants. Our study addresses this challenge while considering the limited hardware resources, resulting in a system that excels at identifying human-written texts but encounters challenges in accurately discerning MGTs.
Introduction
As Large Language Models (LLMs) become increasingly sophisticated, the line between human and machine-generated text (MGT) has blurred. This poses significant risks ranging from the spread of automated misinformation to academic fraud. The Sharif-MGTD team participated in the SemEval-2024 Task 8 competition to address this challenge, specifically focusing on Subtask A (Monolingual English).
While state-of-the-art transformer models are the gold standard for detection, they are notoriously resource-hungry. Our research addresses a practical gap: How can we build an effective MGT detector when hardware resources are limited? Working within the constraints of free-tier cloud environments and local GPUs, we explored how architectural and hyperparameter choices—particularly input sequence length—impact a model's ability to identify the subtle linguistic traces left by AI.
Methodology
Architecture
We opted for a supervised learning approach, fine-tuning a pre-trained RoBERTa-base transformer. RoBERTa was selected for its robust performance in sequence classification tasks and its efficient handling of contextual embeddings. To adapt the model for binary classification, we augmented the standard RoBERTa architecture with a custom Classifier Head. This head consists of:
- A linear layer (768 features).
- A dropout layer to mitigate overfitting.
- A final linear layer that outputs a single value for binary classification (Human vs. Machine).
Training Strategy
The model was trained using the AdamW optimizer and Cross-Entropy Loss. To handle the resource limits of Google Colab’s free tier (which caps sessions at 12 hours), we utilized an early stopping mechanism to terminate training once the loss hit a specific threshold (0.35). This ensured the model reached a functional state within the available compute window.
The Zero-Shot Alternative
In addition to our main transformer approach, we experimented with Detect-GPT, a zero-shot method that uses probability curvature analysis. While accurate, we found it significantly more computationally expensive for large-scale datasets, leading us to prioritize the fine-tuned RoBERTa model for the final submission.
Experimental Setup and Datasets
The study utilized the dataset provided for SemEval-2024 Task 8 (Subtask A: Monolingual English).
- Training Set: 119,757 examples.
- Development Set: 5,000 examples.
- Attributes: Each entry includes the text, a binary label (0 for human, 1 for machine), the specific AI model that generated the text, and the source domain.
Nearly 90% of the provided data was used for training, with the remainder reserved for evaluation and model selection.
Results and Discussion
Performance Metrics
Our system achieved the following results:
- Test Accuracy: 78.9% (57th out of 140 participants).
- Dev Accuracy: 74.8%.
- Area Under the Curve (AUC): 0.69.
While the model performs well above a random baseline, the proximity of the ROC curve to the diagonal indicates there is still significant room for improvement in distinguishing the two classes.
The "Token Size" Bottleneck
The most critical insight from our experiments was the impact of sequence length. Increasing the maximum token length from 512 to 1024 improved accuracy by roughly 2%, but at a staggering cost: a 15-fold decrease in training speed. This makes "long-form" detection a major hurdle for researchers without high-end GPU clusters. Due to regional sanctions affecting access to premium compute accounts, we were forced to choose a 512-token limit as a "sweet spot" for feasibility.
Asymmetric Detection
The model exhibited a "conservative" bias. It was excellent at identifying human-written text (low False Positives) but struggled more with accurately flagging machine-generated text. This suggests that while AI leaves "traces," they are often too subtle for a base-level transformer to catch when the input is truncated or when the model is constrained by limited training depth.
Conclusion and Future Work
Our participation in SemEval-2024 Task 8 demonstrated that while transformer-based models like RoBERTa are effective for MGT detection, their performance is heavily gated by computational resources. The primary limitation of our study was computational scale, as memory limits prevented the use of larger batch sizes and longer token sequences.
For future work, we advocate for:
- Efficiency-First Algorithms: Developing low-cost detection algorithms that do not require massive VRAM.
- Long-Context Modeling: Exploring architectures that can handle larger token sizes more efficiently to capture the incoherence or repetition patterns often found in longer AI-generated documents.
- Refining MGT Cues: Improving the classifier's ability to detect the specific, subtle linguistic markers of LLMs that current base-level models often miss.
Summary updated