DEER: Disentangled Mixture of Experts with Instance-Adaptive Routing for Generalizable Machine-Generated Text Detection

Guoxin Ma, Xiaoming Liu, Zhanhan Zhang, Chengzhengxu Li, Shengchao Liu, Yu Lan · DOI

Abstract

As Large Language Models (LLMs) proliferate, the ability to distinguish between human and machine-generated text (MGT) has become critical. However, existing detectors often fail when encountering text from domains outside their training set—a phenomenon known as domain shift. This paper introduces DEER (Disentangled mixture-of-ExpeRts), a novel framework designed to decouple domain-specific stylistic features from universal machine-generation signatures. By employing a two-stage architecture and reinforcement learning-guided routing, DEER achieves significant performance gains in cross-domain detection, outperforming state-of-the-art baselines by 5.32% in F1-score on unseen domains.

Introduction

The rapid evolution of LLMs like GPT-4 and Llama 3 has initiated a "cat-and-mouse" game between generators and detectors. A primary hurdle for current detection systems is the entanglement of domain-specific artifacts (e.g., the formal syntax of news) with the intrinsic patterns of machine generation. When a detector trained on news articles encounters creative stories, it often misidentifies the change in style as a change in the generation source. DEER addresses this by disentangling these features, allowing the model to focus on the "signal" of the generator while ignoring the "noise" of the topic.

Methodology

DEER utilizes a modular architecture divided into two primary training stages to ensure both specialization and adaptability.

1. Disentangled Mixture-of-Experts (DMoE) Training

In the first stage, the framework trains a set of specialized experts. Domain-specific experts are tasked with learning the nuances of particular areas (e.g., News, Science), while domain-shared experts focus on universal machine-generation signatures that persist across all domains. By using domain labels during training to force this specialization, the model effectively decouples stylistic representations from machinization signatures.

2. RL-Guided Instance-Adaptive Routing

A significant challenge in real-world detection is the absence of domain labels for arbitrary input text. DEER overcomes this using Reinforcement Learning (RL) to train a policy network. This network dynamically analyzes an input and decides which experts are most relevant. The policy is optimized based on a "reward" tied to final detection accuracy, enabling the system to adapt to new, unseen domains on the fly without requiring pre-defined labels.

The DEER framework overview, illustrating the two-stage training process and the RL-guided routing mechanism for inference.

Experimental Setup

The study evaluates DEER using the MAGE benchmark, which encompasses a wide variety of text sources:

  • Source Domains (In-Domain): Xsum (News), HellaSwag (Commonsense), SQuAD (Wikipedia Q&A), Yelp (Reviews), and Sci (Scientific papers).
  • Unseen Domains (Out-of-Domain): CMV (Reddit "Change My View"), ELI5 ("Explain Like I'm Five"), WP (Writing Prompts), TLDR (Summaries), and ROCT (Reddit comments).

Results and Analysis

DEER was benchmarked against eleven state-of-the-art methods, including Ghostbuster, Binoculars, and RoBERTa-base.

Performance and Generalization

As shown in the experimental results, DEER consistently outperformed all baselines. It achieved an average F1-score of 93.49% on in-domain tasks and 85.70% on out-of-domain tasks. Notably, on unseen domains, DEER provided a 5.32% F1-score improvement over the strongest existing baseline, demonstrating superior generalization capabilities.

Comparative performance analysis of DEER against various detection methods on the MAGE benchmark, highlighting its superior accuracy and F1-scores across both in-domain (IND-MGT) and out-of-domain (DG-MGT) datasets.

Efficiency and Robustness

Beyond accuracy, DEER proved to be highly efficient. In incremental learning scenarios, it reduced training time by 40.9% and GPU memory usage by 49.0% compared to standard fine-tuning. The model also exhibited robustness against text perturbations (e.g., word replacement), suggesting it captures deep structural patterns rather than surface-level keywords.

Discussion and Future Work

While DEER represents a significant step forward, its performance is currently linked to the underlying RoBERTa-base encoder. Future work may involve exploring more advanced backbones. Additionally, as LLMs evolve to produce more human-like text through techniques like RLHF, the "universal signatures" identified by DEER will need continuous refinement. Nevertheless, the modular nature of the DMoE architecture allows for easy updates—adding a new domain expert is 89.6% more parameter-efficient than full-model retraining, making DEER a scalable solution for the evolving landscape of AI-generated content.

Summary updated

BibTeX
@misc{ma2025deer,
  author = {Guoxin Ma and Xiaoming Liu and Zhanhan Zhang and Chengzhengxu Li and Shengchao Liu and Yu Lan},
  title = {{DEER: Disentangled Mixture of Experts with Instance-Adaptive Routing for Generalizable Machine-Generated Text Detection}},
  year = {2025},
  eprint = {2511.01192},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.01192},
}
Figure