Maximum Entropy Reinforcement Learning via Energy-Based Normalizing Flow

Chen-Hao Chao, Chien Feng, Wei-Fang Sun, Cheng-Kuang Lee, Simon See, Chun-Yi Lee

This article explores MEow (Maximum Entropy Reinforcement Learning via Energy-Based Normalizing Flow), a novel framework that simplifies the complex "dance" between actors and critics in reinforcement learning. By leveraging a specific type of generative model, the authors unify policy evaluation and improvement into a single, more stable objective.

The Actor-Critic Discrepancy in MaxEnt RL

In Maximum Entropy (MaxEnt) Reinforcement Learning, agents do not just try to maximize rewards; they also try to keep their actions as unpredictable (high entropy) as possible. This encourages exploration and robustness. Popular algorithms like Soft Actor-Critic (SAC) typically use an actor-critic framework:

  1. The Critic estimates the "Soft Q-function" (how good an action is).
  2. The Actor updates the policy to follow the critic’s advice.

This separation creates two major headaches. First, the two networks must be updated in alternating steps, which can lead to optimization errors and "lag" between what the critic knows and what the actor does. Second, calculating the "soft value function" (needed to update the critic) requires integrating over all possible actions. Because this integral is usually impossible to solve exactly, researchers rely on Monte Carlo (MC) sampling, which introduces significant noise and estimation variance into the training process.

Unifying the Framework with MEow

The authors bridge this gap using Energy-Based Normalizing Flows (EBFlow). Normalizing flows are powerful generative models that transform a simple distribution (like a Gaussian) into a complex one through a series of invertible mappings.

  • Unified Representation: MEow uses the EBFlow to represent the policy and the Q-function simultaneously. In this setup, the "energy" of the flow corresponds to the Q-function, and the normalizing constant corresponds to the value function.
  • Exact Value Calculation: Because of the mathematical properties of EBFlows, the soft value function can be expressed in a closed form. This means MEow doesn't need Monte Carlo sampling to estimate its targets; it calculates them exactly.
  • Single Objective: Instead of alternating between actor and critic updates, MEow optimizes a single Bellman error loss.
  • Stability Tricks: To make this work in practice, the authors introduced Learnable Reward Shifting (LRS). Normalizing flows can produce extremely large or small numbers that crash standard 32-bit floating-point math. LRS automatically learns an offset to keep these values within a numerically stable range.
Effect of Learnable Reward Shifting on numerical stability
  • SCDQ: They also adapted "Clipped Double Q-learning" into a shifting-based version (SCDQ) to prevent the agent from becoming overconfident in its reward estimates.

Key Insights and Expressiveness

By using a flow-based model, the policy and the value function become two sides of the same coin. This eliminates the discrepancy often found in traditional actor-critic methods where the actor fails to perfectly "capture" the critic's landscape.

Furthermore, most RL agents assume actions follow a simple "Bell Curve" (Gaussian). MEow can represent multi-modal distributions—meaning the agent can learn that there are two or three equally good, distinct ways to solve a problem, rather than just averaging them into one mediocre path. The ablation studies also highlight that "Vanilla" MEow (without LRS) fails completely on most tasks, proving that numerical stability is the secret sauce for flow-based RL.

Experimental Results

The authors evaluated MEow on several platforms, including standard MuJoCo continuous control tasks (like Hopper, Ant, and Humanoid), high-dimensional Omniverse Isaac Gym robotic simulations, and a 2D Multi-Goal environment.

  • Superior Performance: MEow consistently outperformed or matched SAC and other baselines across all MuJoCo environments.
Performance of MEow compared to baselines on MuJoCo continuous control tasks
  • Scaling to High Dimensions: In the Isaac Gym environments, which feature much higher state and action dimensionalities, MEow showed a clear advantage over SAC, demonstrating better stability and higher final returns.
  • Efficiency: By avoiding MCMC sampling (often required for energy-based models), MEow maintains the sampling efficiency of standard flows while gaining the theoretical benefits of energy-based modeling.

Limitations and Future Work

While MEow offers significant theoretical and performance advantages, it comes with a few trade-offs:

  • Computational Overhead: MEow is roughly 2.3x slower to train than SAC. This is because calculating Jacobians for normalizing flows is more computationally expensive than simple Gaussian math.
  • Hyperparameter Sensitivity: The model is quite sensitive to the target smoothing factor ($\tau$), requiring different settings for different environments to reach peak performance.
  • Architectural Constraints: The "Deterministic Policy" mode relies on specific Jacobian properties that might limit which types of flow architectures can be used in the future.

Future work will likely focus on improving the inference speed of these flow-based models to make them more competitive with simpler, faster baselines.

Summary updated

BibTeX
@inproceedings{chao2024maximum,
  author = {Chen-Hao Chao and Chien Feng and Wei-Fang Sun and Cheng-Kuang Lee and Simon See and Chun-Yi Lee},
  title = {{Maximum Entropy Reinforcement Learning via Energy-Based Normalizing Flow}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=lhlIUxD5eE},
}
Figure