ResKV: 고정 예산 KV 캐시 압축을 위한 누락된 어텐션 기여도 재구성
ResKV: Reconstructing Omitted Attention Contributions for Fixed-Budget KV Cache Compression
KV 캐시 압축은 효율적인 장문(long-context) 추론에 필수적입니다. 기존의 제거 방식은 선택되지 않은 토큰을 영구적으로 삭제하여, 이들이 어텐션에 미치는 총 기여도를 제거합니다. 병합 기반의 대안들은 더 많은 정보를 보존하지만, 유지되는 키(key)와 값(value)을 왜곡할 수 있습니다. 우리는 캐시 제거로 인해 누락되는 정보가 소프트맥스 어텐션의 분자와 분모 모두에서 잔차 통계량으로 표현될 수 있다는 점을 관찰했습니다. 이러한 관찰을 바탕으로, 우리는 고정된 KV 예산을 정확한 메인 캐시와 누락된 토큰의 기여도를 재구성하는 소형 잔차 캐시로 나누는 ResKV를 제안합니다. ResKV는 메인 캐시 토큰과 잔차 항목이 동일한 소프트맥스 정규화에 참여하므로, 잔차 항목은 사후 수정(post-hoc correction) 역할을 하는 것이 아니라 어텐션 분자와 분모의 질량 모두를 복원합니다. 구성 시점에 수행되는 검증 프록시는 각 레이어 및 KV 헤드에 대한 잔차 할당을 결정하며, 디코딩 시점에 동적으로 조정되는 게이트는 개별 쿼리에 대한 잔차 기여도를 조절합니다. LongBench 및 RULER 데이터셋에 대한 종합적인 실험 결과(쿼리 기반 및 쿼리 독립 설정, 다양한 백본 구조, 캐시 예산, 대표적인 압축 기준)는 동일한 유지된 KV 예산 하에서 광범위한 성능 향상을 보여주며, 메모리 사용량 및 장문 추론 처리량과 같은 압축 디코딩의 실용적인 효율성을 유지합니다.
KV cache compression is essential for efficient long-context inference. Existing eviction methods permanently discard unselected tokens and consequently remove their aggregate contribution to attention. Merging-based alternatives preserve more information but can perturb retained keys and values that should remain exact. We observe that the information omitted by cache eviction can be formulated as residual statistics in both the numerator and denominator of softmax attention. Based on this observation, we propose ResKV, which divides a fixed KV budget into an exact main cache and a compact residual cache that reconstructs the contribution of omitted tokens. ResKV lets main-cache tokens and residual entries participate in the same softmax normalization, so residual entries restore both attention numerator and denominator mass rather than acting as a post-hoc correction. A construction-time validation proxy determines residual allocation for each layer and KV head, while a decode-time dynamic gate adjusts residual contributions for individual queries. Comprehensive evaluations on LongBench and RULER, covering query-aware and query-agnostic settings, multiple backbones, cache budgets, and representative compression baselines, demonstrate broad improvements under the same retained KV budget while preserving the practical efficiency of compressed decoding, including peak memory usage and long-context decode throughput.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.