Detectors that tell human writing from text produced by large language models look nearly perfect on the data they were trained on and fail on new topics and new generators. One popular fix splits the detector into several "experts", small sub-networks that each specialise in one kind of text, plus a learned router, the component that decides how much each expert's opinion counts for a given input. The router learns from human-chosen categories such as "news" or "science", and it is trained only on those categories. Two separate literatures predict how this breaks. Work on scaling mixture-of-experts models shows that adding experts eventually hurts, because each one sees less data and routing among many candidates gets harder. Work on multi-criteria decision making shows that weights set by human judgment can be internally consistent and still biased, and that they improve when corrected by how much each criterion actually varies in observed data.
We propose to bring that correction into detectors. At deployment, a detector usually sees a batch of documents from one source, such as one course's essays or one forum's posts. An expert whose scores barely change across that batch is not separating anything there. This holds whether it calls everything human or, as often happens under domain shift, everything machine-written. We weight each expert by the spread of its scores over the unlabeled target batch, using the Entropy Weight Method from decision science, and multiply that by the router's weight. The central empirical question is whether this label-free correction removes the drop in generalisation that appears as the expert pool grows past a handful of human-defined domains.
Core Claim
We make two linked claims. First, out-of-domain accuracy in modular detectors is non-monotonic in the number of domain-specific experts at a fixed training budget. The cause is the data-starvation mechanism documented for general mixture-of-experts models, and the effect is made worse by a router that learned human-assigned domain boundaries. Second, reweighting experts by their score dispersion on an unlabeled target batch pushes the peak outward or flattens the drop. The reason is that this signal gets more useful as there are more experts to choose among, while a learned router's ranking gets less reliable.
The correction borrows its form from the AHP-Entropy hybrid. In that method, subjective importance weights from the Analytic Hierarchy Process (AHP, a procedure where experts compare criteria in pairs) are multiplied by objective weights derived from the data. Let $s_{ik} \in (0,1)$ be expert $k$'s machine-probability for document $i$ in a target batch of $n$ documents. Let $p_{ik} = s_{ik}/\sum_i s_{ik}$ be its normalised share. The normalised Shannon entropy is $H_k = -\frac{1}{\ln n}\sum_i p_{ik}\ln p_{ik}$. The objective weight is $o_k = (1-H_k)/\sum_j (1-H_j)$, and the final weight for document $i$ is
$$w_{ik} = \frac{r_{ik}\, o_k}{\sum_j r_{ij}\, o_j},$$
where $r_{ik}$ is the router's weight. An expert giving near-constant scores has $H_k \approx 1$ and is suppressed. An expert whose scores split the batch into two groups keeps its influence.
Where This Sits
Three lines of work motivate the proposal. The first is the evidence on detector failure. MAGE benchmarks detectors across 27 generators and 10 human sources. It shows a Longformer detector at 96.6% in-distribution accuracy that misclassifies over 60% of human texts as AI on unfamiliar domains, and it traces this to "perplexity bias", the tendency to treat fluent, predictable text as machine-written. M4 builds a multi-generator, multilingual benchmark and finds that detectors trained on other generators struggle badly with text from the BLOOMz model. These failures are confident rather than noisy. That is why we do not weight experts by per-document confidence, as Cyclic Test Time Augmentation with Entropy Weight Method does for image augmentations: a confidently wrong expert would win under that scheme. Our weighting instead follows the original decision-science form of the method, which measures dispersion across samples, as in the AHP-Entropy e-banking study. In that study an expert-assigned weight of 0.910 was pulled down to 0.614 because the corresponding indicator barely varied in the data.
The second line is the scaling evidence, which predicts the peak. Towards a Comprehensive Scaling Law of Mixture-of-Experts fits 446 runs and finds a hook-shaped curve: loss rises again when experts become too small. It reports an optimal of about 7 active experts and a shared-expert ratio near 0.31. Unified Scaling Laws for Routed Language Models shows that the returns from extra experts shrink as the base model grows. Several papers report data starvation when data is split too finely: the WMT21 submission, Hard Mixtures of Experts and DM-Adapter. Others show router ranking degrading as the candidate pool widens: Divide and Grow and Elastic MoE. All of this evidence comes from language modelling, translation or vision. None of it has been measured on a detection task, where the useful signal is supposed to be shared across domains.
The third line supplies the architecture we modify, and it is the closest work. DEER trains domain-specific experts from explicit domain labels alongside shared experts, and adds a router trained by reinforcement learning. It reports 85.70% out-of-domain F1 on MAGE. It uses a small, fixed expert pool, and its routing is shaped entirely by human domain labels and a training reward. MoSEs routes by nearest stylistic prototype, using hand-chosen features such as n-gram repetition, and learns per-document decision thresholds. We differ from both in three ways. We vary expert count deliberately, to find where performance peaks. We treat the human-defined partition as a subjective prior to be corrected, not as ground truth. And we correct it with a signal computed on the deployment batch itself, without labels. Nash Bargaining for Gate-Free Mixture-of-Experts removes the router altogether. We keep the router and ask whether an objective correction is enough.
Two known weaknesses of entropy weighting constrain the design. The first is variance blindness. When the batch is almost all human text, a good expert also shows little spread, so the objective weight becomes unreliable at low machine-text rates. We test that regime explicitly and do not assume it away. The second is topic dispersion. Scores from an expert that has learned topic shortcuts will vary across a mixed-topic batch, and that expert would be rewarded. We therefore evaluate single-source batches, which is the realistic deployment unit, and mixed-source batches separately.
Research Program
We will build a DEER-style detector on a shared encoder: shared experts, domain-specific adapter experts, and a learned router. We use two encoders, RoBERTa-base as in DEER and ELECTRA-base, since M4 found ELECTRA generalises better across domains. Training uses MAGE's in-distribution split with total training tokens held fixed.
The first study maps the scaling curve. We grow the pool of domain-specific experts from 2 to 32 by refining the human partition from source domain, to domain × generator family, to domain × generator family × prompt type. We also sweep the fraction of shared experts. We will then fit the loss-versus-expert-count curve to test whether a hook appears. We will also test whether the peak tracks tokens per expert rather than parameters per expert, by rerunning with the same splits on half and double the data. We additionally predict that the best shared fraction for detection sits well above the 0.31 found for general models, because the detection signal should mostly be shared across domains. Observing that would itself be informative about what these detectors learn.
The second study adds the dispersion correction to every configuration. It compares three weighting schemes: the router alone, dispersion weights alone, and their product. It also measures whether the correction's benefit grows with pool size.
The third study probes when the correction fails. It varies batch size from 16 to 512, the machine-text rate from 50% to 5%, document length (full versus 125 characters, following M4's short-snippet setting), and single-source versus mixed-source batches.
Baselines
The naive reference is a single dense ELECTRA-base detector fine-tuned on the same MAGE training data with the same number of optimisation steps and the same hyperparameter search budget. If no modular variant beats it out of domain, the whole direction is moot. The second reference is uniform averaging over the same trained expert pool. It isolates whether any weighting helps at all.
The strongest existing modular method is DEER. The file gives its out-of-domain average F1 on MAGE as 85.70%, 5.32 points above its strongest baseline (DEER). We will rerun DEER with its published expert count on our splits and encoder, and report both our reproduction and the paper's figure. Beating it means exceeding our reproduced DEER on MAGE unseen domains and on M4 leave-one-generator-out, BLOOMz included, across three seeds. We also require the gap to widen as the pool grows past DEER's size; a win only at DEER's size would not support the claim.
MoSEs is the strongest method that adapts thresholds per document. It reports an 11.34% average improvement across eight datasets (MoSEs). We run it with the same 200-sample reference repository size it uses in its low-data setting.
MAGE's boundary adjustment uses labelled target data to recalibrate the threshold of a dense detector. It raised recall on unseen generators such as GPT-4 to over 80% (MAGE). We run it with 4 and with 0.1% labelled target examples. Our method uses zero labels, so this is an upper reference rather than a like-for-like competitor.
Two ablations isolate the key ingredient. The first replaces batch dispersion with per-document confidence, the cyclic test-time-augmentation variant. That paper's gain was small in its own setting: 10-crop mean corruption error went from 73.57 to 73.34 (Cyclic TTA with EWM). The second computes dispersion on the training set instead of the target batch, which tests whether the benefit comes from seeing the deployment data.
For Werkzeug's gated fine-tuning (Werkzeug), no reported result was found on Lacuna. We include it only if code is available.
Why not just…?
Why not just recalibrate the threshold of one dense model? MAGE's own evidence says much of the failure is a misplaced decision boundary. This is the most serious threat. Boundary adjustment, however, needs labelled target examples. There is also an unlabeled analogue that sets the threshold at the gap between score clusters in the target batch. We will implement it as a baseline, because it uses the same batch information as our method. If that single-threshold shift matches our method, then per-expert weighting adds nothing, and we will report the result as a negative finding about modular detectors.
Why not just use ELECTRA and drop the experts? M4 found ELECTRA more robust across domains, but it still failed on BLOOMz. DEER reports modular gains over a dense RoBERTa model. The dense-ELECTRA baseline and the ELECTRA-encoder runs settle this directly. If the peak in the scaling curve sits at two or three experts, the honest conclusion is that a dense model is nearly optimal.
Why not just train a bigger or better router? MoE-SPNet reports diminishing returns from larger gating networks. Elastic MoE reports that ranking degrades as the candidate pool widens. A router trained only on source domains also cannot see the target. Even so, we will run a router with twice the parameters as an extra comparison, so this is tested rather than argued.
Why not just use a zero-shot geometric detector? Intrinsic dimension estimation finds human text at about dimension 9 versus about 7.5 for AI text. It reaches 40% detection at 1% false positive rate on GPT-3.5 and holds up under paraphrasing. It does this without training, which makes it complementary rather than competing. We add it as one more expert in the pool. If the dispersion weights learn to rely on it under generator shift, that supports the method. If it alone beats the full system on BLOOMz, we report that.
Decisive Experiments
The first check is whether a hook exists at all. On MAGE unseen domains, out-of-domain F1 of the router-only system must peak at an intermediate expert count and then fall. The peak must also move when data per expert changes. Without that, the scaling motivation fails.
The second check is whether dispersion weighting flattens the drop. At 16 and 32 experts, the router × dispersion system must stay within one F1 point of its own best configuration while the router-only system falls further. The per-document confidence ablation must not reproduce this pattern.
The third check targets the known weaknesses. At a 5% machine-text rate we expect the benefit to shrink. At batch sizes below 32 the entropy estimate becomes noisy, because the entropy is normalised by $\ln n$ and has few terms. In mixed-topic batches the correction may reward topic-shortcut experts. We will report the rate and batch-size thresholds below which the method should not be used. A method that helps only in balanced, single-source batches of hundreds of documents is still useful for platform-level screening, but we will say so plainly rather than claim general robustness.
The metrics throughout are F1, AUROC, and detection rate at 1% false positive rate. The last one matters most when a false accusation falls on a human writer. We report them on MAGE out-of-domain splits, on M4 leave-one-generator-out, and on MAGE's paraphrased test set, where AUROC has been reported to fall from 0.94 to 0.75.
References
- MAGE: Machine-generated Text Detection in the Wild
- M4: Multi-generator, Multi-domain, and Multi-lingual Black-Box Machine-Generated Text Detection
- Cyclic Test Time Augmentation with Entropy Weight Method
- The Research of Electronic Banking Risk Evaluation Based on Comprehensive Assessment AHP-Entropy
- Towards a Comprehensive Scaling Law of Mixture-of-Experts
- Unified Scaling Laws for Routed Language Models
- Facebook AI's WMT21 News Translation Task Submission
- Hard Mixtures of Experts for Large Scale Weakly Supervised Vision
- DM-Adapter: Domain-Aware Mixture-of-Adapters for Text-Based Person Retrieval
- Divide and Grow: Capturing Huge Diversity in Crowd Images With Incrementally Growing CNN
- Elastic MoE: Unlocking the Inference-Time Scalability of Mixture-of-Experts
- DEER: Disentangled Mixture of Experts with Instance-Adaptive Routing for Generalizable Machine-Generated Text Detection
- MoSEs: Uncertainty-Aware AI-Generated Text Detection via Mixture of Stylistics Experts with Conditional Thresholds
- Nash Bargaining for Gate-Free Mixture-of-Experts
- Werkzeug at SemEval-2024 Task 8: LLM-Generated Text Detection via Gated Mixture-of-Experts Fine-Tuning
- MoE-SPNet: A mixture-of-experts scene parsing network
- Intrinsic Dimension Estimation for Robust Detection of AI-Generated Texts