Manuscript Offprint

arXiv:2611.09207

RPEG: Training Reasoning Language Models Scalably and Cost-Effectively

Maciej Besta, Leonard Schmidt, Pierre Pang, Patrik Okanovic, Robert Gerstenberger, Torsten Hoefler

Maciej Besta*†, Leonard Schmidt†, Pierre Pang†, Patrik Okanovic, Robert Gerstenberger, Torsten Hoefler

Department of Computer Science, ETH Zurich

Abstract—Reinforcement learning (RL) is now central to training Reasoning Language Models (RLMs), but RLM pipelines are difficult to scale and costly to run because each RL step couples multiple large models, heterogeneous stages, cross-step state, and complex asynchronous dependencies. Existing systems typically optimize only parts of this design space. We address this complexity by jointly optimizing the pipeline structure as well as its execution using a novel data-centric graph intermediate representation called RLM Pipeline Execution Graph (RPEG). RPEG exposes structural choices such as bounded asynchrony and actor-critic sharing together with execution optimizations such as stage fusion, fine-grained scheduling, and multi-dimensional model parallelism. It is coupled with a comprehensive analytical performance model for RLM training, jointly capturing compute, communication, memory, and hierarchical rack-, node-, and GPU-level effects. Across systems with up to 256 GH200 GPUs, our distributed runtime engine implementing RPEG improves performance by up to 2× over ReaL and reduces step latency by up to 2.48× over verl, while increasing hardware utilization by up to 30%. Overall, RPEG provides a graph-driven foundation for next-generation training pipelines for frontier reasoning LLMs.

Code: https://github.com/spcl/RPEG

I. INTRODUCTION

ReINFORCEMENT learning (RL) has become central to post-training large language models (LLMs) for human preferences, safety constraints, and task-specific objectives [4, 38, 48]. More recently, RL-based post-training has become the foundation of reasoning language models (RLMs, also called reasoning models): models that perform extended reasoning, produce chain-of-thought (CoT) trajectories [52], exploit richer structures [6, 7, 14, 58, 60], self-correct [15], and allocate more computation to harder problems [21, 23, 36]. Examples include DeepSeek-R1 [23], GPT-5 Thinking [47], Kimi K2.5 Thinking [3], and Grok 4.7 [56]. Here, RL becomes a mechanism by which models learn to reason. The computational footprint is enormous and continues to grow: frontier-scale models consume millions of GPU-hours, while scaling both train-time RL and inference-time reasoning continues to improve model capabilities [20, 30, 35]. These costs grow further in agentic systems [8, 12, 13, 16, 28, 32, 51, 55, 57, 59]: long-horizon tool use and multi-agent execution increase system overhead [26], with reported token usage reaching 4×–15× that of ordinary chat [1] and roughly three orders of magnitude higher for agentic coding workloads [2].

Yet, RLM post-training is substantially more complex than a single-model workload. In the canonical Proximal Policy

Optimization (PPO) pipeline, each step comprises a generation stage that samples responses with a trainable actor (also called policy), an assessment stage that evaluates them using a reward model, critic, and frozen reference model, and a training stage that updates the trainable components [31, 62]. Other widely used online RLM-training paradigms, such as Group Relative Policy Optimization (GRPO) [43], simplify parts of this pipeline (for example by removing the critic) but retain essentially the same generation–assessment–training template and its heterogeneous execution characteristics. In PPO, generation is autoregressive and latency-sensitive, assessment is largely teacher-forced and throughput-oriented, while training adds backward passes, optimizer state, and parameter updates. RLM training is therefore simultaneously multi-model, multi-stage, heterogeneous, and iterative – and fundamentally a parallel and distributed computing problem [53].

Scaling individual models does not by itself optimize an RLM training pipeline. Data (DP), tensor (TP), pipeline (PP), context (CP), sequence (SP), and expert parallelism (EP) must be coordinated with cross-stage placement, state exchange, and execution order [5, 17]. Existing systems pursue three roughly complementary directions: (1) effective execution planning, including placement and parallel-strategy selection in ReaL [31] and HybridFlow/VERL [45], and workflow compilation in RLinf [61]; (2) fine-grained and asynchronous execution, including sample- and microbatch-level fusion in RLHFuse [63] and decoupled rollout–training pipelines in AReaL [22], Laminar [44], and StaleFlow [29]; and (3) adaptive resource orchestration, which adjusts parallelism or reallocates resources as workloads evolve [18, 49, 50]. These mechanisms increasingly coexist within the same system.

