[논문 리뷰] RelayCaching: Accelerating LLM Collaboration via Decoding KV Cache Reuse
RelayCaching은 업스트림 에이전트의 디코딩 단계 KV 캐시를 다운스트림 프리필 단계에서 재사용하고, 중간 계층 토큰의 선택적 정정을 통해 정확성을 유지하면서 80% 이상의 KV 캐시 재사용과 최대 4.7× TTFT 감소를 달성하는 학습 없이 실행하는 추론 방법이다.
The increasing complexity of AI tasks has shifted the paradigm from monolithic models toward multi-agent large language model (LLM) systems. However, these collaborative architectures introduce a critical bottleneck: redundant prefill computation for shared content generated by previous agents, which significantly increases KV cache memory usage and time-to-first-token (TTFT). While various KV cache methods have been proposed to mitigate prefill redundancy, they either fail to maintain accuracy on agent-generated outputs or exhibit low reuse rates due to rigid constraints. We present RelayCaching, a training-free inference method that directly reuses decoding phase KV caches from previous agents in subsequent prefill phases. Our key insight is that KV caches for identical content are highly consistent across phases, while prefix-induced deviations are sparse and localized within a limited range of layers and token positions. By selectively recomputing KV caches at these positions, RelayCaching preserves model accuracy with minimal overhead, yielding a superior accuracy-efficiency trade-off over existing methods. Experiments on diverse collaborative LLM tasks spanning mathematical reasoning, general knowledge, and code generation demonstrate that RelayCaching achieves over 80% KV cache reuse, reduces TTFT by up to $4.7 imes$ compared to the standard pipeline, all with negligible accuracy degradation.
연구 동기 및 목표
- 공유 콘텐츠의 연쇄로 인해 다중 에이전트 LLM 파이프라인에서 중복되는 프리필 계산의 감소를 촉진한다.
- decode-to-prefill 재사용 하에서 디코딩 KV 캐시가 전체 프리필 캐시와 어떻게 정렬되는지 특징화한다.
- 정확성을 유지하기 위해 KV 캐시를 선택적으로 정정하는 학습 없이 가능한 방법을 개발한다.
- 추론, 코딩, 지식 벤치마크 전반에 걸친 RelayCaching의 효율성 향상과 정확도 유지가 이를 입증한다.
제안 방법
- 레이어와 토큰에 걸친 디코딩과 전체 프리필 캐시 간의 거시적·미시적 KV 캐시 정렬(일치)을 분석한다.
- U자형 계층별 유사성 패턴과 희소한 계층 간 상관 토큰 편차를 식별한다.
- 핵심 중간 계층 범위를 찾기 위한 오프라인 레이어-Range 프로파일러와 토큰 정정을 위한 탐지 레이어를 설계한다.
- 편차 기반 및 영향력 기반 기준을 결합하는 토큰 선택기를 도입하여 정정할 희소한 토큰 집합을 결정한다.
- RelayCaching을 레이어-범위 프로파일러와 토큰 선택기로 구성된 두 부분 시스템으로 구현하여 전체 재계산 없이 프리필 중 선택적 재계산을 가능하게 한다.
실험 결과
연구 질문
- RQ1RQ1: RelayCaching은 디코딩 KV 캐시를 재사용하면서 전체 프리필과 비교할 만큼의 생성 품질을 유지할 수 있는가?
- RQ2RQ2: 다중 에이전트 설정에서 RelayCaching이 달성할 수 있는 효율성 향상( KV 캐시 재사용률 및 TTFT 속도 향상)은 얼마인가?
- RQ3RQ3: 레이어-범위 프로파일러와 토큰 선택기가 정확도-효율성 균형에 어떻게 기여하는가?
- RQ4RQ4: 핵심 하이퍼파라미터 및 작업 맥락에 대해 RelayCaching의 민감도는 어느 정도인가?
주요 결과
- 디코딩 KV 캐시는 프리픽스 변동에도 불구하고 전체 프리필 캐시와 높은 정합성을 유지하며, 값 코사인 유사도가 주요 편차 신호이다.
- 중간 계층은 U자형 유사도 프로필에서 가장 큰 편차를 보이며, 하류 생성 품질을 지배한다.
- 토큰 단위 편차는 희박하고 계층 간 상관이 강해 매우 선택적인 정정을 가능하게 한다.
- RelayCaching은 여러 작업에서 80% 이상 KV 캐시 재사용과 최대 4.7× TTFT 감소를 달성하면서 정확도는 전체 프리필에 거의 근접하게 유지한다.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.