PyTorchKR Papers

최신 논문

총 3편
태그·기간 등 상세 필터

카테고리 탐색

로그인 후 이 태그 구독

arXiv:2607.01520v2cs.LG

The risk of KV cache compression

Transformer inference on long sequences is expensive because softmax attention repeatedly reads from a large KV cache. The prevalent approach to this bottleneck is KV cache compression, which replaces the full cache with a compact summary. Despite its practical importance, the design of such summaries is largely driven by empirical experimentation. On the theoretical side, existing results show that KV cache compression can be impossible in the worst case, but offer little systematic guidance for designing algorithms in regimes where accurate compression is possible. We bridge this gap by characterizing the minimax risk of KV cache compression in terms of the intrinsic compressibility of a cache, revealing when and how accurate compression is possible. In particular, we show that, once attention can sharply retrieve individual tokens, compression can only uniformly outperform random sampling by exploiting information about future queries, regardless how redundant the cache is inherently. Additionally, our results yield novel design principles for KV cache compression under causal masking that map efficiently to prefill and autoregressive decoding while achieving minimax-optimal risk. We instantiate these principles in a practical algorithm and illustrate how our theoretical findings can be put to practical use. Overall, our results opens a principled avenue for KV cache compression with theoretical guarantees.

arXiv:2609.33334v2cs.LG

무엇을 남길지가 아닌 언제 제거할 것인가: 학습 불필요 KV 캐시 압축을 위한 초안 유도 제거

When to Evict, Not What to Keep: Draft-Guided Eviction for Training-Free KV-Cache Compression

SnapKV, H2O, PyramidKV와 같은 학습 불필요(training-free) KV 캐시(KV-cache) 압축 기법들은 프리필(prefill) 단계의 끝에서 토큰을 제거하여 향후 쿼리가 사용할 것으로 예상되는 어텐션 가중치 합(attention mass)을 보존하는 것을 목표로 하며, 즉 '무엇을 남길지'를 최적화합니다. 본 논문에서는 이러한 목표가 두 가지 서로 다른 방식으로 실패함을 보입니다. (1) 보상(Compensation): 제거된 어텐션 가중치 합을 복원하면 태스크 품질을 회복하지 못한 채 어텐션 수준의 목표치만 복구될 수 있습니다. (2) 선택(Selection): 복원된 가중치 합이 일관된 구간에 집중되지 않고 분절되어 있을 경우, 실제 디코드 쿼리 가중치 합을 더 많이 포함하더라도 오히려 품질이 저하될 수 있습니다. 이러한 실패는 공통된 원인을 공유합니다. 즉, 답변의 궤적을 결정하는 쿼리가 존재하기 전에 제거가 발생한다는 점입니다. 이에 따라 본 연구에서는 전체 캐시를 사용하여 첫 k=2개의 답변 토큰을 초안(draft)으로 생성할 때까지 제거를 연기하는 초안 유도 제거(Draft-Guided Eviction, DGE)를 제안합니다. 이는 프리필을 넘어 단 1회의 디코드 단계에 불과합니다. 초안은 답변 자체의 접두 문맥(prefix)으로부터 생성되므로, 이러한 궤적 신호를 사용할 수 있게 되기 전까지는 어떠한 캐시 항목도 폐기되지 않습니다. 헤드별 캐시 예산은 그대로 유지되며, DGE는 제거 점수를 수정하지 않고도 SnapKV, PyramidKV, H2O, StreamingLLM에 직접 적용할 수 있습니다. 추가 패스(extra-pass)를 사용하는 방식과 달리, DGE는 어떤 캐시 항목을 선택할지가 아니라 언제 제거가 일어나는지를 변경합니다. 광범위한 실험을 통해 DGE는 평가된 6개 인스트럭션 튜닝(instruct-tuned) 백본 중 5개에서 모든 평가 예산에 걸쳐 기존 기법보다 뛰어난 성능을 보였으며, LongBench에서 44.2점을 기록하여 FullKV의 44.3점에 거의 근접함을 입증했습니다. 시점만 조절한 대조군인 DGE-W 역시 동일한 점수를 기록하였는데, 이는 성능 향상이 무엇을 선택하는가가 아니라 언제 제거가 일어나는가에서 비롯됨을 보여주며, 본 연구에서는 이러한 효과를 '궤적 앵커링(trajectory anchoring)'이라 부릅니다.

arXiv:2607.01241v1cs.CL

Mapping Text to Multiplex Graph: Prompt Compression as Lévy Walk-Guided Graph Pruning

텍스트를 플랫한 토큰 시퀀스로 처리하는 기존 프롬프트 압축 방식의 한계를 극복하기 위해, RAGP는 세밀한 어텐션 기반 의존성과 거친 의미론적 관계를 동시에 모델링하는 멀티플렉스 그래프(multiplex graph) 위에서 중복 인식 그래프 가지치기(Redundancy-Aware Graph Pruning)를 수행한다. 밀집된 지역 서브그래프와 희소한 전역 연결이 혼재하는 이종 구조를 효율적으로 탐색하기 위해 Lévy walk를 도입하였으며, LongBench 벤치마크에서 4배 압축 비율로 평균 49.3점을 달성해 3배 압축의 LongLLMLingua(48.8점)를 능가하는 성능을 보였다.