Abstract
As Large Language Models (LLMs) produce increasingly human-like text, distinguishing AI-generated content from human writing has become a critical challenge. We present SentiDetect, a novel, model-agnostic framework that identifies LLM-generated text by analyzing "sentiment distribution stability." By exploiting the discovery that AI-generated content maintains highly consistent emotional patterns when rewritten objectively—whereas human writing exhibits significant emotional shifts—SentiDetect allows for robust detection without requiring access to a model's internal parameters. Our evaluations demonstrate significant performance gains across diverse domains and models, including a 16% F1 score improvement on Gemini-1.5-Pro.
Introduction
The rapid advancement of LLMs has initiated a "cat-and-mouse" game in text detection. Current methods generally fall into three categories: watermarking, supervised classifiers, and statistic-based detectors like DetectGPT. However, these methods often suffer from being easily bypassed, struggling to generalize to new domains, or requiring "white-box" access to source model log-probabilities. SentiDetect addresses these limitations by providing a robust, zero-shot, and model-agnostic detector capable of withstanding adversarial attacks and paraphrasing across diverse domains such as news, code, and academic writing.
Methodology
The core hypothesis of SentiDetect is that LLMs, due to their training on curated and "neutralized" corpora, possess an inherent emotional regularity or "emotional fingerprint." The system utilizes a three-stage pipeline to exploit this stability:
- Low-Emotional Rewriting (LER): The system uses an LLM to rewrite the candidate text using objective instructions (e.g., "Rewrite this paragraph objectively").
- Sentiment Feature Extraction: Both the original and rewritten texts are processed through a standard 3-class sentiment classifier (Negative, Neutral, Positive) to produce a probability distribution.
- Stability Divergence Analysis: The system calculates metrics such as Sentiment Distribution Consistency (SDC), which measures the divergence between the original and rewritten sentiment. If the divergence is below a specific threshold, the text is flagged as AI-generated, as LLM text remains stable while human text fluctuates.
Experimental Setup and Datasets
SentiDetect was evaluated across five diverse benchmarks to test cross-domain capabilities:
- News: 5,000 articles comparing human journalists to AI versions.
- HumanEval: 164 programming tasks focusing on docstrings and comments.
- Student Essay: Papers from the BAWE corpus.
- Yelp Review: 1,000 human reviews versus machine-generated equivalents.
- Paper Abstract: 500 abstracts from ACL 2023–2024.
Key Results and Insights
SentiDetect significantly outperformed state-of-the-art baselines, including GPTZero and DetectGPT:
- Performance Gains: It achieved an 11% F1 score improvement on GPT-4-0613 and a 13-point average improvement on unseen models like LLaMa-3.3.
- Adversarial Resilience: While baseline detectors saw performance drops of up to 70% under lexical-level adversarial attacks, SentiDetect remained remarkably stable.
- Short Text Success: The framework remains effective for texts as short as 20 words, outperforming other detectors in the short-form category.
Discussion and Limitations
While SentiDetect offers superior robustness, it does involve higher inference costs due to the required LLM rewriting step. Additionally, very short texts (under 20 tokens) remain a challenge due to limited "sentiment real estate." Future work may explore more granular emotional categories beyond the standard positive/neutral/negative classes to further refine detection accuracy. Ultimately, SentiDetect demonstrates that the stability of sentiment under transformation is a more reliable signal for AI detection than the sentiment itself.
Summary updated