TL;DR
This paper introduces RollPacker, a system that significantly speeds up Reinforcement Learning (RL) post-training for Large Language Models (LLMs) by addressing GPU underutilization caused by uneven response lengths. It achieves this through a novel "tail batching" strategy and system-level optimizations, leading to substantial training time reductions without sacrificing accuracy.
What Problem Does This Paper Address?
Large Language Models (LLMs) often require Reinforcement Learning (RL) for post-training to improve their reasoning abilities. A common approach is synchronous RL, where training steps are tightly coupled. However, this method suffers from "GPU bubbles" – periods where GPUs are idle – because LLM responses in the "rollout" stage (where the model generates text) vary greatly in length. Some responses are very long, forcing all GPUs to wait until the longest one is finished, even if others completed much earlier. While some solutions relax synchronization, they can hurt training accuracy. This paper tackles the challenge of speeding up synchronous RL post-training without compromising its accuracy, specifically by addressing the inefficiency caused by these long-tail response lengths.
Methods
The core innovation is tail batching, a new prompt scheduling strategy. Instead of processing all prompts uniformly, tail batching groups prompts that generate long responses into dedicated "long rounds," while most prompts (those with shorter responses) are processed in efficient "short rounds." This is achieved by:
- Speculative Execution: In short rounds, more prompts are launched than needed, and only the fastest completing ones are kept, naturally filtering out long responses.
- Long-Prompt Queue: Prompts that would generate long responses are deferred to a dedicated "long round" where speculative execution is disabled, ensuring they are eventually processed.
To maximize the benefits of tail batching, RollPacker also introduces three system-level optimizations:
- Parallelism Planner: Dynamically adjusts Tensor Parallelism (TP) configurations during rollout to match varying GPU memory pressure between short and long rounds.
- Reward Scheduler: Optimizes reward computation by making it asynchronous and adaptively adjusting compute budgets, especially for tasks like code execution and LLM-as-a-Judge.
- Stream Trainer: Overlaps rollout and training stages by streaming completed prompts to the training process and repurposing idle GPUs, while carefully maintaining on-policy semantics.
Datasets
The paper uses real-world datasets for training and evaluation, specifically mentioning:
- Mathematics datasets [20]
- Code generation datasets [54]
- Multi-subject question answering datasets
The models used are from the Qwen2.5 family [5].
Key Insights and Ideas
- Long-tail responses are the primary bottleneck: The paper empirically shows that the rollout stage, dominated by the variability in response lengths, accounts for about 70% of the total RL training time.
- Tail batching preserves accuracy: By simply reordering prompts and not relaxing synchronization, tail batching avoids the accuracy degradation seen in other asynchronous methods.
- System-level optimizations are crucial: Tail batching alone isn't enough; the parallelism planner, reward scheduler, and stream trainer are essential for fully realizing the speedup benefits by addressing bottlenecks in other stages of the RL pipeline.
- Dynamic resource allocation pays off: Adapting TP configurations and intelligently scheduling reward computation and training based on workload characteristics significantly boosts efficiency.
Key Results
- End-to-End Speedup: RollPacker achieves a 2.03x-2.56x end-to-end training time reduction compared to veRL [45] and up to a 2.24x speedup compared to RLHFuse [63] on Qwen2.5 models.
- Rollout Efficiency: Tail batching alone can reduce rollout time by up to 1.48x.
- Accuracy: RollPacker demonstrates validation accuracy curves nearly identical to standard synchronous RL training, indicating no loss in performance.
- Scalability: The system scales well, showing strong performance and throughput increases on up to 128 H800 GPUs.
Limitations and Future Work
- GPU Sharing: The use of Multi-Process Service (MPS) for GPU sharing in the reward stage does not guarantee error isolation. Future work could explore Green Contexts for improved fault tolerance.
- Parallelism Planner: The current parallelism planner focuses on Tensor Parallelism (TP) and does not optimize for expert parallelism. Expanding this optimization space is a future direction.
- Asynchronous Systems: The paper suggests extending tail batching to asynchronous off-policy RL systems, leveraging existing techniques for queue processing and the reward scheduler/stream trainer for efficiency.
Summary updated