Ada-K Routing: Boosting the Efficiency of MoE-based LLMs

Tongtian Yue, Longteng Guo, Jie Cheng, Xuange Gao, Jing Liu
10/14/2024
cs.CL

No official code found. Best implementation: ivattyue/Ada-K (12 stars, last commit 2025-03-01).

Abstract

In the era of Large Language Models (LLMs), Mixture-of-Experts (MoE) architectures offer a promising approach to managing computational costs while scaling up model parameters. Conventional MoE-based LLMs typically employ static Top-K routing, which activates a fixed and equal number of experts for each token regardless of their significance within the context. In this paper, we propose a novel Ada-K routing strategy that dynamically adjusts the number of activated experts for each token, thereby improving the balance between computational efficiency and model performance. Specifically, our strategy incorporates learnable and lightweight allocator modules that decide customized expert resource allocation tailored to the contextual needs for each token. These allocators are designed to be fully pluggable, making it broadly applicable across all mainstream MoE-based LLMs. We leverage the Proximal Policy Optimization (PPO) algorithm to facilitate an end-to-end learning process for this non-differentiable decision-making framework. Extensive evaluations on four popular baseline models demonstrate that our Ada-K routing method significantly outperforms conventional Top-K routing. Compared to Top-K, our method achieves over 25% reduction in FLOPs and more than 20% inference speedup while still improving performance across various benchmarks. Moreover, the training of Ada-K is highly efficient. Even for Mixtral-8x22B, a MoE-based LLM with more than 140B parameters, the training time is limited to 8 hours. Detailed analysis shows that harder tasks, middle layers, and content words tend to activate more experts, providing valuable insights for future adaptive MoE system designs. Both the training code and model checkpoints will be publicly available.

View on arXivView PDF

Code Implementations(1)

ivattyue/Ada-KCommunity71%

Official code for the ICLR 2025 paper, "Ada-K Routing: Boosting the Efficiency of MoE-based LLMs"

121Mar 1, 20251 years ago

Similar Papers

Cite this paper

@article{yue2024adak,
  title  = {Ada-K Routing: Boosting the Efficiency of MoE-based LLMs},
  author = {Tongtian Yue and Longteng Guo and Jie Cheng and Xuange Gao and Jing Liu},
  year   = {2024},
  eprint = {2410.10456},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.10456v2}
}

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/2410.10456.svg)](https://codeofpaper.com/paper/2410.10456)

Discussion