Position-Independent KV Cache and Reasoning Token-Based Global Cache Reuse
By mindec ·
Contents (21)
1. Introduction and Background
In large language model (LLM) applications—particularly retrieval-augmented generation (RAG), multi-document summarization, and compound AI agent systems—processing long contexts is essential. However, the computational cost of the prefill stage and the resulting Time-To-First-Token (TTFT) latency remain major bottlenecks for system scalability.
To address this challenge, KV caching (context/prompt caching), which stores and reuses Key-Value vectors computed during previous inference passes, has been widely adopted. However, caching mechanisms in conventional serving engines (e.g., vLLM, SGLang) rely strictly on prefix matching, imposing critical limitations:
- Order Dependency and Cache Invalidation: In RAG workflows, even if identical documents are retrieved, any change in document ordering caused by retrieval score fluctuations—or variations in leading user queries/system prompts—completely invalidates the KV cache, forcing a full prefill recomputation from scratch.
- Isolation Across Sessions and Users: Because caches cannot be shared across prompts with differing prefixes, identical knowledge chunks referenced repeatedly by millions of users cannot be reused at a global level.
This document analyzes position-invariant/position-independent document-level caching, cross-document reasoning token integration, and the resulting global KV cache reuse architecture, summarizing the latest foundational research and empirical findings.
2. Conceptual Framework and Mechanism Analysis
2.1 Intra-Document vs. Inter-Document Attention Asymmetry
Empirical analysis of self-attention in Transformer models reveals a stark structural asymmetry:
- Intra-document: Tokens within the same document or passage exhibit tight semantic and syntactic coupling, forming dense attention patterns.
- Inter-document: Cross-attention between independently written document chunks is highly sparse or carries negligible weight. Models typically encode the independent semantics of each chunk first, coupling cross-document clues only during final answer synthesis.
Consequently, rather than forcing all documents into a single long sequence requiring O(N^2) joint attention, encoding and caching each document chunk independently before assembling them at runtime is both structurally and mathematically sound.
2.2 Position-Independent Chunk Encoding and Assembly (Compile & Link)
To cache documents independently and assemble them in arbitrary permutations, a Compile & Link paradigm is applied:
- Compile Phase: Each document chunk is pre-encoded starting at relative position 0 (
\text{Position ID} = 0) through the LLM, and the resulting KV vectors are stored independently in a global KV store. - Link Phase (Positional Re-encoding):
- Upon receiving a user request, pre-cached KV blocks for retrieved chunks are loaded in any arbitrary order.
- Leveraging relative positional properties (such as Rotary Position Embedding / RoPE), Key vectors undergo a rotational shift transformation to align with their actual global sequence offsets.
- This enables instantaneous memory-level concatenation of KV cache blocks without recomputing the raw prompt text.
2.3 Restoring Cross-Document Attention and the Role of Reasoning Tokens
Simply concatenating independently encoded chunks introduces two fundamental failure modes:
- Attention Sink Distortion: Because each chunk was encoded starting at position 0, excessive attention mass concentrates on the initial tokens of each chunk, preventing the model from properly attending to preceding chunks.
- Interruption of Cross-Document Multi-Hop Reasoning: Complex cross-document factual verification and multi-hop reasoning are omitted during independent offline encoding.

