Manuscript Offprint

arXiv:2609.01100

Beyond Magnitude: Contrastive Routing for Modular Mixture-of-Experts

Nikolaos Xiros, Dimitrios Damianos, Maria-Eleni Zoumpoulidi, Leon Voukoutis, Vassilis Katsouros, Georgios Paraskevopoulos

Abstract

In current Mixture-of-Experts architectures, routing is performed based on representations dominated by structure shared across all tokens, limiting expert specialization. We show that contrasting each token against an Exponential Moving Average of the layer's hidden states, rather than routing on absolute magnitude, concentrates the routing signal onto a low-dimensional, highly separable subspace. Building on this, we propose the Contrastive Routing Mechanism (CoRM), which scores each expert by the gap between its affinity for the incoming token and its affinity for this shared reference state, interpreted through a distinct per-expert projection. The resulting experts have routing boundaries that align with linguistic structure significantly more than the Top-kk baseline. Our experiments show that CoRM improves average zero-shot accuracy by +0.67 to +1.69 points (Top-1) and +1.38 to +1.77 points (Top-2) over standard Top-kk MoE baselines on nine zero-shot reasoning benchmarks, at the minimal cost of 2.9% added parameters and 2.6% added FLOPs per token.

1 Introduction

Recently, Mixture-of-Experts (MoE) architectures have emerged as an efficient solution for scaling Transformer-based models (Fedus et al. (2022); Lepikhin et al. (2021)). Placed at each Transformer layer, these architectures replace the standard dense network with a set of independent Multi-Layer Perceptron (MLP) 'experts,' providing multiple specialized computational paths for individual tokens rather than a single, unified computation. More specifically, Sparse Mixture-of-Experts (SMoE) models activate only a small subset of these parameters during inference, allowing for a massive increase in total model capacity without a proportional increase in computational cost (Shazeer et al., 2017). Typically, the selection of which expert to activate is governed by a gating network or router.

For this token-level expert selection to be truly effective, an ideal MoE framework would foster functional modularity, where experts develop distinct specializations across diverse domains (Shen et al., 2023). In such a scenario, each expert acts as a specialist for specific semantic or structural patterns, thereby avoiding representation collapse (Chi et al., 2022), a common failure mode where experts remain undifferentiated and contribute redundantly across all domains.

In this paper we introduce the Contrastive Routing Mechanism (CoRM), reformulating expert selection as a contrastive competition. Rather than routing on absolute magnitude, CoRM scores each expert by the gap between its affinity for the incoming token and its affinity for a dynamic reference state. This formulation moves away from absolute magnitude-based selection toward a contrastive, attention-driven activation. In summary, our main contributions are as follows:

Dynamic Background Absorption via EMA: We propose maintaining a per-layer Exponential Moving Average (EMA) of hidden representations as a dynamic reference state. This baseline continuously tracks the redundant background structure shared across tokens; by subtracting it, the routing signal is concentrated on token-specific content rather than generic corpus-level structure.

Enhanced Modularity and Syntactic Specialization: Through detailed routing decomposition, we show that CoRM naturally drives structurally decorrelated expert projections, learns clean geometric clusters in the latent space, and enforces stricter syntactic specialization compared to standard linear gating.

Improved Zero-Shot Performance: We empirically validate our approach, demonstrating average zero-shot accuracy improvements of +0.67 to +1.69 points (Top-1) and +1.38 to +1.77 points (Top-2) over standard Top-kk baselines across nine language and reasoning benchmarks.

Open-source release: Our code and checkpoints are publicly available at https://github.com/athena-ilsp/CoRM under the Apache 2.0 license.

References (19)