Abstract
Trust Region Policy Optimization (TRPO) is a cornerstone of stable on-policy reinforcement learning. However, the standard practice of using factorized Gaussian policies often restricts the agent's ability to explore complex action spaces or learn coordinated behaviors. This paper proposes replacing these simple distributions with Normalizing Flows (NF). By utilizing invertible, non-linear transformations, NF policies can represent highly expressive, multi-modal distributions while remaining compatible with trust-region constraints. Our evaluation across high-dimensional robotics tasks demonstrates that NF policies significantly outperform Gaussian baselines, particularly in environments requiring complex coordination and multi-modal exploration.
Introduction
In Reinforcement Learning (RL), on-policy algorithms like TRPO maintain stability by enforcing a trust region constraint—typically defined by KL divergence—to prevent drastic policy updates that could lead to unrecoverable performance drops. While effective, the common reliance on factorized Gaussian policies creates a bottleneck. Such policies assume independence between action dimensions and struggle to represent multi-modal strategies or complex correlations. When combined with a strict KL constraint, the agent often becomes "trapped" near its current strategy, leading to suboptimal exploration and slow convergence in high-dimensional tasks like humanoid locomotion.
Methodology: Normalizing Flow Policies
To overcome the limitations of Gaussian distributions, we introduce the Normalizing Flows (NF) Policy.
Expressive Distributions via Flows
Instead of sampling from a fixed distribution, NF starts with simple base noise and passes it through a sequence of invertible, non-linear transformations (neural networks). This process "warps" the base distribution into a complex, high-dimensional density. To adapt this for RL, the agent’s state is embedded and injected into these transformation layers, allowing the resulting action distribution to be conditioned on the environment.
Optimization and Compatibility
Because NF distributions do not always have a closed-form entropy expression, we employ a re-parameterization trick with $N$ samples to estimate gradients for optimization. The NF policy serves as a drop-in replacement for standard policies in frameworks like TRPO and ACKTR, requiring no fundamental changes to the underlying trust-region logic.
The "KL Ball" and Enhanced Exploration
A key insight of this work is the geometric advantage of NF policies within the trust region. For a fixed budget of KL divergence (the "KL ball"), an NF policy can distribute probability mass much more flexibly than a Gaussian.
As shown in Figure 1, NF policies can represent a wider variety of actions and place significant probability mass further from the previous policy's mean without violating the KL constraint. This allows for bolder, more effective exploration that remains "safe" according to the trust region.
Experimental Results
We evaluated the NF policy across a suite of continuous control benchmarks, including OpenAI Gym MuJoCo, rllab, and Roboschool.
Performance Benchmarks
- Humanoid Locomotion: On the Humanoid (L) task, the NF policy achieved a score of ~87, significantly higher than the ~64 reached by the Gaussian baseline.
- Roboschool Dominance: In the highly complex Roboschool Humanoid environments, NF policies outperformed Gaussians almost immediately, maintaining a substantial lead throughout the training process.
- Stability vs. Expressiveness: While Gaussian Mixture Models (GMMs) offer similar expressiveness, they often proved unstable in high-dimensional spaces. NF policies provided the necessary expressiveness with superior training stability.
Robustness and Coordination
NF policies demonstrated a natural ability to learn correlated joint movements, which are essential for stable gaits in robotics. Furthermore, they were found to be less sensitive to the trust region hyperparameter ($\epsilon$), making them more robust across different tasks. In environments like Ant, NF policies successfully bypassed local optima (e.g., unstable jumping) to find more efficient, long-term walking strategies.
Conclusion and Future Work
Replacing factorized Gaussians with Normalizing Flows provides a significant boost to TRPO-style algorithms by enabling more expressive exploration within the safety of the trust region. While NF policies introduce some computational overhead due to Jacobian calculations and multiple transformation layers, the performance gains in high-dimensional tasks are substantial. Future work includes investigating the application of NF to Proximal Policy Optimization (PPO) and exploring more efficient flow architectures to mitigate computational costs.
Summary updated