[Paper Review] RelayCaching: Accelerating LLM Collaboration via Decoding KV Cache Reuse
RelayCaching is a training-free inference method that reuses decoding phase KV caches from upstream agents in downstream prefill phases, with selective rectification of middle-layer tokens to achieve over 80% KV cache reuse and up to 4.7× TTFT reduction while preserving accuracy.
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.
Motivation & Objective
- Motivate reduction of redundant prefill computation in multi-agent LLM pipelines caused by cascading shared content.
- Characterize how decoding KV caches align with full-prefill caches under decode-to-prefill reuse.
- Develop a training-free method to selectively rectify KV caches to maintain accuracy.
- Demonstrate the efficiency gains and accuracy retention of RelayCaching across reasoning, coding, and knowledge benchmarks.
Proposed method
- Analyze macro- and micro-level KV cache alignment between decoding and full-prefill caches across layers and tokens.
- Identify the U-shaped layer-wise similarity pattern and sparse, inter-layer correlated token deviations.
- Design an offline layer-range profiler to locate the critical middle-layer range and a detection layer for token rectification.
- Introduce a token selector combining deviation-based and influence-based criteria to determine the sparse set of tokens to rectify.
- Implement RelayCaching as a two-part system: layer-range profiler and token selector, enabling selective recomputation during prefill without full recomputation.
Experimental results
Research questions
- RQ1RQ1: Can RelayCaching maintain generation quality comparable to full prefilling while reusing decoding KV caches?
- RQ2RQ2: How much efficiency gain (KV cache reuse rate and TTFT speedup) can RelayCaching achieve in multi-agent setups?
- RQ3RQ3: How do the layer-range profiler and token selector contribute to the accuracy–efficiency trade-off?
- RQ4RQ4: How sensitive is RelayCaching to its key hyperparameters and Task contexts?
Key findings
- Decoding KV caches remain highly aligned with full-prefill caches despite prefix variation, with value cosine similarity as the primary deviation signal.
- Middle layers show the largest deviations in the U-shaped similarity profile, dominating downstream generation quality.
- Token-wise deviations are sparse and show strong inter-layer correlation, enabling highly selective rectification.
- RelayCaching achieves over 80% KV cache reuse and up to 4.7× TTFT reduction across multiple tasks while preserving accuracy close to full prefilling.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.