GCD: Correcting Hidden-State Bias in Off-Policy Agentic RL
Abstract
Off-policy reinforcement learning (RL) for large language models (LLMs) bottlenecks at the rollout stage: every parameter update invalidates the key-value (KV) cache of in-flight agent trajectories, forcing either an expensive full recompute or staleness that destabilizes training. Recent methods such as M2PO tolerate this staleness by reweighting the policy gradient with importance ratios. However, these ratios assume that the reused forward pass computes the new policy's probability. Stale keys and values make it compute a hybrid of the old and new policies instead, leaving a hidden-state bias that skews the policy gradient. This bias, the log-probability gap between the hybrid and the new policy, evades every ratio-based diagnostic. In this work, we measure it on two backbones, Qwen3.5-9B and the pure Transformer Llama-3.1-8B. It grows with staleness and tracks a cheap estimate: how far the weights moved times how much a token attends to stale context. Building on this estimate, we introduce Gradient-Coupled KV Drift (GCD), which divides the bias out of the importance ratio and recomputes only the tokens where the estimate fails. The mechanism is architecture-independent, while our numbers are scoped to the single-node configurations we tested. On Llama-3.1-8B with MATH-500, GCD stays stable at a staleness of 512 updates, at 1.27× the throughput of full recompute but 5% below naive reuse. On Qwen3.5-9B, we demonstrate that GCD cuts the ratio error of naive reuse by 46–56% and survives staleness 512 on MATH-500, where M2PO collapses. It also raises rollout throughput 1.38× over full recompute on τ-bench retail and lifts retail pass^4 by 5.7 points over M2PO at staleness 256.