Inference systems · Research feature

New AI Method Reduces Memory Use in Expert Models Without Degrading Accuracy

A new technique improves performance in sparse AI models by preserving key context during memory compression.

Adapted from research by Minsang Kim, Seungjun Baek.

arXiv preprint revision · 2026-10-21 · Attribution & reuse
In this article
Editorial illustration of optical fibers.

Editor’s introduction

Researchers studied how KV cache compression affects expert routing in mixture-of-experts language models. They measured routing stability under compression using a Fisher information metric and found that eviction can disrupt expert selection, reducing output quality. MoEZip introduces a routing-aware compression method that prioritizes context positions critical for stable routing. The study shows MoEZip outperforms existing methods on LongBench and RULER benchmarks, especially under aggressive compression, where it maintains higher scores than baselines. Findings are based on standard evaluation metrics across tasks, with results reported for LongBench, RULER, and NIAH.

Introduction

Large language models (LLMs) have enabled substantial advances across a wide range of real-world applications, including chatbot assistants, coding agents, robot agents, and broader LLM-based agent systems. Mixture-of-Experts (MoE) architectures have emerged as an effective solution for scaling LLM capacity while controlling inference cost. By activating only a small subset of parameters for each token, MoE models can scale total capacity without incurring the full computation cost of dense models. This favorable scaling property has made MoE a promising architecture for large-scale deployment.

However, efficient inference remains challenging in long-context and agentic settings. Many real-world applications require processing long interaction histories, retrieved documents, tool outputs, or multimodal observations. In these scenarios, the key bottleneck is often memory rather than activated parameter count: the KV cache grows linearly with sequence length and quickly becomes a major obstacle for scalable inference.

To address this issue, a body of work recently studied KV cache compression and eviction methods, which reduce memory usage while preserving generation quality. Existing approaches span diverse strategies, from attention-based token selection methods such as SnapKV to methods based on context reconstruction such as KVZip. Although these methods have shown promising results on dense transformers, applying them to MoE models can be problematic. In sparse-MoE architectures, changes in KV representation due to eviction can affect router decisions that determine which experts are activated. This has been shown to aggravate performance degradation under high compression. KV compression can therefore incur MoE-specific problems, which are not captured by eviction methods designed for dense architectures.

Preliminaries: Mixture-of-Experts Models and Prefix KV Compression

In dense transformers, this problem is often addressed by retaining KV entries that receive large attention mass. However, in sparse MoE models, cache eviction has an additional mode of failure: it can perturb router decisions and thereby change which experts are selected during decoding.

Method: Routing-Aware Prefix KV Compression

The proof is in Appendix A.1. This perturbation model is used to motivate a direction-agnostic local sensitivity proxy, not to characterize the exact distribution of eviction-induced router-logit shifts. Below, we explain the rationale behind the Fisher-trace metric (10).

Query-agnostic variant. MoEZip-Recon replaces the downstream instruction with the same fixed reconstruction query used by KVZip and computes routing-aware scores from the router and attention statistics of that reconstruction pass. It requires no additional model forward pass beyond KVZip’s reconstruction pass, and the resulting compressed cache can be reused across downstream requests. The original MoEZip instead conditions anchor selection on the downstream instruction.

Complexity. MoEZip adds only a lightweight selection-time computation over the base scorer, while preserving the same retained-cache size and decoding procedure after eviction. Its wall-clock overhead is small, adding 0.88s on Qasper and 0.86s on average across 4K–32K NIAH contexts; details are in Appendix D.

Experimental Settings

Evaluation Datasets. We evaluate on 12 LongBench tasks, RULER, and Needle in a Haystack (NIAH) with context lengths from 4K to 32K. These benchmarks cover question answering, summarization, few-shot learning, synthetic retrieval, code completion, and diverse long-context tasks. We follow the official evaluation protocol for each benchmark and use the ROUGE-L F1 score for NIAH.

Main Results

The gains are most pronounced on reasoning- and retrieval-intensive benchmarks, while remaining stable on code and summarization tasks. Notably, under small KV cache ratios (i.e., when only a small fraction of the KV cache is retained), existing methods degrade substantially, with KVZip showing the most pronounced collapse and other baselines also suffering clear performance drops, whereas MoEZip remains comparatively robust and preserves strong performance across tasks.

