MILO: Efficient Many-shot In-Context Learning with Block-wise Low-rank Compression
Abstract
Many-shot in-context learning (ICL) enables large language models (LLMs) to adapt to complex tasks by conditioning on thousands of demonstration examples, but this paradigm shifts the inference efficiency bottleneck to the key-value (KV) cache memory. Due to the linear scaling behavior of the KV cache, storing these intermediate tensors has become a paramount challenge for both online serving and on-device deployment. To address this issue, we propose a novel compression framework, termed MILO, that exploits the low-rank redundancy inherent in many-shot contexts. Specifically, MILO features a block-wise low-rank compression strategy that compresses the KV cache at the block granularity, where each block contains multiple many-shot examples. Furthermore, to handle the heterogeneous context density across different blocks, MILO dynamically allocates rank budgets based on the information entropy, preserving the fidelity of critical blocks while aggressively compressing redundant ones. Experimental results on Qwen2.5 models demonstrate that our method achieves up to 50% reduction in KV cache memory and 1.8x throughput improvement, with negligible performance degradation on classification and reasoning benchmarks, significantly outperforming prior baselines.
Create a lesson
Metadata
- Comments
- Technical Report
Related papers
Beyond Fixed-Context Likelihood: Zero-Shot AI-Generated Text Detection via Context Perturbation Discrepancy
Shared title terminologycs.CLYifan Tang, Jingran Li, Yihao Wang et al.
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
PC-SubMax: Efficient Prompt Compression via Regularized Submodular Maximization
Shared title terminologycs.CLZiyi Zhang, Shuang Cui, Haotian Zhang et al.
Highlight-Then-Summarize: Learning to Compress Evidence for Long-Context Understanding
Shared title terminologycs.CLZhaoyuan Xia, Qinghongbing Xie, Yung Xiang Hue et al.
Diffu-LoRA: A Novel Low-Rank Adaptation for Personalized Diffusion Models
Shared title terminologycs.CLTianjing Li, Wei Zhu
Persuaded, Not Informed: Incentive-Misaligned Witnesses Defeat In-Context Grounding
Shared title terminologycs.CLRahul Balakavi