MOSAIC: Multi-Objective Search for Allocating Inference Cache Across LLM Decoder Layers

arXiv:2610.25431 · cs.LG, cs.AI · Submitted 2026-10-18 · Read on arXiv

cs.LG, cs.AI

Submitted: 2026-10-18

Updated: 2026-10-18

License: http://creativecommons.org/publicdomain/zero/1.0/

The gist: The Key-Value (KV) cache is the main memory bottleneck of long-context LLM inference.

Terminology

Abstract

The Key-Value (KV) cache is the main memory bottleneck of long-context LLM inference. Token eviction methods such as SnapKV, H2O, AdaKV and L2Norm shrink it, but they give every transformer layer the same budget, although layers differ in which tokens they need. We present MOSAIC, a multi-objective neural architecture search that learns per-layer KV-cache budgets for any eviction method. One search maps the trade-off between average budget and task score; its best allocation transfers to every target budget without further search, and an optional budget-constrained search refines it. Across four eviction methods on Llama-3-8B-Instruct and Mistral-7B-Instruct-v0.2, MOSAIC beats uniform allocation in 146 of 154 (task, method, budget) settings, by up to +48 points on RULER and +11.9 on LongBench (LCC). On both models, it reaches the score of uniform allocation with up to 4x less KV cache (75% smaller). Against EvolKV, MOSAIC explores a 10 40 x larger search space with 4x fewer evaluations and 18% fewer GPU-hours per budget, and scores higher in 5 of 6 settings. The learned allocations consistently favour a small set of middle layers.

Related papers