Skip to content
AI-generated research idea🟡Fairly easy💡Moderate InnovationRelated work found

Frequency- and Batch-Aware Expert Cache Replacement Beyond Global LRU

Replace recency-only expert cache eviction with frequency- and batch-aware scoring so concurrent agent requests avoid cache thrashing under tight GPU memory.

Time

several weeks

Compute level

Single GPU or less

Resources

Single RTX 5090 or RTX 4060 GPU with public routing traces from Qwen3.6-35B-A3B and DeepSeek-V4-Flash across AIME, OpenCode, Claude Code, and OpenClaw.

What the paper used

Six single-GPU systems: RTX 5090 (32 GB, 180 GiB DDR5, 6 threads capped), RTX 4090 (24 GB, 240 GiB DDR4, 6 threads), RTX 3090 (24 GB, 180 GiB DDR4, 6 threads), RTX 5090 desktop (32 GB, Ryzen 9 9950X3D, 192 GiB DDR5), RTX 4060 laptop (8 GB, Core i9-13900H, 32 GiB LPDDR5), and RTX PRO 6000 (96 GB, Xeon Platinum 8559C, 512 GiB DDR5); evaluated on Qwen3.6-35B-A3B, DeepSeek-V4-Flash (284B), and GLM-5.2 (753B).

Prerequisites

Cache replacement algorithms (S3-FIFO/ARC/LFU), CUDA warp/block-level primitives, and MoE routing behavior.

Scope

modify existing code

The Gap

FreeToken manages all MoE layers in one shared GPU slot pool using a single-pass GPU LRU eviction kernel, and delegates which q* of the m missing experts are admitted to the cache-fill set F directly to the replacement policy (Section 3.2 and Section 4.1).

“Instead, a single-pass kernel identifies the K least-recently-used candidate slots for eviction in one go. The miss path then simply consumes the first q ≤ K of these slots.”
From the paper, Section 4.1, page 8. Matched against the PDF text.

Limitation

Pure LRU is vulnerable to scan-like thrashing when the active working set exceeds VRAM capacity (e.g., yielding a 39% decode miss rate on DeepSeek-V4-Flash at 11% pool capacity on an RTX 5090) and treats all misses identically instead of prioritizing experts shared across concurrent subagent tokens or exhibiting high multi-turn reuse.

Proposed Solution

Replace pure LRU in the single-pass GPU victim-selection kernel with a fixed-shape, scan-resistant policy such as S3-FIFO or two-bit LFU-LRU aging counters stored in the device-resident residency table. In addition, sort the m deduplicated missing experts by token fanout (number of tokens in the batch routing to each expert, crucial for concurrent subagents like Claude Code) and historical hit frequency so the highest-reuse q* misses enter F while single-token tail misses execute on the CPU.

Why This Matters

Expected to lower decode miss rates and improve token throughput on large-expert-pool models and multi-subagent batches without increasing VRAM footprint.

How to Get Started

How to test it: Test via trace-driven simulation and end-to-end serving that frequency- and fanout-aware fill selection reduces DeepSeek-V4-Flash decode miss rate on an RTX 5090 (11% cache capacity) by at least 5 percentage points and boosts Claude Code (W3) throughput by >=8% over global LRU; stop if extra metadata tracking adds >5 microseconds per layer to the CUDA Graph kernel.

  1. Extract token-level MoE routing traces from Qwen3.6-35B-A3B and DeepSeek-V4-Flash across single-turn (AIME) and concurrent-subagent (Claude Code) runs.
  2. Build a lightweight offline cache simulator matching FreeToken's global slot pool and q* constraint to evaluate S3-FIFO, LFU-LRU hybrid, and batch-fanout prioritization on miss rate.
  3. Implement the winning fixed-shape metadata structure inside FreeToken's single-pass device-side cache control kernel.
  4. Benchmark end-to-end decode tok/s and miss rates across cache capacities (10%-50% of expert pool) on an RTX 5090 or RTX 4060.

Suggested by AI. Adapt it to your setup.

Has This Been Done?

Related work found

Studies like CECAR explore cache and expert co-aware routing, while other works examine cache replacement for LLM prefix reuse. They do not specifically implement a token-fanout-sorted replacement policy targeting missing experts alongside scan-resistant aging counters for device-resident residency tables.

We searched OpenAlex and arXiv for “MoE expert cache replacement frequency batch aware LRU thrashing” and “Frequency- and Batch-Aware Expert Cache Replacement Beyond Global LRU” and an AI compared the idea with the top 10 results. A small search can miss relevant work.

Source Paper

FreeToken: Efficient Edge-Native MoE Serving with Bandwidth-Adaptive Execution

Shuo Yang, Xiaoze Fan, Melissa Pan +8 more · 2026

FreeToken is an edge-native Mixture-of-Experts (MoE) serving system that enables personal consumer hardware, from an 8 GB laptop GPU to a single workstation GPU, to interactively run 35B to 753B open-weight models on agentic workloads. It achieves 1.3-2.3x higher decode throughput and avoids multi-minute tail prefill stalls compared to llama.cpp, Ollama, KTransformers, and MoE-Infinity by orchestrating GPU VRAM, CPU compute, host memory, and PCIe bandwidth as a unified elastic platform.

Related Ideas

Is this a good idea?

Share onXLinkedIn