Residual Policy Gradient: A Reward View of KL-regularized Objective

Pengcheng Wang, Xinghao Zhu, Yuxin Chen, Chenfeng Xu, Masayoshi Tomizuka, Chenran Li

TL;DR

Residual Policy Gradient (RPG) brings policy customization—adapting pre-trained agents to new tasks without retraining from scratch—into the realm of policy gradients. By viewing policy customization through an augmented reward lens, the authors show that standard KL-regularization secretly performs reward-level multi-task balancing, and that decoupling the KL penalty into separate prior-retention and entropy parameters significantly improves fine-tuning performance.

What Problem Does This Paper Address?

Deploying pre-trained reinforcement learning (RL) policies into real-world environments often introduces new constraints or objectives that were not part of the original training—such as avoiding a damaged actuator or prioritizing secondary goals. Retraining from scratch is sample-inefficient, while naively fine-tuning solely on the new reward can trigger catastrophic forgetting.

While Residual Q-Learning (RQL) previously offered a principled way to adapt policies by optimizing an implicit combined reward, it was restricted to value-based RL. Value-based methods scale poorly to continuous control and massive parallel simulation where policy gradient methods (like PPO) dominate. Furthermore, while the RL community widely relies on KL-divergence penalties to constrain fine-tuning (notably in RLHF), the theoretical justification for why and how KL regularization balances base capabilities against new specifications has remained murky.

Methods

  1. Soft Policy Gradient (SPG) & Soft PPO: The authors resolve subtle mathematical inconsistencies found in existing maximum-entropy policy gradient literature (e.g., double-counting or truncation of the entropy term) to derive a clean policy gradient objective over the reformulated reward: $$r^{\text{SPG}}(s_t, a_t) = r(s_t, a_t) - \alpha \log \pi_\theta(a_t|s_t)$$ They embed this advantage directly into clipped PPO (Soft PPO).

  2. Residual Policy Gradient (RPG) & Residual PPO: RPG extends RQL to policy gradients. Instead of requiring access to the original reward function, RPG formulates an augmented MDP where the reward combines the add-on reward $r_R$, an implicit base reward proxy from the prior policy ($\log \pi$), and an entropy bonus: $$r^{\text{RPG}}(s_t, a_t) = r_R(s_t, a_t) + \omega' \log \pi(a_t|s_t) - \hat{\alpha} \log \pi_\theta(a_t|s_t)$$ This is implemented practically as Residual PPO.

  3. Decoupled KL-Regularization: In standard KL-regularized RL objectives (used in RLHF and conservative fine-tuning), the reward bonus is $\beta \log \pi(a|s) - \beta \log \pi_\theta(a|s)$. RPG demonstrates that this is merely a special, constrained case of RPG where $\omega' = \hat{\alpha} = \beta$. RPG decouples these parameters:

  4. $\omega'$: controls how strongly the agent preserves the prior task’s implicit reward.
  5. $\hat{\alpha}$: controls the exploration/entropy of the adapted policy.

Datasets

The authors evaluate their methods on standard continuous control locomotion benchmarks in MuJoCo (via gym[mujoco]-v3 and the rsl-rl library) modified with custom add-on deployment specifications:

  • HalfCheetah: Basic forward running, with an add-on penalty on hind leg joint angle ($r_R = -|\theta_{\text{hind leg}}|$) simulating a damaged motor.
  • Hopper: Basic hopping forward, with an add-on reward for jumping higher ($r_R = z$).
  • Ant: Basic 4-legged forward locomotion, with an add-on velocity reward along the perpendicular axis ($r_R = \Delta y / \Delta t$).

Key Insights and Ideas

  • KL-Regularization is Implicit Multi-Task Learning: If the prior policy models a Boltzmann distribution under the original task, adding a KL constraint to an add-on reward $r_R$ mathematically corresponds to finding a maximum-entropy policy on the joint task $M = (\mathcal{X}, \mathcal{U}, r + r_R, p)$. It is not merely a heuristic "tether" to prevent drift; it operates directly at the reward level.
  • Coupling Prior Retention and Entropy is Restrictive: Standard KL penalties force the weight on the prior policy's likelihood ($\log \pi$) and the current policy's entropy ($-\log \pi_\theta$) to be identical. Decoupling them allows practitioners to adjust task trade-offs independently of the policy's exploration noise.
  • Implications for RLHF and DPO: The paper shows that Direct Preference Optimization (DPO) implicitly models $\beta \log \pi_\theta$ as the total reward. By relaxing DPO's rigid KL assumptions into decoupled weights ($\hat{\alpha}$ and $\omega'$), one can mitigate over-optimization and fine-tuning collapse in language models.

Key Results

1. Maximum-Entropy Exploration (Soft PPO)

In baseline MuJoCo tasks without add-on rewards, Soft PPO matched or substantially exceeded other entropy formulations. In HalfCheetah, Soft PPO achieved an average return of $4993.7 \pm 1262.3$, whereas Repeat-Entropy PPO collapsed to $-114.9 \pm 73.2$, and No-Entropy PPO reached $2254.9 \pm 1188.7$.

2. Policy Customization (Residual PPO)

Residual PPO effectively balanced preserving the base skill while maximizing the new objective:

  • HalfCheetah: Residual PPO achieved a total reward of $5488.3 \pm 75.6$ (preserving base reward at $5845.1$ while minimizing the damaged leg's joint angle), closely matching the upper-bound Full Policy trained from scratch ($5556.2$). In contrast, Greedy PPO collapsed entirely ($-1314.0$).
  • Ant: Residual PPO achieved $5568.3 \pm 852.4$ total reward, clearly beating standard KL PPO ($4019.4 \pm 1103.4$) and Greedy PPO ($4340.6 \pm 1464.5$).
  • Hopper: Residual PPO attained $4401.4 \pm 505.3$, outperforming KL PPO ($3864.4 \pm 50.1$) and Greedy PPO ($3714.5 \pm 7.1$).

Limitations and Future Work

  • Sensitivity to Prior Violations: The theoretical optimality guarantees assume the prior policy forms an optimal Boltzmann distribution. When this assumption is strongly violated, tuning the decoupled weights $\omega'$ and $\hat{\alpha}$ can occasionally lead to suboptimal equilibria (observed in Hopper relative to scratch-trained upper bounds).
  • Empirical Scope in LLMs: While the paper maps out formal theoretical connections and proposes a decoupled loss for RLHF/DPO, empirical evaluations are focused primarily on continuous control robotics rather than large language models.
  • Expressive Policy Modeling: The authors noted that modeling complex multi-modal prior distributions is crucial for more adaptable foundation policies, pointing toward expressive distribution modeling as an important direction for future work.

Summary updated

BibTeX
@inproceedings{wang2025residual,
  author = {Pengcheng Wang and Xinghao Zhu and Yuxin Chen and Chenfeng Xu and Masayoshi Tomizuka and Chenran Li},
  title = {{Residual Policy Gradient: A Reward View of KL-regularized Objective}},
  booktitle = {Safe-VLM @ ICRA},
  year = {2025},
  url = {https://openreview.net/forum?id=QMUfXKSGih},
}
Figure