The key design question is therefore how broadly these decisions can be optimized together. Aspects such as overlap, placement, parameter freshness, model sharing, parallelism, sharding vs. replication, and memory cannot be optimized independently: improving one may increase communication, resharding, or memory pressure elsewhere. This interaction becomes even more important on hierarchical supercomputers, where communication costs differ substantially within a node, across nodes, and across racks. Finally, maximizing throughput alone may still leave expensive hardware poorly utilized. Taken together, these couplings make it difficult to achieve both high performance and high hardware utilization while respecting communication and memory constraints.

We address this challenge by optimizing not only how an RLM pipeline executes, but also selected aspects of the pipeline structure itself (contribution 1). We represent both

*Corresponding author †Core contributions

Simple Established Baselines

Figure

RPEG

Fig. 1: Representative PPO schedules selected by different planners. RPEG exposes stage-level and fine-grained overlap, enabling disaggregated placements and bounded-asynchrony that are not available under fully colocated or coarse-stage baselines. No AI was used to conceive or draw the picture.

jointly as a single optimization object C=(G∘,P)C = (G^{\circ}, P), exposing structural and execution decisions within one searchable configuration space. Specifically, the compact steady-state graph G∘G^{\circ} captures the recurring pipeline structure and cross-step state semantics, including structural variants such as bounded asynchrony and actor-critic (AC) sharing [17]; the execution plan P specifies per-invocation hardware mapping, multi-dimensional model parallelism, and microbatching. Thus, the pipeline itself becomes an optimization variable rather than merely a fixed graph to be mapped onto hardware.

We realize this abstraction in the RLM Pipeline Execution Graph (RPEG), a data-centric graph intermediate representation and optimization framework (contribution 2). Inspired by property graphs from the graph database domain [9–11], RPEG is property-rich rather than a bare dependency graph, compactly attaching rich data (e.g., the model, role, staleness, execution semantics) needed for subsequent optimization. A staged graph-transformation pipeline materializes execution refinements such as stage fusion and fine-grained sub-invocation execution, and converts each candidate configuration C into a schedulable hardware-aware graph. This allows the optimizer to evaluate structural and execution choices jointly without directly searching a fully materialized multi-step graph. We showcase RPEG execution plans in Figure 1.

We further develop a distributed-memory runtime (contribution 3) that executes the selected RPEG plans faithfully on supercomputers, connecting the graph-level optimization decisions to their physical execution.

RPEG is coupled with a calibrated comprehensive analytical performance model for end-to-end RLM training (contribution 4). The model jointly captures compute, communication, and memory costs of heterogeneous RLM operators, including resharding, pipeline bubbles, optimizer traffic, co-resident model state, and hierarchical GPU-, node-, rack-, and inter-rack communication. Automated hardware calibration replaces reliance on nominal vendor peaks, enabling rapid evaluation of large numbers of candidate plans.

Finally, we comprehensively evaluate RPEG from analytical modeling to large-scale distributed execution (contribution 5). We validate the performance and memory models, study optimizer stability and ablations, and execute RPEG plans on up to 256 GH200 GPUs. Optimized synchronous plans are 1.250−1.471×1.250-1.471\times faster than their executable fully colocated inputs; against RealL, RPEG improves end-to-end performance by up to 2×2\times; and in the controlled synchronous comparison with separate actor and critic models, RPEG achieves up to 2.477×2.477\times lower time per step than VERL (median 1.488×1.488\times). RPEG also improves hardware utilization by up to 30%, while experiments with AC sharing, stage fusion, and bounded asynchrony expose further performance gains and tradeoffs enabled by the representation, all while preserving training semantics and accuracy (within 0.47% of the VERL baseline), and with negligible optimizer overheads even at 2k GPUs.

References (61)