ExpertLens: Visualizing Embedding Spaces for Post-Hoc Explainability in MoE Enhanced Retrievers

Effrosyni Sokli, Isaac Roberts, Alexander Schulz, Barbara Hammer, Gabriella PasiarXiv 2026

TL;DR

ExpertLens is a new post-hoc explainability framework designed to demystify Mixture-of-Experts (MoE)-enhanced dense retrievers. By shifting the focus from local feature importance to global embedding space geometry, it reveals how expert routing structurally reorganizes representations and demonstrates that experts specialize based on linguistic complexity rather than isolated semantic topics.

What Problem Does This Paper Address?

Dense retrievers map queries and documents into high-dimensional embedding spaces to capture deep semantic relationships, but they traditionally operate as black boxes. Recently, Mixture-of-Experts (MoE) architectures have been integrated into these models to scale them efficiently by dynamically routing inputs to specialized sub-networks (experts).

However, understanding how these routing decisions shape the underlying embedding space remains a major challenge. Traditional explainability methods (like SHAP or LIME) focus on local feature attributions—such as calculating individual token weights—which fails to explain the global geometric structure and representation-level dynamics induced by MoE routing.

Methods

The authors introduce ExpertLens, a global, representation-level post-hoc explainability framework broken down into three distinct phases:

  1. Phase I: MoE Induced Embedding Space Structure & Analysis: Uses DeepView, a discriminative dimensionality reduction technique. By distilling a classifier from the model's internal gating mechanism, DeepView projects the high-dimensional space into 2D while preserving expert routing boundaries (a task where standard unsupervised methods like UMAP fail).
  2. Phase II: Subspace Disentanglement & Expert Specialization: Applies DBSCAN clustering to the 2D projections to identify expert-aligned document clusters. It then profiles these clusters using five corpus-level linguistic metrics (e.g., Automated Readability Index, Shannon's Entropy, and vocabulary diversity) to characterize the textual properties each expert handles.
  3. Phase III: Concept Extraction & Expert Attribution: Trains a Sparse Autoencoder (SAE) to extract Concept Activation Vectors (CAVs). An LLM (Gemma-3-27b) automatically labels these concepts based on top-activating queries, and Sankey diagrams map how these concepts propagate across different experts.
Figure 1: The ExpertLens framework. Phase I: Visualization of the MoE induced embedding space through discriminative DeepView projections for structure analysis. Phase II: Examination of the partitioning of the embedding space into subspaces and association with expert specialization. Phase III: CAVs are automatically extracted and mapped to individual experts.

Datasets

The framework was evaluated across five standard Information Retrieval (IR) benchmarks spanning passage retrieval and open-domain question answering:

  • MSMARCO v1 (passage corpus)
  • TREC Deep Learning Track 2019 & 2020
  • Natural Questions (NQ)
  • HotpotQA

The framework was tested on two MoE-enhanced dense retrievers (SB-MoE and DenseC3) instantiated across four encoder backbones: TinyBERT, BERT-Small, BERT-Base, and ColBERT.

Key Insights and Ideas

  • Routing Improves Geometry: MoE routing does more than just distribute compute; it structurally reorganizes the embedding space. It pulls relevant documents into closer relative proximity to their corresponding queries, while simultaneously expanding the absolute geometric spread (increasing overall cosine distance) of the space.
  • Linguistic over Semantic Specialization: Surprisingly, experts do not specialize in isolated semantic topics (e.g., an expert for sports and an expert for history). Instead, their specialization boundaries are formed by the intrinsic linguistic complexity of the text.
  • The Dominant vs. Minority Expert Dynamic: Across datasets, a single "dominant" expert handles the vast majority of average, structurally simple text. Meanwhile, "minority" experts are selectively triggered by lexically rich, complex text exhibiting high information entropy and vocabulary diversity.
  • Distributed Concepts: Because real-world documents contain multiple overlapping themes, semantic concepts are broadly distributed across multiple experts rather than being neatly partitioned.

Key Results

  • Quantitative Neighborhood Improvements: MoE variants consistently outperformed standard fine-tuned bi-encoders in Precision@k (P@k). Notably, the supervised MoE variant (DenseC3) achieved a 14.78% gain in P@1 over the standard fine-tuned baseline on the NQ dataset using a TinyBERT backbone.
  • DeepView vs. UMAP: Standard UMAP completely obscures expert routing structures, causing neighborhood consistency ($\text{Q}_{\text{knn}}$) to deteriorate to 0.455. DeepView successfully separates the expert-assigned subspaces, maintaining a stable $\text{Q}_{\text{knn}}$ of 0.096.
Embedding space visualization comparison across model variants

Limitations and Future Work

  • Computational Constraints: Due to the high computational cost of training Sparse Autoencoders (SAEs) and running per-query clustering, Phases II and III of the framework were only evaluated on the smaller TinyBERT backbone. Scaling this analysis to larger backbones like BERT-Base or ColBERT remains future work.
  • Simplified Concept Labeling: To ensure clean, concise summaries, the LLM concept labeling relies on top-activating queries rather than full documents. The authors acknowledge that this simplification risks capturing narrower semantic themes than what the full document text might otherwise reveal.

Summary updated

BibTeX
@misc{sokli2026expertlens,
  author = {Effrosyni Sokli and Isaac Roberts and Alexander Schulz and Barbara Hammer and Gabriella Pasi},
  title = {{ExpertLens: Visualizing Embedding Spaces for Post-Hoc Explainability in MoE Enhanced Retrievers}},
  year = {2026},
  eprint = {2609.06155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.06155},
}
Figure