paper-with-me

홈 › Papers

CTkvr: KV Cache Retrieval for Long-Context LLMs via Centroid then Token Indexing

2025-12-17 · Kuan Lu, Shuhang Lin, Sai Wu, Yichen Yao, Junhan Yang, Huan Li, Wei Chu, Xu Yinghui, Yuan Qi, Gang Chen arxiv

Large language models (LLMs) are increasingly applied in long-context scenarios such as multi-turn conversations. However, long contexts pose significant challenges for inference efficiency, including high memory overhead from Key-Value (KV) cache and increased latency due to excessive memory accesses. Recent methods for dynamic KV selection struggle with trade-offs: block-level indexing degrades accuracy by retrieving irrelevant KV entries, while token-level indexing incurs high latency from inefficient retrieval mechanisms. In this paper, we propose CTKVR, a novel centroid-then-token KV retrieval scheme that addresses these limitations. CTKVR leverages a key observation: query vectors adjacent in position exhibit high similarity after Rotary Position Embedding (RoPE) and share most of their top-k KV cache entries. Based on this insight, CTKVR employs a two-stage retrieval strategy: lightweight centroids are precomputed during prefilling for centroid-grained indexing, followed by token-level refinement for precise KV retrieval. This approach balances retrieval efficiency and accuracy. To further enhance performance, we implement an optimized system for indexing construction and search using CPU-GPU co-execution. Experimentally, CTKVR achieves superior performance across multiple benchmarks with less than 1% accuracy degradation. Meanwhile, CTKVR delivers 3 times and 4 times throughput speedups on Llama-3-8B and Yi-9B at 96K context length across diverse GPU hardware.

📄 PDF Abstract BibTeX arXiv:2512.15550

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

SCBench: A KV Cache-Centric Analysis of Long-Context Methods

2024-12-13 · Yucheng Li, Huiqiang Jiang, Qianhui Wu, Xufang Luo 외

Long-context LLMs have enabled numerous downstream applications but also introduced significant challenges related to computational and memory efficiency. To address these challenges, optimizations for long-context infer…

MambaQuantizationRetrievalSemantic Retrieval

ParisKV: Fast and Drift-Robust KV-Cache Retrieval for Long-Context LLMs

2026-02-07 · Yanlin Qi, Xinhang Chen, Huiqiang Jiang, Qitong Wang 외 arxiv

KV-cache retrieval is essential for long-context LLM inference, yet existing methods struggle with distribution drift and high latency at scale. We introduce ParisKV, a drift-robust, GPU-native KV-cache retrieval framewo…

CompressKV: Semantic-Retrieval-Guided KV-Cache Compression for Resource-Efficient Long-Context LLM Inference

2026-06-23 · Xiaolin Lin, Jingcun Wang, Olga Kondrateva, Yiyu Shi 외 arxiv

Long-context large language model (LLM) inference is increasingly constrained by the memory footprint and decoding cost of key-value (KV) caches, limiting sustainable deployment on resource-constrained hardware. Existing…

Semantic Retrieval

A$^2$ATS: Retrieval-Based KV Cache Reduction via Windowed Rotary Position Embedding and Query-Aware Vector Quantization

2025-02-18 · Junhui He, Junna Xing, Nan Wang, Rui Xu 외

Long context large language models (LLMs) pose significant challenges for efficient serving due to the large memory footprint and high access overhead of KV cache. Retrieval-based KV cache reduction methods can mitigate …

CPUPositionQuantizationRetrieval

DuoAttention: Efficient Long-Context LLM Inference with Retrieval and Streaming Heads

2024-10-14 · Guangxuan Xiao, Jiaming Tang, Jingwei Zuo, Junxian Guo 외

Deploying long-context large language models (LLMs) is essential but poses significant computational and memory challenges. Caching all Key and Value (KV) states across all attention heads consumes substantial memory. Ex…

GPUQuantizationRetrieval