Learning to Constrain Policy Optimization with Virtual Trust Region

Hung Le, Thommen Karimpanal George, Majid Abdolshah, Dung Nguyen, Kien Do, Sunil Gupta, Svetha Venkatesh

Overview

Trust region methods in reinforcement learning (RL) typically constrain policy updates to stay close to the immediate past policy. While this prevents catastrophic forgetting, it can significantly slow down learning if that old policy is poor or stuck in a local minimum. This paper introduces Memory-Constrained Policy Optimization (MCPO), a novel method that creates a second "virtual" trust region by dynamically attending to a memory of past policies. By pulling the new policy toward the better of the two trust regions, MCPO achieves superior sample efficiency and stability across continuous control, sparse reward navigation, and Atari games.

The Problem with Single Trust Regions

Deep RL relies heavily on policy gradient methods, but these algorithms can be highly unstable. A small update in the network's parameter space can cause massive, destructive changes in the actual policy behavior.

To fix this, "trust region" methods like TRPO and PPO were developed. They regularize updates by forcing the new policy to stay close to the previous (old) policy, usually measured via Kullback–Leibler (KL) divergence. However, this assumes the old policy is a good anchor. Because of stochasticity and approximations, the old policy might actually be suboptimal. If the old policy is bad, forcing the new policy to stay close to it actively drags down the optimization process. The authors tackle this gap by asking: What if we could constrain the update using a smarter, historically-informed anchor instead of just the immediate past policy?

Memory-Constrained Policy Optimization (MCPO)

To address the limitations of a single anchor, MCPO regularizes policy updates using two trust regions.

  1. The Virtual Policy ($\psi$): Alongside the standard old policy ($\theta_{old}$), MCPO maintains a "virtual policy." This is not a single past policy, but a weighted combination of multiple past policies stored in a memory buffer.
  2. Learned Attention Network: Instead of simply averaging past policies—which fails on complex tasks—MCPO uses a neural attention network to dynamically assign weights to the policies in memory. The network looks at contextual features (e.g., policy distances, empirical returns, entropy) and learns to combine past policies in a way that maximizes expected returns.
  3. Dual Trust Region Optimization: The objective function penalizes the KL divergence between the new policy and both $\theta_{old}$ and $\psi$. A dynamic weighting coefficient shifts the constraint toward whichever policy (old vs. virtual) is currently performing better.
  4. Diversity-Promoting Writing: To prevent the memory buffer from filling up with nearly identical policies, MCPO only saves a new policy to memory if its KL divergence from the current virtual policy exceeds a certain threshold.
Attention mechanism and virtual policy performance

These mechanisms reveal a key insight: the immediate past is a flawed anchor. A dynamically weighted ensemble of historical policies provides a much safer, more robust guide for optimization, effectively smoothing out bad updates.

Key Results

The authors evaluated MCPO across a diverse set of standard RL benchmark environments, demonstrating strong improvements over baselines like PPO, TRPO, and VMPO.

  • Continuous Control (MuJoCo): MCPO significantly outperformed baselines on complex continuous control tasks. For example, on HalfCheetah, MCPO scored 6,173 compared to PPO's 4,753; on the highly complex HumanoidStandup task, it scored 195,404 compared to PPO's 155,494.
  • Classical Control: MCPO consistently achieved the best mean performance across tasks like Pendulum and LunarLander, showing remarkable robustness to hyperparameter changes (specifically the memory size), whereas baselines fluctuated wildly.
  • Sparse Rewards (MiniGrid): MCPO successfully solved the UnlockPickup task within 1M steps, while baselines failed to converge to the best solution in the same timeframe.
  • Atari: After 10 million frames, MCPO achieved a mean normalized human score of 229.99 across 9 games, nearly double that of standard PPO (131.19).
Performance comparison on MuJoCo continuous control tasks

Limitations and Future Work

While MCPO offers substantial performance gains, it introduces new hyperparameters, including memory size and constraint bounds. While default values worked well across the tested environments, applying MCPO to novel domains may require careful tuning. Additionally, maintaining a memory buffer of policy weights and continuously training an attention network to query it adds computational overhead compared to vanilla PPO. Future work could explore more efficient ways to store and query the policy memory to reduce this computational footprint.

Summary updated

BibTeX
@inproceedings{le2022learning,
  author = {Hung Le and Thommen Karimpanal George and Majid Abdolshah and Dung Nguyen and Kien Do and Sunil Gupta and Svetha Venkatesh},
  title = {{Learning to Constrain Policy Optimization with Virtual Trust Region}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=zv4jXBD8gS},
}
Figure