Introduction
While Large Language Models (LLMs) are incredible at generating text, they are notoriously mediocre at acting as "embedding models"—tools that turn text into numerical vectors for tasks like search, clustering, or similarity checks.
The reason lies in their architecture. Most modern LLMs are "decoder-only," trained specifically to predict the next token. This focus often means their internal representations (hidden states) are biased toward the end of a sentence or the immediate next word, rather than capturing the holistic meaning of the entire input. To get good embeddings, researchers usually have to perform "representation fine-tuning," which is computationally expensive and requires massive labeled datasets.
This paper reveals that Mixture-of-Experts (MoE) LLMs contain a "secret" source of high-quality text embeddings: their internal routing weights. By combining these routing decisions with standard hidden states, the authors introduce MoEE (MoE Embedding), a training-free method that significantly boosts LLM performance on embedding tasks, making them true "generalists" without the need for expensive fine-tuning.
The MoEE Approach
The researchers focused on Mixture-of-Experts (MoE) models. In these architectures, instead of every input passing through every neuron, a "router" decides which specialized "experts" (sub-networks) should process a specific token.
The proposed MoEE method leverages two key components:
- Routing Weights (RW): The probabilities assigned by the routers across all layers are extracted. This essentially captures the "reasoning path" the model took to process the text.
- Hidden States (HS): The standard representation from the model's last layer.
Instead of simply concatenating these two vectors, the authors found that the best results come from computing the similarity of RW and HS separately, and then taking a weighted sum of those scores. To make the embeddings even sharper, they utilized a technique called PromptEOL (Prompt with Explicit One Word Limitation). By prompting the model with a phrase like "This sentence: [text] means in one word:", they force the LLM to distill the entire meaning of the input into the final token's representation.
Key Insights: Why Routing Weights Matter
A major "aha" moment in the study is the discovery that Routing Weights and Hidden States are highly complementary. Hidden states focus on the final prediction (the "what"), while routing weights reflect the intermediate reasoning choices (the "how").
As shown in the failure case analysis above, when one representation fails to capture the correct similarity, the other often succeeds. Combining them unlocks a significant upper bound of new success cases. Furthermore, analysis showed that routing weights are better at capturing high-level themes and underlying semantic structures, whereas hidden states are more sensitive to formal linguistic consistency and superficial changes. Routing Weights also proved to be significantly more stable and robust to different prompt formulations—a common headache in LLM research.
Performance and Results
The authors evaluated MoEE using the Massive Text Embedding Benchmark (MTEB), testing across 20 different datasets covering six core task types: Classification, Clustering, Pair Classification, Re-ranking, Semantic Textual Similarity (STS), and Summarization. They tested three prominent MoE models: DeepSeekMoE-16B, Qwen1.5-MoE-A2.7B, and OLMoE-1B-7B.
The improvements were consistent and substantial across the board. For instance, using MoEE on DeepSeekMoE-16B improved the average MTEB score from 35.36 (using just hidden states) to 43.30—a relative improvement of over 22%. When combined with PromptEOL, MoEE actually outperformed several well-known supervised embedding models (like SimCSE and coCondenser) that were specifically trained for these tasks. Crucially, this method requires zero additional parameters and zero training, acting as a "free lunch" that simply uses information the model is already calculating during a standard forward pass.
Limitations and Future Work
While highly effective, the authors identify a few areas for future improvement. The PromptEOL method is designed to condense meaning into a single word, which works exceptionally well for sentences but might struggle with very long paragraphs or documents. Future work could explore "multi-token sinks" or segmenting longer texts to maintain embedding quality for massive inputs. Additionally, while the current method tunes a static weight between RW and HS similarities, developing a way for the model to automatically and adaptively adjust this balance based on the specific task type could further boost performance.
Summary updated