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 · OpenReview

TL;DR

This paper introduces DEER, a novel framework for detecting machine-generated text (MGT) that excels even when the text's domain is unknown. DEER disentangles domain-specific and general MGT detection knowledge into specialized "experts" and uses a smart routing system to pick the best experts for each piece of text, significantly improving accuracy and robustness across diverse domains.

What Problem Does This Paper Address?

The rapid advancement of Large Language Models (LLMs) has made it increasingly difficult to distinguish between human-written and machine-generated text. While current MGT detectors perform well within their training domains, their performance often plummets when faced with text from new, unseen domains. This "domain shift" is a major hurdle for deploying these detectors in real-world scenarios. The authors identify two key reasons for this: 1) during multi-domain training, domain-specific knowledge gets diluted, and 2) existing methods for selecting relevant knowledge at inference time are often misaligned with the actual detection task, prioritizing stylistic similarity over detection utility.

Methods

DEER tackles these problems with a two-stage approach:

  • Disentangled Mixture-of-Experts (DMoE): This is the core architectural innovation. Instead of a single model trying to learn everything, DMoE creates specialized "expert" modules.
  • Domain-Specific Experts: These experts are trained exclusively on data from a single domain, preserving fine-grained, domain-local cues that are crucial for detecting MGT within that specific domain.
  • Domain-Shared Experts: These experts are trained on data from all domains to capture transferable, domain-invariant patterns of machine generation.
  • This disentanglement prevents the dilution of domain-specific knowledge and preserves distinct detection signals.
  • Reinforcement Learning (RL)-Guided Routing Mechanism: A key challenge is selecting the right experts at inference time, especially when the domain is unknown. Traditional methods rely on domain similarity, which the authors found to be unreliable. DEER uses an RL-based router that learns to dynamically select the most useful expert pathways for each instance of text, based on the detection reward it generates. This instance-adaptive routing ensures that the model prioritizes actual detection utility over superficial stylistic matches, making it robust to domain shifts.

Datasets

The authors used datasets from the MAGE benchmark for training and evaluation.

  • Source Domains (for training/validation): Xsum, HellaSwag, SQuAD, Yelp, and Sci.
  • Target Domains (for out-of-distribution evaluation): CMV, ELI5, WP, TLDR, and ROCT.

Key Insights and Ideas

  • Unified training dilutes domain-specific cues: Training a single model on multiple domains can lead to a loss of specialized knowledge that is critical for detecting MGT within individual domains.
  • Similarity-based routing is suboptimal: Relying on how similar an input text is to a training domain doesn't guarantee that the most relevant knowledge for detection will be selected. Detection utility is more important than stylistic similarity.
  • Disentangling knowledge is key for generalization: Separating domain-specific and domain-invariant knowledge into distinct experts allows the model to preserve crucial fine-grained signals.
  • Instance-adaptive routing is crucial for unknown domains: Learning to select experts based on the actual detection performance for each specific text instance, rather than a static domain label, is vital for robust generalization.

Key Results

DEER demonstrates significant improvements over state-of-the-art methods:

  • In-Domain (IND-MGT): Achieved average F1-score improvements of 1.28% and accuracy gains of 1.35%.
  • Out-of-Domain (DG-MGT): Achieved average F1-score improvements of 2.92% and accuracy gains of 2.26%.
  • DEER shows strong robustness against token-level perturbations and DPO-based style alignment attacks, outperforming baselines.
  • The modular design allows for efficient incremental domain adaptation with significantly reduced computational overhead.

Limitations and Future Work

The authors acknowledge three primary limitations:

  • Domain Label Dependency: The DMoE stage requires domain labels for expert specialization, limiting its direct application when such labels are unavailable.
  • Fixed Expert Capacity: The model uses a fixed number of experts, which might not be optimal for all domains or tasks.
  • Predefined Source Domains for Routing: The RL routing mechanism is trained over a fixed set of source domains, and its scalability to a large or evolving domain space needs further exploration.

Future work could focus on extending DEER to scenarios without domain labels, dynamically allocating expert capacity, and exploring more scalable and stable routing mechanisms for dynamic domain spaces.

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