KV-streams changes how compaction is applied during RL training of agentic LLMs. Instead of flushing the KV cache and reprocessing retained tokens after each compaction, it keeps the KV entries as a continuous stream and uses a custom attention mask to reproduce eviction. This removes repeated prefill cost. Across several compaction strategies and tasks with Qwen models, it delivered 2.6x to 5x wall-clock speedups, with 3x faster time to peak performance on software engineering, at comparable or better final performance. The streamed cache also acts as a recurrent state: information evicted from the context can still influence predictions, and the authors find this behavior emerges from RL alone, without a separate SFT stage.
Streaming KV caches makes agent context compaction faster to train
Across text games and software engineering tasks, KV-streams cut training time while preserving the performance of conventional re-prefill compaction.
Big Tech
Emiliano Penaloza · Dane Malenfant · Dheeraj Vattikonda · Roger Creus Castanyer · Siddarth Venkatraman · Abhay Puri · +12 more
Mila · Microsoft · McGill University · Université de Montréal · Polytechnique Montréal
Research Digest··2 min read
In one line
KV-streams streams KV cache across compactions instead of re-prefilling, achieving 2.6x to 5x faster agent training without performance loss.
Before you read this
Three ideas this paper builds onagentic reinforcement learningTraining approach that lets LLM-based agents learn multi-step tool use and planning via reinforcement learning, often with dense or per-tool rewards.127 papers →context compactionCompressing or summarizing an LLM's past context into a smaller representation to extend memory and improve reasoning within limited token budgets.83 papers →kv cache compressionReducing the size of the key-value cache in transformers via selective retention, low-rank updates, or adaptive compression.87 papers →
Read it as
Penaloza et al. introduce KV-streams, a method that retains and selectively evicts entries from an agent’s key-value cache instead of rebuilding the cache after every context compaction.
Long-running language-model agents accumulate key-value, or KV, caches that consume increasing GPU memory.
How it works
before and afterThe Daily Edition
The front page in your inbox each weekday morning: the lead, the picks, and why each one earned its place.