SimLLM: Detecting Sentences Generated by Large Language Models Using Similarity between the Generation and its Re-generation

Hoang-Quoc Nguyen-Son, Minh-Son Dao, Koji ZettsuEMNLP 2024

Abstract

Detecting machine-generated text at the sentence level remains a significant challenge due to the lack of statistical context. We present SimLLM, a novel detection method based on the "Optimization Hypothesis": Large Language Models (LLMs) tend to produce "optimized" text that changes minimally when re-processed. By analyzing the similarity between an input sentence and its LLM-proofread version, SimLLM effectively distinguishes between human-written and AI-generated content. Our method achieves an average ROC accuracy of 0.889 across 12 prominent LLMs, significantly outperforming existing benchmarks.

Introduction

As Large Language Models (LLMs) evolve, they are increasingly capable of generating text that mimics human style with high fidelity. While document-level detection has seen success, sentence-level detection remains difficult. Current methods—supervised classifiers, zero-shot methods, and watermarking—often struggle with data shifts or require internal model access.

SimLLM addresses these gaps by leveraging the inherent stylistic preferences of LLMs. The core intuition is the Optimization Hypothesis: an LLM aims to optimize data. When it encounters human text, it identifies numerous opportunities for "improvement," leading to significant changes during proofreading. Conversely, machine-generated text is already near an "optimal" state for the model, resulting in high similarity between the input and output.

The Optimization Hypothesis: Proofreading human text leads to significant changes, while machine text remains stable.

Methodology

The SimLLM pipeline consists of four primary stages:

  1. Proofreading: An input sentence $s$ is processed by multiple candidate LLMs (e.g., ChatGPT, LLaMa 2) using a simple "Proofreading for the text: <sentence>" prompt.
  2. Heuristic Extraction: To handle conversational filler, a heuristic algorithm selects the candidate sentence $s'$ with the highest contextual similarity (BART score) to the original.
  3. Concatenation: The original sentence is paired with its most similar proofread versions.
  4. Classification: A RoBERTa-base model, fine-tuned on these similarity patterns, classifies the concatenated sequence as either human-written or machine-generated.

The choice of the BART score over traditional metrics like BLEU or ROUGE is critical, as it captures semantic meaning rather than just lexical overlap.

Experimental Setup

SimLLM was evaluated across diverse domains, including news (XSum, Reuters), academic text (SQuAD), creative writing (GhostBuster), and reviews (Yelp). The study utilized a new dataset of "analogous pairs"—human and machine sentences with identical meanings—to isolate stylistic differences from content differences. The method was tested against 12 prominent models, including GPT-4o, LLaMa 2, and Gemini.

Results and Discussion

SimLLM demonstrates superior performance and robustness across various LLMs and domains. It achieved an average ROC accuracy of 0.889, outperforming the baseline (0.837) and previous state-of-the-art BART-based methods (0.761).

Performance comparison of SimLLM against other detection methods across 12 different LLMs.

Key findings include:

  • Sentence-Level Efficacy: On ChatGPT-generated text, SimLLM reached an ROC of 0.916, proving that sentence-level detection is highly viable.
  • Efficiency: SimLLM is significantly faster than perturbation-based methods like DetectGPT, processing 1,000 words in approximately 33 seconds.
  • Cross-Model Robustness: The method is effective even when the proofreading model differs from the generation model, suggesting a shared "optimized" space among modern LLMs.

Conclusion

SimLLM provides a high-accuracy, sentence-level detection framework that does not require internal model access. While it incurs computational costs due to LLM calls, its speed and robustness make it a practical tool for identifying AI-generated content. Future work will focus on adapting the method for long-form documents and exploring defenses against potential adversarial "de-optimization" attacks.

Summary updated

BibTeX
@inproceedings{nguyenson2024simllm,
  author = {Hoang-Quoc Nguyen-Son and Minh-Son Dao and Koji Zettsu},
  title = {{SimLLM: Detecting Sentences Generated by Large Language Models Using Similarity between the Generation and its Re-generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1246},
}
Figure