Attention Sink phenomenon and initial token attention concentration structure
Source: MIT HAN LabThe figure above illustrates the attention sink phenomenon where extreme attention scores concentrate on the initial tokens, alongside the corresponding KV cache retention structure. When encoding chunks independently from position 0, identical sink artifacts occur across chunk boundaries, requiring systematic static or dynamic correction.
To address this, reasoning tokens (thinking tokens / latent scratchpads) serve a pivotal role:
- Cross-Attention Synthesis During Decoding: Following chunk assembly and user query presentation, the model enters an explicit thinking phase. As it generates sequential reasoning tokens, each token dynamically cross-attends across all loaded KV caches of the assembled chunks, gathering and synthesizing dispersed cross-document evidence.
- Trainable Link Tokens and Selective Boundary Recomputation: Introducing learned link tokens between chunk boundaries or selectively recomputing the first
ktokens per chunk neutralizes attention sink artifacts, allowing subsequent reasoning tokens to traverse the global context unimpeded.
2.4 Cross-Session and Cross-User Global Knowledge Cache
While standard prefix caching cannot share cached states across different users due to distinct queries, position-independent assembly offers transformative advantages:
- Immutable enterprise knowledge bases (e.g., technical documentation, manuals, wikis) are compiled once offline into a shared global KV repository.
- Regardless of which chunks are retrieved or how they are ordered, any user session can instantly link the required KV blocks, achieving a theoretical 100% cache hit rate for enterprise knowledge chunks.
3. Review of Prior Studies and Quantitative Results
Key research efforts investigating position-independent caching (PIC) and cross-document attention recovery report the following empirical findings:
3.1 Prompt Cache: Modular Attention Reuse (MLSys 2024)?
- Core Concept: Pre-computes and caches reusable text segments (system prompts, few-shot examples, document templates) as standalone "prompt modules".
- Performance: Achieved 8–10x TTFT reduction for shared prefixes; however, strict prefix-matching constraints cause total cache invalidation when document orders change or dynamic queries precede text.
- Accuracy Degradation: When modules are reused across mismatched prefixes without positional re-encoding, positional embedding distortions lead to catastrophic QA degradation (e.g., HotpotQA drops to 20.5%, NaturalQuestions to 18.6%).
3.2 CacheBlend: Fast LLM Serving for RAG with Cached Knowledge Fusion (ACM EuroSys 2025 Best Paper)?

System architecture of CacheBlend (Loading Controller, KV Cache Store, Cache Fusor, and tiered storage pipeline)
Source: velogThe figure above displays CacheBlend's system architecture (EuroSys '25), comprising a KV Cache Store for chunk management, a Loading Controller for hiding retrieval latency, and a Cache Fusor for selective recomputation.
- Core Concept: Dynamically detects the top ~15% of tokens exhibiting high KV discrepancy (HKVD) via a layer-1 forward pass over assembled chunks, selectively recomputing only those tokens in subsequent layers to approximate full cross-attention.
- Quantitative Results:
- Latency and Throughput: Reduces TTFT by 2.2x to 3.3x compared to full prefill recomputation, improving serving throughput by 2.8x to 5x at equivalent TTFT targets.
- Accuracy Preservation: Matches full recomputation ROUGE/F1 scores on single-document summarization (e.g., MultiNews, SAMSum).
- Multi-Hop Bottleneck: Recomputing only 15% of tokens causes severe performance collapse on complex multi-hop queries (e.g., on Llama-3.2-1B, HotpotQA drops to 28.7% vs. 49.3% baseline, and MuSiQue drops to 3.7% vs. 13.8% baseline).
3.3 EPIC & LegoLink: Efficient Position-Independent Caching (arXiv 2024/2026, Hu et al.)

Comparison diagram of Position-Independent Code and Position-Independent Cache (PIC) Compile & Link architecture
Source: icml.ccThe figure above illustrates EPIC's framework (Figure 2), adapting the position-independent code (PIC) compile-and-link paradigm from C compilers to independently pre-encode chunks at offset 0 and dynamically link them at runtime.
- Core Mechanism: Formalizes PIC into a two-phase "Compile & Link" architecture. It identifies the root cause of attention errors during independent pre-encoding as the Attention Sink effect—where initial tokens encoded at position 0 absorb disproportionate attention mass and obstruct cross-chunk attention.
- LegoLink Algorithm: Replaces costly dynamic discrepancy detection with a static recomputation of the first
ktokens (k \le 32) per chunk, cutting fusion complexity fromO(0.15 N^2)toO(kN) \sim O(N). - Quantitative Results:
- TTFT and Throughput: Achieves up to 3x further TTFT reduction over CacheBlend (up to 8x over non-cached prefill), delivering up to 7x throughput improvement under concurrent workloads.
- Accuracy Retention: Limits accuracy drop to within 7% on LongBench (2WikiMQA, HotpotQA, MultiNews) and Needle-in-a-Haystack evaluations compared to full prefill.
3.4 KVLink: Accelerating LLMs via Efficient KV Cache Reuse (NeurIPS 2025/2026, Yang et al.)

