Routing by Analogy: kNN-Augmented Expert Assignment for Mixture-of-Experts

Boxuan Lyu, Soichiro Murakami, Hidetaka Kamigaito, Peinan Zhang
1/5/2026
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Mixture-of-Experts (MoE) architectures scale large language models efficiently by employing a parametric "router" to dispatch tokens to a sparse subset of experts. Typically, this router is trained once and then frozen, rendering routing decisions brittle under distribution shifts. We address this limitation by introducing kNN-MoE, a retrieval-augmented routing framework that reuses optimal expert assignments from a memory of similar past cases. This memory is constructed offline by directly optimizing token-wise routing logits to maximize the likelihood on a reference set. Crucially, we use the aggregate similarity of retrieved neighbors as a confidence-driven mixing coefficient, thus allowing the method to fall back to the frozen router when no relevant cases are found. Experiments show kNN-MoE outperforms zero-shot baselines and rivals computationally expensive supervised fine-tuning.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lyu2026routing,
  title  = {Routing by Analogy: kNN-Augmented Expert Assignment for Mixture-of-Experts},
  author = {Boxuan Lyu and Soichiro Murakami and Hidetaka Kamigaito and Peinan Zhang},
  year   = {2026},
  eprint = {2601.02144},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.02144v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.02144.svg)](https://codeofpaper.com/paper/2601.02144)

Discussion