KV Cache Compressions. Recent studies have proposed a variety of KV cache eviction and compression methods to reduce the memory and latency cost of long-context LLM inference. StreamingLLM retains attention sinks and recent tokens to enable stable streaming inference, while H2O formulates KV eviction around heavy hitters that dominate attention. SnapKV identifies prompt positions likely to be important for future decoding from a short observation window, and PyramidKV exploits layer-wise differences in information concentration to assign non-uniform cache budgets across layers. AdaKV extends this line of work by adaptively reallocating budgets across attention heads, and DuoAttention distinguishes retrieval heads from streaming heads to combine full and lightweight KV retention. KVZip departs from query-aware scoring and proposes query-agnostic compression via context reconstruction, improving cache reuse across multiple queries. However, these methods are primarily developed for dense LLMs. In MoE LLMs, KV eviction can change router outputs and destabilize expert assignments. MoEZip addresses this issue by explicitly preserving routing behavior during KV compression.

Efficient LLM Architectures. Recent work has increasingly emphasized efficiency as a central design goal for long-context language models. Prior studies have explored this direction through alternative sequence modeling and efficient attention architectures, including linear attention methods such as DeltaNet, Gated DeltaNet, and Lightning Attention, as well as sparse attention methods such as BigBird, Native Sparse Attention, and DSA. These methods improve efficiency by modifying the underlying architecture or attention pattern, reflecting a broader shift toward scalable long-context modeling. In contrast, our work is complementary: rather than redesigning the model architecture, we focus on KV cache compression at inference time, with particular emphasis on preserving routing behavior in sparse MoE LLMs.

Conclusion, Limitations, and Broader Impacts

In this paper, we revisited KV cache compression for MoE language models from the perspective of routing fragility. We showed that KV eviction can perturb expert routing and induce a MoE-specific source of quality degradation under aggressive compression. We proposed MoEZip, a routing-aware KV compression method that protects context positions important for stable expert routing. Across LongBench, NIAH, and RULER, MoEZip consistently outperforms strong baselines, especially in the high-compression regime.

As with other LLM efficiency methods, MoEZip may lower deployment costs for both beneficial applications and potential misuse. Overall, our results highlight routing fragility as an underexplored principle for KV compression in MoE models and suggest future opportunities for routing-aware compression in broader sparse architectures.

Sample-Level Validation of the Fisher-Trace Proxy

The correlations are positive in all settings and become substantially stronger as the keep ratio decreases. This trend is consistent across both HotpotQA and Qasper: under aggressive compression, samples with larger Fisher trace are much more likely to exhibit expert-routing flips. These results provide sample-level evidence that Fisher trace captures meaningful routing fragility rather than only acting as a local uncertainty heuristic.

Empirical comparison

We compare the Fisher-trace score used in MoEZip with the worst-case curvature alternatives above. For softmax routing, we use the upper bound in Eq. (37). For sigmoid-style routing, we use the exact value in Eq. (42). Figures 9 and 10 report task performance across compression ratios.

Overall, the worst-case curvature scores are competitive with Fisher trace in several moderate-compression settings, indicating that worst-case Fisher geometry is also informative for routing fragility. However, they do not consistently outperform Fisher trace across tasks and can be less stable under aggressive compression. This is especially visible in the high-compression regime, where the bound-based score sometimes drops earlier or more sharply than Fisher trace. These results suggest that tighter worst-case curvature does not necessarily translate into better context-position ranking for KV retention.

We therefore use Fisher trace as the default score in MoEZip. Compared with worst-case curvature, Fisher trace provides a smoother direction-agnostic summary of the router state, admits simple closed forms for both softmax- and sigmoid-style routers, and empirically yields more stable performance across tasks and compression ratios.

Evaluation metrics

For LongBench, we follow the official evaluation protocol and use the standard metric associated with each task: F1 for question-answering tasks, ROUGE-L for summarization tasks, accuracy for classification and few-shot learning tasks, and edit similarity for code-completion tasks. For RULER, we use the official evaluation scripts and report the average score over its 13 tasks. For NIAH, we report Rouge-L F1 between the predicted answer and the target needle answer, treating needle retrieval as an answer-extraction task.

Compute resources

All experiments were conducted on NVIDIA A100 GPUs with 80GB memory. Each evaluation run used two A100 GPUs, except for the 235B-model experiments described in Appendix E.9, which used eight. The reported experiments, including MoEZip and all baselines, required approximately 15,000–16,000 A100 GPU-hours in total. This estimate excludes preliminary exploratory or failed runs.

Query conditioning and cache reuse

