SeKV: 장문맥 LLM 추론을 위한 해상도 적응형 KV 캐시와 계층적 의미 메모리
SeKV: Resolution-Adaptive KV Cache with Hierarchical Semantic Memory for Long-Context LLM Inference
June 30, 2026
저자: Amirhossein Abaskohi, Giuseppe Carenini, Peter West, Yuhang He
cs.AI
초록
대규모 언어 모델은 점점 더 긴 컨텍스트에서 동작하며, 이때 KV 캐시가 주요 메모리 병목 현상이 된다. KV 캐시의 크기는 시퀀스 길이에 따라 선형적으로 증가하며 디코딩 전반에 걸쳐 유지되어야 하므로, 압축 없이는 전체 GPU 캐싱이 엄청나게 비용이 많이 든다. 기존의 KV 캐시 압축 방법은 효율성과 정확한 맥락 보존 사이에서 균형을 맞추기 어렵다. 토큰 제거는 정보를 폐기하는 반면, 의미 기반 그룹화는 프리필 시점에 압축 결정을 고정한다. 두 방법 모두 생성 중에 압축된 범위가 관련성을 갖게 되면 그 범위에서 토큰 수준의 세부 정보를 복구할 수 없다. 이에 대한 해결책으로, 우리는 정보를 폐기하지 않고 컨텍스트를 엔트로피 기반 의미 범위로 구성하여 GPU-CPU 메모리 계층 구조에 저장하는 해상도 적응형 의미론적 KV 캐시인 SeKV를 제안한다. 각 범위는 GPU에 경량 요약 벡터를 유지하여 대략적인 라우팅을 수행하고, CPU에는 저차원 SVD 기반을 유지하여 요청 시 토큰 수준 재구성을 지원한다. 학습된 줌인 메커니즘은 디코딩 중에 쿼리와 관련된 범위를 선택적으로 확장하여, 전체 KV 캐시를 GPU에 구체화하지 않고도 정밀한 검색을 가능하게 한다. SeKV는 기본 LLM을 완전히 고정한 상태에서 0.05% 미만의 학습 가능한 파라미터만 추가하여 적응형 토큰 수준 재구성을 가능하게 한다. 네 가지 벤치마크에서 SeKV는 가장 강력한 의미 기반 압축 기준선보다 평균 5.9% 향상된 성능을 보이며, 128K 컨텍스트에서 전체 KV 캐싱 대비 GPU 메모리를 53.3% 절감한다. 코드는 https://github.com/AmirAbaskohi/SeKV 에서 확인할 수 있다.
English
Large language models increasingly operate over long contexts, where the KV cache becomes a dominant memory bottleneck: its size grows linearly with sequence length and must be retained throughout decoding, making full GPU caching prohibitively expensive without compression. Existing KV cache compression methods struggle to balance efficiency with faithful context preservation. Token eviction discards information, while semantic grouping fixes compression decisions at prefill time; neither can recover token-level detail from a compressed span once it becomes relevant during generation. As a solution, we propose SeKV, a resolution-adaptive semantic KV cache that organizes context into entropy-guided semantic spans and stores them across a GPU-CPU memory hierarchy without discarding information. Each span keeps a lightweight summary vector on GPU for coarse routing and a low-rank SVD basis on CPU for on-demand token-level reconstruction. A trained zoom-in mechanism selectively expands query-relevant spans during decoding, enabling precise retrieval without materializing the full KV cache on GPU. SeKV enables adaptive token-level reconstruction while keeping the base LLM fully frozen and adding fewer than 0.05% trainable parameters. Across four benchmarks, SeKV improves over the strongest semantic compression baseline by 5.9% on average while reducing GPU memory by 53.3% versus full KV caching at 128K context. Code is available on https://github.com/AmirAbaskohi/SeKV.