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 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.
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:
- Last-round index: Tracks how many full token cycles have passed since an expert was last used.
- 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