Mixture-of-Expert Blocks Contain Strong Hallucination Detection Signals
Organizations: INESC-ID, Rua Alves Redol, 9, Lisbon, 1000-029 Portugal · Instituto Superior Técnico
Abstract
Despite their widespread use, Large Language Models (LLMs) remain limited by a fundamental problem: the generation of plausible but false content, known as hallucinations. Most existing detection methods operate at the answer or sentence level, yet per-token detection is essential for localizing hallucinated spans and enabling fine-grained interventions. In this paper, we explore the use of the Mixture-of-Experts (MoE) paradigm to address this gap. In MoE architectures, a single forward pass activates a sparse subset of experts (i.e., distinct feedforward networks per layer) via a routing mechanism, producing internal signals (e.g., router entropy, expert disagreement, and expert usage patterns) that are unavailable in dense architectures and have not been previously exploited for hallucination detection. To this end, we introduce InnerExpert, the first method to leverage these MoE-specific signals for per-token hallucination detection. InnerExpert combines routing-level and standard transformer signals into compact per-token feature vectors, classified by a lightweight detector trained on labels produced by an LLM-as-a-judge pipeline, which enables continuous model updates without manual annotation. Our results show that InnerExpert outperforms existing methods across five datasets and two MoE architectures, achieving up to 0.91 answer-level and 0.76 token-level AUROC, while requiring only a single forward pass.
Figures & tables
| FQA | NQO | RTQA | SQuAD | TQA | Rank | Avg | |
| Gemma-4-26B | |||||||
| IE (LR) | 0.705 | 0.635 | 0.759 | 0.785 | 0.740 | 3.0 | 0.725 |
| IE (MLP) | 0.710 | 0.662 | 0.756 | 0.806 | 0.715 | 2.6 | 0.730 |
| IE (RF) | 0.638 | 0.651 | 0.749 | 0.788 | 0.724 | 3.6 | 0.710 |
| IE (Transf.) | 0.656 | 0.619 | 0.716 | 0.760 | 0.722 | 4.6 | 0.694 |
| IE (XGB) | 0.711 | 0.678 | 0.805 | 0.802 | 0.767 | 1.2 | 0.753 |
| FQA | NQO | RTQA | SQuAD | TQA | Rank | Avg | |
| Gemma-4-26B | |||||||
| HaluNet | 0.836 | 0.835 | 0.937 | 0.945 | 0.952 | 3.2 | 0.901 |
| IE (LR) | 0.847 | 0.790 | 0.927 | 0.933 | 0.963 | 3.8 | 0.892 |
| IE (MLP) | 0.866 | 0.780 | 0.939 | 0.943 | 0.952 | 3.0 | 0.896 |
| IE (RF) | 0.752 | 0.832 | 0.870 | 0.919 | 0.937 | 5.8 | 0.862 |
| IE (Transf.) | 0.813 | 0.854 | 0.902 | 0.883 | 0.947 | 5.0 | 0.880 |
| OLMoE-1B-7B | Gemma-4-26B | |||
| Method | Answer | Token | Answer | Token |
| Inv. Herfindahl | 0.685 | 0.675 | 0.784 | 0.602 |
| Exp. Entropy | 0.613 | 0.574 | 0.884 | 0.591 |
| Exp. Gini | 0.599 | 0.561 | 0.824 | 0.626 |
| Expert Hidden | 0.693 | 0.640 | 0.722 | 0.466 |
| Expert Similarity | 0.397 | 0.442 | 0.717 | 0.437 |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| Signal | Notation | Category | Description | Per-token dim. |
| Hidden state score | Standard | Mean log-singular-value of hidden state covariance | ||
| Attention score | Standard | Log-cumulative sum of attention kernel diagonal | ||
| Router entropy | MoE | Shannon entropy of gating distribution | ||
| Expert hidden score | MoE | Routing-weighted hidden score of selected experts | ||
| Expert similarity | MoE | Routing-weighted pairwise cosine similarity of experts | ||
| Expert usage | MoE | Cumulative routing-weighted usage distribution |
| Model | Params | Act. | ||||
| OLMoE-1B-7B-0924-Instruct | 16 | 16 | 64 | 1 360 | 7B | 1B |
| Gemma-4-26B-A4B-it | 30 | 16 | 129 | 4 470 | 26B | 4B |
| Dataset | N | Base | Eviden. | Halluc. | Grounded | Halluc. % | Ans. |
| Gemma-4-26B | |||||||
| SQuAD | 400 | 200 | 200 | 172 | 228 | 43.0 | 17.1 |
| TQA | 399 | 199 | 200 | 194 | 205 | 48.6 | 19.2 |
| NQO | 400 | 200 | 200 | 233 | 167 | 58.2 | 16.0 |
| FQA | 400 | 200 | 200 | 226 | 174 | 56.5 | 13.3 |
| RTQA | 730 | 365 | 365 | 397 | 333 | 54.4 | 15.3 |
| Classifier | Hyperparameter | Grid |
| Logistic Regression | ||
| Random Forest | n_estimators | |
| max_depth | ||
| min_samples_leaf | ||
| XGBoost | n_estimators | |
| max_depth |
| LLM-as-a-judge | Grounded | Hallucinated | Total |
| Human | |||
| Grounded | 93 | 20 | 113 |
| Hallucinated | 7 | 80 | 87 |
| Total | 100 | 100 | 200 |
| Weak heuristic | Grounded | Hallucinated | Total |
| Human |
| Confidence | OLMoE (%) | Gemma (%) |
| [0.0, 0.2[ | 36 (0.9 %) | 220 (9.6 %) |
| [0.2, 0.4[ | 598 (15.5 %) | 88 (3.8 %) |
| [0.4, 0.6[ | 230 (6.0 %) | 33 (1.4 %) |
| [0.6, 0.8[ | 121 (3.1 %) | 71 (3.1 %) |
| [0.8, 1.0] | 2862 (74.4 %) | 1877 (82.0 %) |
| Total | 3847 ( 100 %) | 2289 ( 100 %) |
| Confidence | OLMoE (%) | Gemma (%) |
| [0.0, 0.2[ | 196 (24.9 %) | 1764 (75.2 %) |
| [0.2, 0.4[ | 531 (67.5 %) | 301 (12.8 %) |
| [0.4, 0.6[ | 44 (5.6 %) | 50 (2.1 %) |
| [0.6, 0.8[ | 6 (0.8 %) | 42 (1.8 %) |
| [0.8, 1.0] | 10 (1.3 %) | 189 (8.1 %) |
| Total | 787 ( 100 %) | 2346 ( 100 %) |
| Condition | N | Halluc. | Grounded | Halluc. % |
| OLMoE-1B-7B | ||||
| Base | 2318 | 2312 | 6 | 99.7 % |
| Evidence | 2318 | 1535 | 783 | 66.2 % |
| Overall | 4636 | 3847 | 789 | 83.0 % |
| Gemma-4-26B | ||||
| Base | 2318 | 1980 | 338 | 85.4 % |
| FQA | NQO | RTQA | SQuAD | TQA | Rank | Avg | |
| Gemma-4-26B | |||||||
| IE (LR) | 0.648 | 0.629 | 0.751 | 0.705 | 0.730 | 2.6 | 0.693 |
| IE (MLP) | 0.646 | 0.625 | 0.681 | 0.718 | 0.706 | 4.0 | 0.675 |
| IE (RF) | 0.571 | 0.575 | 0.756 | 0.706 | 0.774 | 3.2 | 0.676 |
| IE (Transf.) | 0.586 | 0.544 | 0.726 | 0.653 | 0.671 | 5.2 | 0.636 |
| IE (XGB) | 0.175 | 0.116 | 0.782 | 0.139 | 0.168 | 6.6 | 0.276 |
| FQA | NQO | RTQA | SQuAD | TQA | Rank | Avg | |
| Gemma-4-26B | |||||||
| HaluNet | 0.778 | 0.769 | 0.849 | 0.825 | 0.897 | 3.2 | 0.824 |
| IE (LR) | 0.790 | 0.763 | 0.849 | 0.873 | 0.904 | 2.4 | 0.836 |
| IE (MLP) | 0.828 | 0.780 | 0.876 | 0.890 | 0.868 | 2.0 | 0.849 |
| IE (RF) | 0.689 | 0.679 | 0.809 | 0.837 | 0.912 | 4.6 | 0.785 |
| IE (Transf.) | 0.751 | 0.787 | 0.840 | 0.760 | 0.884 | 3.6 | 0.804 |
| OLMoE-1B-7B | Gemma-4-26B | |||
| Method | Time per 100 tok (s) | Peak GPU (GB) | Time per 100 tok (s) | Peak GPU (GB) |
| Vanilla | 1.146 | 12.660 | 3.825 | 46.810 |
| Logit Entropy | 1.152 | 12.670 | 3.830 | 46.880 |
| Perplexity | 1.152 | 12.670 | 3.830 | 47.010 |
| LC (att.) | 1.198 | 12.680 | 3.965 | 46.880 |
| LC (hid.) | 1.246 | 12.670 | 4.133 | 46.830 |
| OLMoE-1B-7B | Gemma-4-26B | |||
| Method | Answer | Token | Answer | Token |
| Inv. Herfindahl | 0.940 | 0.731 | 0.697 | 0.619 |
| Exp. Entropy | 0.881 | 0.639 | 0.748 | 0.671 |
| Exp. Gini | 0.869 | 0.597 | 0.745 | 0.671 |
| Expert Hidden | 0.945 | 0.698 | 0.707 | 0.667 |
| Expert Similarity | 0.945 | 0.634 | 0.740 | 0.523 |
LLM Hallucination Detection
Large language model hallucination detection identifies unsupported, incorrect, or fabricated claims in model outputs and traces.
See all 208 papers