arXiv:2606.01143v4 Announce Type: replace Abstract: In reinforcement learning (RL) post-training, one prompt fans out into $N$ trajectories, yet standard trainers replay the shared prefix's forward and backward pass $N$ times; in long-context retrieval-augmented generation (RAG) and multimodal workloads, this repetition dominates training compute. Existing designs reuse the prefix within one comp

Topological visualization of PrefixFlow: Training-Time KV Caching for Schedule-Level Prefix Reuse in LLM RL Training
Brave API

PrefixFlow (arXiv:2606.01143) introduces a schedule-level shared-prefix reuse mechanism for LLM RL training (specifically GRPO) that decouples prefix and suffix computation to eliminate redundant processing.

  • Mechanism: The method executes the shared prefix forward pass once and caches the Key/Value (K/V) tensors, then runs suffix microbatches that read this cache and accumulate prefix-side gradients (gK/gV), followed by a single delayed prefix backward pass on the accumulated gradients.
  • Performance: On long-prefix RAG workloads, PrefixFlow achieves up to 1.90× end-to-end speedup (and 6.1× on actor updates), with speedups scaling to 4.4× at high prefix ratios (e.g., 83%).
  • Memory Efficiency: By offloading dormant prefix activations during suffix training, the approach reduces peak High Bandwidth Memory (HBM) usage by up to 59.1% and extends trainable sequence lengths by 1.66×.
  • Compatibility: The schedule is mathematically equivalent to baseline training, compatible with standard parallelism (TP, EP, CP, PP, DP), and preserves Mixture-of-Experts (MoE) router semantics via logical token accounting.
Generated Oct 16, 2026
Open-Weights Reasoning

PrefixFlow targets a major compute inefficiency in LLM reinforcement learning post-training: a single prompt often branches into multiple sampled trajectories, but standard trainers still recompute the shared prompt prefix for each trajectory, including its forward and backward passes. This redundancy becomes especially severe in long-context retrieval-augmented generation and multimodal RL workloads, where the prompt may dominate the sequence length and the rollout fan-out multiplies the wasted computation. The paper frames the issue as a training-time reuse problem rather than a purely inference-side KV-cache optimization, arguing that existing prefix-reuse mechanisms are too narrow to capture the systematic redundancy present in RL training schedules.

The key contribution is a training-time KV caching and scheduling mechanism that enables schedule-level prefix reuse across rollouts. Instead of treating each trajectory as an independent full-sequence training example, PrefixFlow identifies shared prefixes, retains their cached KV or intermediate state for the relevant parameter version, and reuses that state when computing trajectory-level objectives and gradients. The “schedule-level” aspect is central: the system coordinates cache lifetimes, memory usage, and invalidation across microbatches, pipeline stages, or rollout groups so that prefix reuse remains correct and efficient under the constraints of a real RL trainer, rather than relying only on sample-local or component-local reuse.

This matters because RL post-training is increasingly driven by long prompts, large rollout fan-outs, and agentic or multimodal tasks where prefix redundancy is structural rather than incidental. By converting shared prefixes into reusable computation units, PrefixFlow can reduce redundant FLOPs, improve throughput, and lower the practical cost of training on long-context workloads. More broadly, the work points to a useful systems insight for LLM RL: efficient training increasingly depends not only on better algorithms, but on schedule-aware computation reuse that exploits the structure of how prompts, rollouts, and gradients are organized.

Generated Oct 16, 2026
Sources