MoEZip-Recon uses the same fixed reconstruction query as KVZip. It reuses router and attention statistics from that reconstruction pass to compute routing-aware anchors, requiring no additional model forward pass beyond KVZip’s reconstruction pass. Its final compressed cache is independent of downstream instructions and can therefore be reused across requests. The original MoEZip instead uses the downstream instruction for anchor selection. A matched comparison is reported in Appendix E.6.

Observation-window fairness

MoEZip uses the template-defined downstream instruction span. SnapKV and PyramidKV use their standard final-64-token observation window. After applying the evaluated prompt templates and tokenizer, the complete instruction span is contained within this window for every example across the 12 LongBench tasks; the maximum instruction length is 64 tokens. For this check, the downstream instruction is distinguished from task content embedded in raw question fields, such as passages, dialogues, and retrieval abstracts. The KVZip–MoEZip-Recon comparison additionally matches the reconstruction query, base scorer, retained-KV budget, and reusable-cache setting.

Answer-Token Flip Rate per Compression Ratio

This pattern is especially clear in the high-compression regime. On several tasks, KVZip maintains competitive performance up to a moderate compression level and then exhibits a sharp quality collapse once the flip rate rises sufficiently. By contrast, MoEZip delays this transition by suppressing router instability, thereby preserving answer quality over a broader compression range. These results support our central claim that routing instability is a key failure mode of KV compression in MoE models, and that reducing expert flips is closely tied to improved downstream robustness.

Layer-Wise Router Instability under KV Compression

We further examine where routing instability emerges across MoE layers. For each MoE layer, we compare the top-1 expert selected with the full KV cache and with the compressed KV cache, and report the fraction of tokens whose expert assignment changes.

These results motivate incorporating routing-aware protection into KV compression. However, layer-wise flip variation alone does not imply that the routing-aware score should replace fine-grained layer/head-specific KV scoring. Instead, MoEZip uses the routing-aware score as a conservative position-level anchor signal: it selects a small set of context positions that are likely to be important for routing stability and protects them across layers. The remaining KV budget is still allocated by the layer/head-specific base scorer, allowing MoEZip to combine coarse routing-aware protection with fine-grained KV allocation.

Router Flip Rate across Different Inputs for the Same Context

We further analyze router instability across different inputs that share the same context. For each input, we compare the top-1 expert selected with the full KV cache and with the compressed KV cache, and report the input-wise router flip rate under the same compressed context.

This supports the need for instruction-conditioned refinement. A context-only score assigns the same importance to context positions regardless of the downstream input, but the routing-critical positions to preserve may vary across inputs. MoEZip therefore estimates routing fragility from the instruction tokens and uses instruction-to-context attention to identify input-specific routing-aware anchors.

Paired Bootstrap Confidence Intervals

We perform paired task-level bootstrap analysis to assess whether MoEZip’s improvements over each baseline are robust to task composition. For each bootstrap sample, we resample tasks with replacement and compute the mean score difference between MoEZip and each baseline on the same resampled task set. We report 95% percentile intervals over 10,000 bootstrap samples.

As shown in Tables 9 and 10, MoEZip outperforms all baselines across all reported keep ratios on both LongBench and RULER, with all paired intervals excluding zero. These results indicate that MoEZip’s improvements are robust to task-level resampling across the reported aggregate settings.

Query-Agnostic Compression and Cache Reuse

We compare KVZip, MoEZip-Recon, and instruction-conditioned MoEZip on Qwen3-30B-A3B-Instruct-2507 across 12 LongBench tasks. KVZip and MoEZip-Recon use the same fixed reconstruction query, base scoring procedure, and retained-KV budget, and both produce caches reusable across downstream requests. The original MoEZip instead conditions anchors on the downstream instruction.

Adjacent-layer associations

The probability of a flip at the next layer is higher when a flip occurs at the current layer. This establishes an association, but does not isolate causal propagation from shared sensitivity to the same KV perturbation. It also does not by itself explain the advantage of globally shared anchors.

Qualitative anchor examples

Selected anchors include answer-relevant entities and factual details, such as Pelham Glassford, Meg Ryan, John Chilton, and numerical or temporal expressions. Other examples include schema markers such as Type:, Question:, and yes/no/unanswerable, as well as evidence delimiters such as Passage 5:, Paragraph 1:, and Article:. These examples illustrate positions receiving global protection; they are qualitative observations rather than a quantitative classification or causal explanation of anchor utility.