AI & ML
PrefixFlow: Training-Time KV Caching for Schedule-Level Prefix Reuse in LLM RL Training
arXiv cs.DC0 views
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 computation graph (a packed sequence, fused kernel, or tree traversal); under the trainer's memory limits and parallelism, their compute savings do not reliably become shorter steps. We present PrefixFlow, which takes the prefix out of that graph and into the training schedule through a training-time KV cache: Phase A runs one prefix forward and caches its keys and values ($K/V$); Phase B trains suffixes as ordinary microbatches that read only $K/V$ and write back only their gradients ($gK/gV$); Phase C runs one delayed prefix backward on the accumulated $gK/gV$. Memory and parallelism then become manageable: dormant prefix activations are offloaded during Phase B to free high-bandwidth memory (HBM) for suffixes, and context, pipeline, and data parallelism each schedule the phases through a local rule while tensor and expert parallelism need no change, so saved compute becomes shorter steps under any microbatch split. On dense models, and on mixture-of-experts (MoE) models under Rollout Routing Replay, PrefixFlow matches full-sequence training within bfloat16 (BF16) tolerance. Against an identically configured baseline, it speeds up end-to-end verl RL training on a long-prefix RAG workload by $1.90\times$ ($6.1\times$ on the actor update). In controlled sweeps, actor-side speedup grows with prefix ratio and group size, reaching $4.4\times$ at an 83% prefix ratio, while suffix-dominated splits gain little; offloading dormant prefix activations lowers Phase-B peak HBM by up to 59% and extends trainable sequences by $1.66\times$.
Source:https://arxiv.org/abs/2606.01143PreviousTensorDex: A Compact, Tensor-Centric Storage System for Modern AI ModelsNextFast TetraBFT: Optimizing Latency Where It Matters
Related posts
Most voted crypto projects on Coinvote, Oct 26 to Nov 1, 2026
0dev.to Data
Bluesky This Week — trending topics & AI brand mentions (2026-11-02)
0dev.to Data
Gemini 4 Carbon e DeepSeek V4.1 Flash Cyber: a Guerra Cibernética Autônoma e o Topo do Artificial Analysis
0dev.to Machine Learning
What can an AI agent do for you every day?
0dev.to Machine Learning
Mon modèle de paris semblait excellent sur 3 671 prédictions. Il n'a jamais battu le bookmaker.
0dev.to Machine Learning
HR manager LinkedIn About section examples you can adapt
0dev.to Career