KV Cache Becomes Editable and Composable for Faster LLM Inference

Bojie Li· June 17, 2026 View original

Summary

Researchers discovered that large language models "take notes" in their KV cache during prefill, storing field-conditioned conclusions rather than just raw input. This insight enables the KV cache to be edited and composed, allowing for significant latency reductions (up to 398x) by modifying specific parts of the cache instead of full recomputation, while maintaining decision fidelity.

Current prefix caching in large language models (LLMs) is limited, requiring full recomputation if even a single field in the input prefix changes. This is because the KV cache is typically seen as a static storage of input tokens. However, new research reveals that during the prefill phase, LLMs effectively "take notes" within their KV cache, storing conclusions conditioned on specific input fields rather than just raw key/value vectors. This understanding fundamentally changes how the KV cache can be utilized. It implies that the cache is not merely a memory but a dynamic "notebook" of memoized decisions. This allows for two powerful new capabilities: editability and composability. The KV cache can now be directly edited to amend specific "notes," for instance, correcting an erratum. With chain-of-thought prompting, editing a single field in the cache can recover the original decision with minimal computation. Furthermore, these "notes" are position-portable, meaning precompiled skills or segments of computation can be repositioned and spliced into any context within the cache. This composability allows for significant speedups, achieving decision-identical results to full recomputation but at O(L) rather than O(L^2) time-to-first-token complexity. An integrated edit-and-compose agent can reduce latency by up to 14.9x, and when combined with production prefix caching, it can cut p90 time-to-first-token by 53-398x, making LLM inference much more efficient across various model types and attention mechanisms.

Why it matters

This breakthrough significantly improves the efficiency and flexibility of large language model inference, enabling faster responses, reduced computational costs, and more dynamic interaction with LLMs by allowing on-the-fly edits and composition of precomputed segments.

How to implement this in your domain

  1. 1Investigate integrating editable KV cache mechanisms into LLM serving infrastructure for dynamic content updates.
  2. 2Develop workflows for composing precompiled "skill" segments into LLM prompts to accelerate complex tasks.
  3. 3Optimize LLM applications to leverage KV cache editing for rapid correction of factual errors or parameter changes.
  4. 4Benchmark the latency and throughput improvements of editable and composable KV caches in production environments.

Who benefits

AI DevelopmentCloud ComputingSoftware DevelopmentCustomer ServiceContent Generation

Key takeaways

  • LLMs "take notes" in their KV cache during prefill, storing field-conditioned conclusions.
  • This makes the KV cache editable, allowing for corrections without full recomputation.
  • The KV cache is also composable, enabling splicing of precompiled skills into any context.
  • These capabilities drastically reduce LLM inference latency and computational costs.

Original post by Bojie Li

"arXiv:2606.17107v1 Announce Type: new Abstract: Prefix caching reuses prefill only across an exactly shared prefix, so one changed field invalidates the entire downstream cache. Yet overwriting the field's own key/value vectors and reusing the rest leaves the model acting on the…"

View on X

Originally posted by Bojie Li on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses