NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Oracle-MoE: Locality-preserving Routing in the Oracle Space for Memory-constrained Large Language Model Inference

Jixian Zhou, Fang Dong, Ruijun Huang, Hengjie Cao, Mengyi Chen, Yifeng Yang, Anrui Chen, Mingzhi Dong, Yujiang Wang, Dongsheng Li, David A. Clifton, Qin Lv, Rui Zhu, Chun Zhang, Fan Yang, Tun Lu, Ning Gu, Li Shang

TL;DR

Oracle-MoE is a novel architecture designed to fix the "expert swapping" bottleneck that plagues Mixture-of-Experts (MoE) models on edge devices. By routing tokens based on shared high-level semantic groups rather than individual token embeddings, it drastically reduces memory I/O overhead, achieving up to a 20x speedup in inference latency without sacrificing model accuracy.

The Bottleneck: "Jittery" Routing on Edge Devices

Mixture-of-Experts (MoE) models are theoretically perfect for edge devices (like smartphones or embedded modules) because they only activate a small fraction of their parameters (the "experts") for any given input. In theory, you only need enough memory to hold the active experts.

In practice, however, standard MoE routing is highly "jittery." Because routing is based on individual token embeddings—which are heavily influenced by the specific identity of a word—consecutive tokens in a sentence often trigger completely different experts. On memory-constrained hardware, this forces the system to constantly swap experts in and out of the GPU memory.

Latency breakdown and scattered expert activations in standard MoE models.

The authors found that this I/O overhead accounts for 50% to 85% of total inference latency, making MoE models 15 to 30 times slower than they would be if all experts fit in memory.

The Solution: Oracle-MoE and Semantic Routing

To solve this, the authors introduce Oracle-MoE, which shifts routing from the "token level" to the "semantic level."

  1. Semantic Locality: The core insight is that human language has "semantic locality"—consecutive tokens usually share a high-level meaning even if the specific words change.
  2. Oracle Space: Instead of routing each token individually, the model uses attention scores to identify "semantic groups"—clusters of tokens that share high-level context.
  3. Group-Based Routing: The model calculates a Semantic Group Embedding (the average embedding of tokens in a group). It then projects these into a compact "Oracle Space" using Singular Value Decomposition (SVD) and K-means clustering.
  4. Stability: Because the high-level semantic meaning of a sentence changes much more slowly than individual words, the routing decision stays stable. This allows the same experts to remain in memory for hundreds of tokens, nearly eliminating the need for frequent swapping.

Key Insights: Attention as a Map

Standard MoE routers are often distracted by "token identity noise." By averaging embeddings within a semantic group, Oracle-MoE filters out this noise, leaving a stable signal for the router to follow.

Using attention score matrices to identify and group tokens into semantic units.

The paper cleverly uses the existing attention matrix as a "causal graph" to define these semantic groups. If two tokens have a high mutual attention score, they likely belong to the same semantic unit. The authors proved theoretically that routing in this "Oracle Space" is mathematically bound to provide better locality. In their experiments, they saw "activation inconsistency" (how often the expert changes) drop from ~75% in standard models to just ~5% in Oracle-MoE.

Performance and Results

The researchers evaluated Oracle-MoE across pretraining datasets (OpenwebText) and downstream tasks including TriviaQA, GLUE, MAG, Sci-Cite, and XSum.

  • Massive Speedups: On an NVIDIA Jetson Xavier NX (8GiB RAM), Oracle-MoE achieved state-of-the-art inference speeds. For a 729M parameter model where only 25% of experts could fit in memory, Oracle-MoE was nearly as fast as a "full memory" model, while the standard Switch Transformer was 20x slower.
  • First Token Latency: Oracle-MoE reduced the time to generate the first token from ~12.7 seconds (using existing optimizations like SwapMoE) to just 4.9 seconds.
  • No Accuracy Trade-off: Across all downstream tasks, Oracle-MoE maintained or slightly exceeded the zero-shot performance of standard token-level MoE models. This suggests that semantic-level routing is not just faster, but potentially more "logical" for the model.

Limitations and Future Work

  • Expert Prediction: While Oracle-MoE makes expert activation consistent, future work could involve "look-ahead" loading—predicting which expert will be needed next at a shallower layer to hide loading latency entirely.
  • Hardware Specifics: The study focused on NVIDIA Jetson hardware. While the principles are general, specific performance gains might vary on different NPU architectures (like Apple's Neural Engine or Qualcomm's Hexagon) which have different memory-handling APIs.
  • Scaling to "Mega" Models: The experiments scaled up to 2B parameters. Testing whether these semantic groups remain as stable in 70B+ parameter models is a logical next step for the industry.

Summary updated

BibTeX
@inproceedings{zhou2025oracle,
  author = {Jixian Zhou and Fang Dong and Ruijun Huang and Hengjie Cao and Mengyi Chen and Yifeng Yang and Anrui Chen and Mingzhi Dong and Yujiang Wang and Dongsheng Li and David A. Clifton and Qin Lv and Rui Zhu and Chun Zhang and Fan Yang and Tun Lu and Ning Gu and Li Shang},
  title = {{Oracle-MoE: Locality-preserving Routing in the Oracle Space for Memory-constrained Large Language Model Inference}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=wn6WHREK9k},
}
Figure