NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Team MGTD4ADL at SemEval-2024 Task 8: Leveraging (Sentence) Transformer Models with Contrastive Learning for Identifying Machine-Generated Text

Huixin Chen, Jan Büssing, David Rügamer, Ercong Nie

Introduction

As Large Language Models (LLMs) become increasingly sophisticated, the ability to distinguish between human-written and machine-generated content is becoming a critical challenge. This distinction is vital for maintaining academic integrity, preventing the spread of misinformation, and ensuring that future AI models are not trained on "polluted" synthetic data.

Researchers from LMU Munich participated in SemEval-2024 Task 8, specifically focusing on Subtask B. This task involves multi-class classification, requiring models to attribute text to one of six sources: human authors or five specific LLMs (BLOOMz, ChatGPT, Cohere, Davinci-003, and Dolly-v2). To test robustness, the models were evaluated in an out-of-domain scenario, training on Wikipedia and Reddit data while being tested on academic "PeerRead" data.

Methodology

The team explored several architectural strategies to identify the most effective approach for out-of-domain generalization:

  1. Transformer Baselines: Standard encoder models (RoBERTa, XLNet) and decoder models (GPT-2 Small) were established as performance benchmarks.
  2. Sentence Transformers: The researchers utilized models like all-mpnet-base and all-roberta-large-v1. These are pre-trained to produce semantically rich sentence-level embeddings rather than simple token-level representations.
  3. Contrastive Learning (CL): To refine the embedding space, the team integrated Supervised Contrastive Learning (SCL) and Dual Contrastive Learning (DualCL). The objective of CL is to cluster embeddings of the same class more tightly while increasing the distance between different classes.
  4. Data Augmentation: Techniques such as synonym replacement and random word swapping were tested to improve model robustness.

Experimental Setup and Datasets

The study utilized the M4 dataset, a comprehensive benchmark for machine-generated text detection. Training and validation were conducted on approximately 71,000 samples from Wikipedia, Reddit, arXiv, and wikiHow. For evaluation, the authors enriched the competition test set with the full PeerRead domain from the original M4 dataset, resulting in a 14,566-point evaluation set to ensure statistical significance.

Key Results and Insights

The experimental results highlighted several critical findings regarding model architecture and training objectives:

  • Sentence Transformers vs. Standard Transformers: The all-roberta-large-v1 model significantly outperformed standard RoBERTa variants, suggesting that sentence-pair pre-training captures stylistic nuances essential for detection.
  • The Efficacy of SCL: Integrating Supervised Contrastive Learning (SCL) provided a measurable boost to accuracy for the Sentence Transformer models.
Comparison of accuracy across different models and loss functions, highlighting the effectiveness of SCL.
  • Decoder Models as Detectors: GPT-2 Small performed surprisingly well (73.25% accuracy). This suggests that generative decoder models may possess an inherent "intuition" for the sequence dynamics used by other LLMs.
  • Augmentation and DualCL Limitations: Contrary to expectations, data augmentation via synonym swapping decreased performance by obscuring subtle stylistic fingerprints. Similarly, DualCL often degraded results, indicating it may not be suited for this specific classification task.

Peak Performance and Error Analysis

The team's best configuration—all-roberta-large-v1 with SCL—achieved a peak accuracy of 76.96% on the competition test set, ranking them 20th overall.

Confusion matrix for the peak performing model (76.96% accuracy), showing high precision for Dolly-v2 and BLOOMz but difficulty with Davinci-003.

Qualitative analysis via confusion matrices showed that while the system was highly effective at identifying models like Dolly-v2 and BLOOMz, it struggled most with distinguishing human text from Davinci-003 (GPT-3). This confirms that more advanced generative models remain the most difficult to detect.

Conclusion

The study demonstrates that combining Sentence Transformers with Supervised Contrastive Learning is a powerful approach for machine-generated text detection. While simple data augmentation proved counterproductive, the success of GPT-2 Small and Sentence-RoBERTa provides a clear path for future research. Subsequent work will focus on more sophisticated augmentation techniques, such as back-translation, and more rigorous early-stopping criteria to further improve out-of-domain generalization.

Summary updated

BibTeX
@inproceedings{chen2024team,
  author = {Huixin Chen and Jan Büssing and David Rügamer and Ercong Nie},
  title = {{Team MGTD4ADL at SemEval-2024 Task 8: Leveraging (Sentence) Transformer Models with Contrastive Learning for Identifying Machine-Generated Text}},
  booktitle = {SemEval @ NAACL},
  year = {2024},
  doi = {10.18653/v1/2024.semeval-1.245},
}
Figure