Lossless acceleration of agentic reinforcement learning

Seil Kang1,2,*, Hangoo Kang1,*, Tarun Suresh1, Youngeun Kim3, Shreyas Pimpalgaonkar4, Seong Jae Hwang2,†, Azalia Mirhoseini1,‡

1Stanford UniversityStanford University logo2Yonsei UniversityYonsei University logo3Korea UniversityKorea University logo4Bespoke LabsBespoke Labs logo

* Core contributor · † Co-corresponding author · ‡ Main corresponding author

GRPOOn-policy distillation (OPD)
GRPO

SWE-bench Verified

GRPOLoading figure layers…
GRPO

Training reward

GRPOLoading figure layers…
OPD

SWE-bench Verified

OPDLoading figure layers…
OPD

Training reward

OPDLoading figure layers…

ThunderSyncRL computes gradients while agent rollouts are still running. It keeps the policy fixed and takes one optimizer step after the batch finishes, preserving the synchronous GRPO and OPD updates.

Why the learner waits

Agentic rollouts finish at different times. Some agents return quickly; others keep editing code, calling tools, or waiting for tests. In our synchronous GRPO and OPD runs, learner GPUs spend 49.5% of step time waiting for rollout and verification.

Learner work across consecutive updates

SyncLearner work starts after rollout finishes. Red regions mark idle GPUs.

ThunderSyncBackward passes overlap rollout, reducing idle time and fitting more updates into the same window.

Loading the utilization illustration…

Swipe across the trace to inspect it.

Scheduling at a fixed policy

A batch is needed for the optimizer step, but parts of the backward pass can start sooner. ThunderSyncRL releases GRPO work when a trajectory’s reward arrives, and OPD work when a turn’s teacher scores are ready. All of that work uses the same policy snapshot.

GRPO trajectory scheduling

Sync0 policy lag
RolloutLearnerUpdatewaiting for the batchOpt. step k
ThunderSync0 policy lag
RolloutLearnerUpdateOpt. step k

OPD turn scheduling

Sync0 policy lag
RolloutTeacherLearnerUpdatewaiting for the batchOpt. step k
ThunderSync0 policy lag
RolloutTeacherLearnerUpdateOpt. step k

GRPO at trajectory granularity

For a group G\mathcal G of m\,m trajectories, GRPO weights each trajectory’s gradient by how its reward compares with the group. The group mean μ\mu and standard deviation σ\sigma need every reward:

gG=1m∑i∈Gri−μσ+ϵ Hig_{\mathcal G} = \frac{1}{m}\sum_{i\in\mathcal G} \frac{r_i-\mu}{\sigma+\epsilon}\,H_i

HiH_i is the gradient of trajectory i\,i’s weighted action-token log probabilities, evaluated at the fixed policy θk\theta_k. It does not depend on the other rewards. Once trajectory i\,i and its reward are ready, ThunderSync runs that backward pass and adds to two buffers:

G(1)=∑i∈GriHiG(2)=∑i∈GHi\begin{aligned} G^{(1)} &= \sum_{i\in\mathcal G} r_i H_i \\ G^{(2)} &= \sum_{i\in\mathcal G} H_i \end{aligned}

When the group closes, its mean and standard deviation turn those buffers into the final group gradient:

gG=G(1)−μG(2)m(σ+ϵ)g_{\mathcal G} = \frac{G^{(1)}-\mu G^{(2)}}{m(\sigma+\epsilon)}

This is the same weighted sum, regrouped so the backward passes happen earlier. The policy stays at θk\theta_k until the batch’s single optimizer step.

OPD at turn granularity

For each sampled action token, the frozen teacher and current student score the same token in its realized context. Let ℓj,tT\,\ell^{\mathrm T}_{j,t} and ℓj,tS\,\ell^{\mathrm S}_{j,t} be their log probabilities. Their difference gives the token’s weight:

Aj,t=sg⁡ ⁣[ℓj,tT−ℓj,tS]A_{j,t} = \operatorname{sg}\!\left[ \ell^{\mathrm T}_{j,t}-\ell^{\mathrm S}_{j,t} \right]

Stop-gradient (sg⁡\operatorname{sg}) holds this weight constant during differentiation. Once the teacher scores arrive, turn jj contributes a gradient while its tool call can keep running:

gj=∑t∈MjAj,t∇θlog⁡πθ(aj,t∣hj,t)∣θ=θkg_j = \sum_{t\in\mathcal M_j} A_{j,t} \left.\nabla_\theta \log\pi_\theta(a_{j,t}\mid h_{j,t}) \right|_{\theta=\theta_k}

Mj\mathcal M_j contains the turn’s scored action tokens. ThunderSync accumulates these unnormalized contributions and completes any deferred gradients through earlier context. At batch closure, it divides once by the total scored-token count:

gk=1Nk∑jgjNk=∑j∣Mj∣\begin{aligned} g_k &= \frac{1}{N_k}\sum_j g_j \\ N_k &= \sum_j |\mathcal M_j| \end{aligned}

That normalization happens before clipping and the single optimizer step, giving the same batch-synchronous OPD update.

Results and resource costs

On SWE-bench Verified, ThunderSyncRL reaches the GRPO target of 74.01% pass@3 at 121.3 GPU-hours, versus 233.5 with Sync. At 128 GPU-hours it outperforms Async in all four benchmark–objective settings, with gains up to 2.47 percentage points. Each comparison fixes the model, workload, optimizer, and GPU allocation.

Qwen-3.8-27B. Speedup is time to the Sync target; gain is pass@3 at a fixed 128 GPU-hour budget.
BenchmarkObjectiveSpeedup vs. SyncPass@3 gain vs. Async, pp
SWE-bench VerifiedGRPO1.9×+2.47
OPD1.9×+1.27
Terminal Bench 4.0GRPO1.8×+1.52
OPD1.9×+2.02

Qwen-3.8-27B

SWE-bench Verified

SyncAsyncFully AsyncThunderSync
GRPO
Pass@1
Loading figure layers…
Pass@3
Loading figure layers…
Pass@5
Loading figure layers…
Training reward
Loading figure layers…
OPD
Pass@1
Loading figure layers…
Pass@3
Loading figure layers…
Pass@5
Loading figure layers…
Training reward
Loading figure layers…

Terminal Bench 4.0

SyncAsyncFully AsyncThunderSync
GRPO
Pass@1
Loading figure layers…
Pass@3
Loading figure layers…
Pass@5
Loading figure layers…
Training reward
Loading figure layers…
OPD
Pass@1
Loading figure layers…
Pass@3
Loading figure layers…
Pass@5
Loading figure layers…
Training reward
Loading figure layers…

GLM-4.7-Flash-31B

SWE-bench Verified

SyncAsyncFully AsyncThunderSync
GRPO
Pass@1
Loading figure layers…
Pass@5
Loading figure layers…
OPD
Pass@1
Loading figure layers…
Pass@5
Loading figure layers…

Terminal Bench 4.0

SyncAsyncFully AsyncThunderSync
GRPO
Pass@1
Loading figure layers…
Pass@5
Loading figure layers…
OPD
Pass@1
Loading figure layers…
Pass@5
Loading figure layers…

Citation

@article{kang2026thundersyncrl,  title = {ThunderSyncRL: Lossless Acceleration of Agentic Reinforcement Learning},  author = {Kang, Seil and Kang, Hangoo and Suresh, Tarun and Kim, Youngeun and Pimpalgaonkar, Shreyas and Hwang, Seong Jae and Mirhoseini, Azalia},  journal = {arXiv preprint arXiv:2610.05935},  year = {2026},  url = {https://arxiv.org/abs/2610.05935}}