SEFD: Semantic-Enhanced Framework for Detecting LLM-Generated Text

Weiqing He, Bojian Hou, Tianqi Shang, Davoud Ataee Tarzanagh, Qi Long, Li Shen

Introduction

The proliferation of Large Language Models (LLMs) has necessitated the development of robust detection mechanisms to distinguish between human-authored and machine-generated content. However, current state-of-the-art detectors—ranging from statistical methods like DetectGPT to cryptographic approaches like watermarking—face a significant vulnerability: paraphrasing attacks. When AI-generated text is rewritten by another model, the specific token distributions and statistical "fingerprints" that detectors rely on are often erased.

This paper introduces the Semantic-Enhanced Framework for Detection (SEFD), a novel approach designed to make detection robust against such attacks. By shifting the focus from fragile token-level statistics to stable semantic meaning, SEFD identifies AI-generated content even after heavy rewording.

Methodology

SEFD operates as a modular enhancement that can be integrated with existing "off-the-shelf" detectors. The framework utilizes a three-step pipeline combined with a dynamic retrieval mechanism to evaluate incoming text.

1. Initial Detection

The system first processes the input text using a standard base detector (e.g., Log-Likelihood, DetectGPT, or Soft Watermarking). This produces an initial detection score, denoted as $s_{det}$.

2. Semantic Similarity Computation

Simultaneously, the input text is converted into a vector embedding using a BERT-based encoder. This embedding is compared against a Retrieval Pool containing known LLM-generated texts. The framework calculates the maximum cosine similarity ($s_{sim}$) between the current input and the entries in the pool. This step exploits the principle of "semantic invariance": while paraphrasing changes the syntax, the core semantic meaning remains largely unchanged.

3. Semantic Enhanced Detection (Fusion)

The final step involves a fusion function that combines $s_{det}$ and $s_{sim}$. The logic is adaptive: if a text shows high semantic similarity to a known AI output, the similarity score is weighted more heavily, signaling a likely paraphrase. If similarity is low, the system relies more on the traditional statistical detector to identify original AI content.

The Dynamic Updating Rule

A critical innovation of SEFD is its ability to update its retrieval pool in real-time. In a sequential stream of text (such as a forum or comment section), if the system identifies a new, original LLM output—characterized by a high detection score but low similarity to the existing pool—it automatically adds that text to the pool. This allows SEFD to "learn" and adapt to new AI content dynamically, effectively catching subsequent paraphrased versions of that same content.

Experimental Evaluation

The researchers evaluated SEFD using a diverse dataset and several benchmark detectors:

  • Data Source: 1,300 human-written answers from the r/explainlikeimfive subreddit.
  • Generative Models: Content was generated using GPT-2 XL, OPT-13B, GPT-3.5 (text-davinci-003), and GPT-4o-mini.
  • Paraphrasing Attack: The DIPPER model (11B parameters) was used to rewrite LLM outputs to simulate evasion attempts.
  • Baselines: SEFD was tested against Log-Likelihood, DetectGPT, Intrinsic Dimension (ID-MLE), and Soft Watermarking.

Key Results

The framework demonstrated substantial improvements in Detection Accuracy (DA) at a strict 1% False Positive Rate (FPR):

  • Enhanced Statistical Detection: For GPT-2 XL text paraphrased by DIPPER, the accuracy of DetectGPT improved from 8.72% to 26.06% when integrated with SEFD.
  • Watermarking Robustness: Soft watermarking detection on paraphrased text saw a dramatic increase from 61.7% to 90.7% using SEFD, even when starting with an empty initial pool.
  • Modern Model Performance: On GPT-4o-mini, SEFD improved the Intrinsic Dimension detector's accuracy from 21.8% to 43.4% in paraphrasing scenarios.

Notably, the framework proved effective against recursive paraphrasing. By replacing older versions in the pool with the most recently detected paraphrases, SEFD maintains a high-similarity link throughout multiple iterations of rewriting.

Discussion and Limitations

While SEFD significantly advances the state of AI detection, several challenges remain:

  1. Hyperparameter Sensitivity: The framework requires tuning four specific parameters ($\epsilon_{det}, \epsilon_{sim}, \lambda_1, \lambda_2$). Optimal settings vary depending on the base detector used, suggesting that there is no universal configuration.
  2. Computational Scalability: Maintaining and searching a massive retrieval pool in high-traffic environments may introduce latency, though the authors suggest tools like FAISS can mitigate this.
  3. Nuanced Classification: The current model focuses on binary (AI vs. Human) classification. Future iterations must address more complex scenarios, such as human-edited AI text or AI-paraphrased human content.
  4. Ethical Considerations: The authors acknowledge potential biases in LLM detectors against non-native English speakers, highlighting the need for continued research into fairness and algorithmic equity.

Conclusion

SEFD represents a significant step forward in the "cat-and-mouse" game of AI detection. By leveraging semantic similarity and a dynamic updating mechanism, the framework provides a robust defense against paraphrasing attacks that typically defeat statistical detectors. This approach ensures that even as generative models become more sophisticated at masking their fingerprints, their underlying semantic signatures remain detectable.

Summary updated

BibTeX
@inproceedings{he2024sefd,
  author = {Weiqing He and Bojian Hou and Tianqi Shang and Davoud Ataee Tarzanagh and Qi Long and Li Shen},
  title = {{SEFD: Semantic-Enhanced Framework for Detecting LLM-Generated Text}},
  booktitle = {IEEE Big Data},
  year = {2024},
  url = {https://openreview.net/forum?id=2UXb6vWB7X},
}
Figure