Cache Management for Mixture-of-Experts LLMs - extended version

Spyros Angelopoulos, Loris Marchal, Adrien Obrecht, Bertrand SimonarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have reached scales where fitting all parameters into fast GPU memory is increasingly difficult. Mixture-of-Experts (MoE) architectures mitigate this by activating only a subset of specialized "experts" for each token. However, since the total set of experts is still massive, they must be swapped between slow secondary memory (RAM/disk) and fast GPU cache on demand.

The sequential, layered structure of MoE-based LLMs, where each layer contains an MoE module with multiple experts.

The core challenge lies in the inefficiency of standard caching algorithms like Least Recently Used (LRU), which ignore the inherent structure of LLM inference. In an LLM, a token moves predictably through a sequence of layers ($L_1, L_2, \dots, L_\ell$). This paper addresses this gap by formalizing the layered paging problem and proposing a specialized solution.

The Layered Paging Framework

The authors define a formal model where requests are organized into rounds. In each round (corresponding to a token), the system must fetch experts from a sequence of layers. This structure provides a "future-knowledge-by-design" that generic paging algorithms fail to exploit.

The layered paging problem visualized as paths through a grid of experts across different layers ($L_1$ to $L_4$).

A key finding is that fixed partitioning—allocating a static portion of the cache to each layer—is suboptimal. The authors prove that such strategies have an unbounded competitive ratio, as they cannot adapt to varying expert popularity across different layers. Instead, a dynamic approach that understands the layer cycle is required.

The LLRU Algorithm

To solve this, the paper introduces Layered Least Recently Used (LLRU). LLRU enhances standard LRU by incorporating two layered-aware metrics:

  1. Last-round index: Tracks how many full token cycles have passed since an expert was last used.
  2. Relative layer distance: Measures the distance to the next time a layer will be requested. For instance, if the current token is at Layer 5, an expert for Layer 6 is "closer" than one for Layer 4, which won't be needed until the next token starts its pass through the network.

By prioritizing the eviction of experts that are "further away" in the inference cycle, LLRU maintains a more relevant cache and avoids evicting weights that are about to be needed.

Key Results

The algorithm was evaluated using traces from Mixtral 7B and Llama-MoE, as well as synthetic Zipf-distributed datasets to model expert popularity.

  • Reduced Misses: LLRU achieved approximately 15% fewer cache misses than standard LRU on Llama-MoE traces and outperformed "LRU-Dist" (partitioned LRU) by ~7%.
  • Stability: Unlike LRU, which can show volatile performance swings based on cache size, LLRU provides a smoother, more predictable performance curve.
  • Theoretical Tightness: The authors established a lower bound on the competitive ratio for deterministic algorithms ($k - \ell + 1$), showing that LLRU approaches the fundamental limits of the problem.

Conclusion and Future Work

Layered Paging and LLRU represent a significant step toward efficient MoE deployment. By specializing caching theory for the structured nature of neural network inference, the authors demonstrate that significant performance gains are possible without complex machine-learning-based predictors. Future work may explore variable expert sizes and the integration of look-ahead gating predictions to further optimize pre-fetching strategies.

Summary updated

Abstract

Large language models (LLMs) have demonstrated remarkable capabilities across a variety of tasks. One of the main challenges towards the successful deployment of LLMs is memory management, since they typically involve billions of parameters. To this end, architectures based on Mixture-of-Experts have been proposed, which aim to reduce the size of the parameters that are activated when producing a token. This raises the equally critical issue of efficiently managing the limited cache of the system, in that frequently used experts should be stored in the fast cache rather than in the slower secondary memory. In this work, we introduce and study a new paging problem that models expert management optimization. Our formulation captures both the layered architecture of LLMs and the requirement that experts are cached efficiently. We first present lower bounds on the competitive ratio of both deterministic and randomized algorithms, which show that under mild assumptions, LRU-like policies have good theoretical competitive performance. We then propose a layer-based extension of LRU that is tailored to the problem at hand. Extensive simulations on both synthetic datasets and actual traces of MoE usage show that our algorithm outperforms policies for the classic paging problem, such as the standard LRU.
BibTeX
@misc{angelopoulos2025cache,
  author = {Spyros Angelopoulos and Loris Marchal and Adrien Obrecht and Bertrand Simon},
  title = {{Cache Management for Mixture-of-Experts LLMs - extended version}},
  year = {2025},
  eprint = {2509.02408},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.02408},
}

Loading related content...

Figure