An RL post-training run is a pipeline: sample responses from the current policy, score them, compute a gradient, update the weights, and make the new weights available to the samplers.
Each stage has a different bottleneck (sampling is limited by memory bandwidth and by the longest sequences in a batch, learning by arithmetic and memory capacity), and the stages can run in lockstep or concurrently, in which case the samples are generated by a policy that is already out of date. this article derives the quantities needed to reason about such a system and checks them with simulators and measurements. It proves a bound on the makespan of continuous batching, analyzes importance weights for stale samples (including how they compound over a sequence and where truncation helps and hurts), simulates synchronous and asynchronous pipelines and shows when the queue between them grows without bound, measures the activation memory of a transformer and gives exact expressions for checkpointing and the key-value cache, and builds a throughput model to split devices between sampling and learning.
- Estimate how much generation time is lost to long-tailed lengths, and how continuous batching recovers it.
- Decide when stale samples need importance correction, and what truncating the weights costs.
- Predict the staleness and queue length of an asynchronous pipeline from its rates.
- Compute training and inference memory for a given architecture, and the effect of checkpointing and grouped-query attention.
- Split devices between generation and training so that neither idles.
Continue with the book
Explore the full treatment, worked examples, and exercises in RL for LLM Agents and Reasoning Models.
Companion article for RL for LLM Agents and Reasoning Models, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