Positional Re-encoding and Link Token mechanism in KVLink
Source: NeurIPS 2026The figure above shows KVLink's RoPE rotational re-encoding of Key vectors and the insertion of learned Link Tokens between chunks to enable attention routing across preceding documents.
- Core Innovations:
- KV Cache Positional Re-encoding: Applies RoPE rotational shifts to Key vectors during assembly to align coordinates with global sequence offsets.
- Trainable Link Tokens: Inserts 1–5 learned link tokens between independently pre-encoded chunks, bridging representations and enabling full cross-chunk attention without recomputing pre-encoded content.
- Quantitative Results:
- TTFT Reduction: Yields an 85% to 96% reduction in TTFT across various context lengths (reaching 96% reduction at 5,000 tokens).
- Substantial QA Gains: Outperforms prior caching approaches significantly on Llama-3.2-1B: NaturalQuestions reaches 45.0% (vs. CacheBlend 25.7%), 2WikiMQA reaches 66.0% (vs. CacheBlend 31.0%), HotpotQA reaches 55.6% (vs. CacheBlend 28.7%), and MuSiQue reaches 19.2% (vs. CacheBlend 3.7%).
- General Capability Preservation: Maintains baseline accuracy across general reasoning benchmarks (IFEval, GSM8K, MMLU) without catastrophic forgetting.
- Synergy with Cache Compression: Integrates seamlessly with KV compression methods (e.g., AnLLMs), maintaining robust accuracy even under 50%–75% KV cache footprint reductions.
arXivSource 1, KVLink : Accelerating Large Language Models via Efficient KV Cache ReuseWe describe KVLink , an approach for efficient key-value (KV) cache reuse in large language models (LLMs). In many LLM applications, different inputs can share overlapping context, such as the same retrieved document appearing in multiple queries. However, the LLMs still need to encode the entire context for each query, leading to redundant computation. In this paper, we investigate a new strategy to eliminate such inefficiency, where the KV cache of each document is precomputed independently.…
arXivSource 2, Epic : Efficient Position-Independent Caching for Serving Large Language ModelsLarge Language Models (LLMs) show great capabilities in a wide range of applications, but serving them efficiently becomes increasingly challenging as requests (prompts) become more complex. Context caching improves serving performance by reusing Key-Value (KV) vectors, the intermediate representations of tokens that are repeated across requests. However, existing context caching requires exact prefix matches across requests, limiting reuse cases in settings such as few-shot learning and…
4. Benchmark Performance Comparison
The quantitative results across QA and long-context benchmarks from foundational studies (KVLink, EPIC, CacheBlend) are summarized below (evaluated on Llama-3.2-1B and 8B models):
4.1 Quantitative Performance Comparison
| Metric / Benchmark | Baseline (Full Recompute) | Prompt Cache (Prefix Mismatch) | CacheBlend (Top 15% Dynamic Recompute) | LegoLink / EPIC (Static First k Recompute) | KVLink (Positional Re-encoding + Link Tokens) |
|---|---|---|---|---|---|
| NaturalQuestions (QA) | 44.6% | 18.6% | 25.7% | - | 45.0% (Matches baseline) |
| HotpotQA (Multi-hop) | 49.3% | 20.5% | 28.7% | F1 drop < 7% | 55.6% (+6.3%p over baseline) |
| 2WikiMQA (Multi-hop) | 61.8% | 19.5% | 31.0% | F1 drop < 5% | 66.0% (+4.2%p over baseline) |
| MuSiQue (Complex QA) | 13.8% | 1.4% | 3.7% | - | 19.2% (Preserves complex reasoning) |
| TTFT Reduction | Baseline (0%) | Conditional 80–90% (Matching prefix only) | 55% – 70% reduction (2.2–3.3x) | Up to 88% reduction (3–8x) | 85% – 96% reduction (96% at 5k tokens) |
| Throughput Improvement | Baseline (1x) | Conditional 2–3x | 2.8x – 5x increase | Up to 7x increase | Supports high-concurrency workloads |
| Prefill Computational Complexity | O(N^2) | O(N^2) (Full recompute on mismatch) | O(0.15 \times N^2) | O(kN) \sim O(N) | O(L \cdot N) \sim O(N) (L: Number of Link Tokens) |
arXivSource 2, Epic : Efficient Position-Independent Caching for Serving Large Language ModelsLarge Language Models (LLMs) show great capabilities in a wide range of applications, but serving them efficiently becomes increasingly challenging as requests (prompts) become more complex. Context caching improves serving performance by reusing Key-Value (KV) vectors, the intermediate representations of tokens that are repeated across requests. However, existing context caching requires exact prefix matches across requests, limiting reuse cases in settings such as few-shot learning and…
arXivSource 1, KVLink : Accelerating Large Language Models via Efficient KV Cache ReuseWe describe KVLink , an approach for efficient key-value (KV) cache reuse in large language models (LLMs). In many LLM applications, different inputs can share overlapping context, such as the same retrieved document appearing in multiple queries. However, the LLMs still need to encode the entire context for each query, leading to redundant computation. In this paper, we investigate a new strategy to eliminate such inefficiency, where the KV cache of each document is precomputed independently.…
5. Critical Limitations and Unresolved Challenges
While prior studies demonstrate substantial progress in TTFT latency reduction and cache reuse, deploying these techniques in production environments for demanding reasoning tasks reveals several open challenges:
5.1 Degradation in Multi-Hop Reasoning and Limitations of Single-Pass Prefill
- The Problem: Conventional methods (CacheBlend, LegoLink) rely on static or lightweight recomputation during prefill. However, for multi-hop queries (e.g., MuSiQue, HotpotQA) requiring evidence scattered across multiple documents, cross-chunk attention remains insufficient, resulting in hallucinations or missed deductions.
- Mitigation (Crucial Role of Reasoning Tokens): Instead of relying entirely on single-pass prefill, models are guided to produce explicit reasoning tokens (thinking tokens / CoT / latent scratchpad). As decoding proceeds, each reasoning token dynamically attends across all pre-cached chunk representations, actively retrieving and synthesizing dispersed facts to restore deep interactions lost during offline compilation.
5.2 Runtime Overhead and Scalability Bottlenecks of Dynamic Selection
- The Problem: CacheBlend's dynamic identification of the top 15% HKVD tokens requires executing a full forward pass on layer 1 for every incoming request. This selection overhead consumes 16.3% to 63.5% of total TTFT. As context lengths scale to 32k–128k tokens, the residual
O(0.15 N^2)complexity triggers memory spikes and latency surges. - Mitigation: Eliminate runtime dynamic discrepancy scoring in favor of static boundary recomputation (
O(kN)) as in LegoLink, orO(1)RoPE coordinate shifts as in KVLink.
5.3 Fine-Tuning Dependency vs. Universal Serving Flexibility
- The Problem: Although KVLink achieves superior accuracy retention, it requires thousands of fine-tuning steps over multi-task corpora (e.g., 2WikiMQA, FineWeb, Tülu 3) to align Link Token embeddings with model weights. This limits immediate applicability to proprietary closed-source models or models where fine-tuning is cost-prohibitive.
- Mitigation:
- Advance tuning-free attention sink masking and calibration techniques that operate without modifying weights.
- Leverage native thinking behaviors in general reasoning models (e.g., DeepSeek-R1, OpenAI o-series) to bridge cross-document contexts at the decoding level without custom fine-tuning.
5.4 KV Storage Footprint and Host-to-GPU I/O Transfer Bottlenecks
- The Problem: Pre-compiling millions of chunks creates tens of terabytes (TB) of FP16 KV data. Storing this entirely within GPU HBM is infeasible, necessitating real-time streaming from CPU DRAM or NVMe SSDs over PCIe buses, where I/O transfer latency can negate prefill computational gains.
- Mitigation:
- KV Cache Quantization and Pruning: Apply FP8/INT4 quantization and token pruning (e.g., AnLLMs, KIVI) to reduce transfer volume by 50%–75%.
- Intelligent Tiered Prefetching: Overlap retrieval and execution by prefetching candidate chunk KV caches asynchronously into GPU HBM based on retriever queue signals.
5.5 Chunk Granularity and Boundary Discontinuities
- The Problem: Mechanically segmenting text into fixed token blocks (e.g., 512 tokens) fractures sentences and semantic units, severing boundary attention. Furthermore, trailing information at the end of a chunk is not naturally conveyed to subsequent chunks.
- Mitigation: Adopt semantic chunking along paragraph/section boundaries and establish structured chunk boundary protocols featuring small overlapping windows that are deduplicated during assembly.
arXivSource 1, KVLink : Accelerating Large Language Models via Efficient KV Cache ReuseWe describe KVLink , an approach for efficient key-value (KV) cache reuse in large language models (LLMs). In many LLM applications, different inputs can share overlapping context, such as the same retrieved document appearing in multiple queries. However, the LLMs still need to encode the entire context for each query, leading to redundant computation. In this paper, we investigate a new strategy to eliminate such inefficiency, where the KV cache of each document is precomputed independently.…
arXivSource 2, Epic : Efficient Position-Independent Caching for Serving Large Language ModelsLarge Language Models (LLMs) show great capabilities in a wide range of applications, but serving them efficiently becomes increasingly challenging as requests (prompts) become more complex. Context caching improves serving performance by reusing Key-Value (KV) vectors, the intermediate representations of tokens that are repeated across requests. However, existing context caching requires exact prefix matches across requests, limiting reuse cases in settings such as few-shot learning and…
6. System Architecture and Production Implementation Considerations
Deploying this architecture in production inference engines (e.g., vLLM, SGLang) requires addressing key engineering considerations:
- Optimized RoPE Shift Kernels:
- Implement custom GPU kernels (Triton / CUDA) to apply phase rotation offsets (
P_{offset}) to position-0 Key vectors during memory loading with minimal overhead.
- Implement custom GPU kernels (Triton / CUDA) to apply phase rotation offsets (
- Static Attention Sink Isolation:
- Place virtual sink tokens at chunk beginnings during compilation, or combine assembly with lightweight static recomputation of the first 16–32 tokens (LegoLink style) to eliminate sink distortion.
- Reasoning Token Compute Budget and Termination Control:
- Encourage reasoning tokens to perform thorough cross-attention while enforcing dynamic thinking budgets tailored to task complexity to prevent latency inflation.
- Hierarchical Global KV Pool and PagedAttention Extension:
- Architect a multi-tiered storage manager spanning Host Memory (CXL/DRAM), high-speed NVMe SSDs, and GPU HBM, orchestrating chunk lifetimes (LRU/LFU caching) across PagedAttention blocks globally.
arXivSource 2, Epic : Efficient Position-Independent Caching for Serving Large Language ModelsLarge Language Models (LLMs) show great capabilities in a wide range of applications, but serving them efficiently becomes increasingly challenging as requests (prompts) become more complex. Context caching improves serving performance by reusing Key-Value (KV) vectors, the intermediate representations of tokens that are repeated across requests. However, existing context caching requires exact prefix matches across requests, limiting reuse cases in settings such as few-shot learning and…
arXivSource 1, KVLink : Accelerating Large Language Models via Efficient KV Cache ReuseWe describe KVLink , an approach for efficient key-value (KV) cache reuse in large language models (LLMs). In many LLM applications, different inputs can share overlapping context, such as the same retrieved document appearing in multiple queries. However, the LLMs still need to encode the entire context for each query, leading to redundant computation. In this paper, we investigate a new strategy to eliminate such inefficiency, where the KV cache of each document is precomputed independently.…
7. Conclusion
Combining position-invariant chunk caching with dynamic assembly and reasoning token-driven cross-document synthesis addresses the dual bottlenecks of prior methods: cross-document multi-hop reasoning breakdown and runtime prefill overhead.
By pairing lightweight positional re-encoding (O(1)) and static boundary stabilization with decoding-time reasoning tokens, this paradigm cuts TTFT by more than 90% while fully restoring complex multi-hop reasoning, unlocking 100% global cache reuse across enterprise knowledge workloads.