Policy Gradient with Kernel Quadrature

Satoshi Hayakawa, Tetsuro Morimura

Abstract

Training reinforcement learning (RL) agents often encounters significant bottlenecks when reward calculations are computationally or financially expensive—such as in high-fidelity fluid dynamics simulations or human-in-the-loop feedback systems. We introduce Policy Gradient with Kernel Quadrature (PGKQ), a method that utilizes Gaussian Processes to identify a small, representative subset of episodes from a large batch. By evaluating rewards only for these select episodes, PGKQ achieves performance levels comparable to large-batch training at a fraction of the evaluation cost.

Introduction

In standard policy gradient methods like Vanilla Policy Gradient (VPG) or Proximal Policy Optimization (PPO), agents interact with an environment to generate a batch of episodes. Updating the policy typically requires computing the reward for every action within every episode. In many real-world applications, this reward evaluation is the primary bottleneck. For instance, in aerodynamics, a single reward calculation might involve an hour-long simulation. In RL from Human Feedback (RLHF), every evaluation requires costly human intervention.

The challenge lies in leveraging a large number of "cheap" environment interactions (running the policy) to inform updates while minimizing "expensive" reward evaluations.

Methodology: Data Compression via Kernel Quadrature

PGKQ addresses this by treating RL episodes as data points in a high-dimensional space and applying "data compression" techniques.

Gaussian Process Modeling

The reward function (or discounted return) is modeled as a random variable using a Gaussian Process (GP). This allows for the definition of a positive definite kernel over the space of episodes. The authors introduce "stepwise GPs" to handle sequences of varying lengths, enabling the kernel to accumulate information across every timestep and create a robust similarity metric between episodes.

Kernel Quadrature (KQ)

Once episode similarity is established, the KQuad algorithm selects a subset of $n$ episodes from a larger batch of $N$ ($n \ll N$) and assigns them specific weights. This subset is optimized to minimize the "worst-case error" in approximating the overall policy gradient.

Algorithm 2: Vanilla PGKQ. The algorithm selects a subset of n episodes from a larger batch of N to minimize reward evaluation costs.

Modeling Variants

The framework offers two primary modeling options:

  1. Centered GP: Models discounted returns directly. While simpler, it can be less accurate as the policy evolves.
  2. Non-centered GP: Models the underlying reward function $r$. Since the reward function is a static property of the environment, this approach is more robust. It uses the GP mean as a "proxy" reward to estimate bias for unselected episodes.

Experimental Evaluation

The method was evaluated using the MuJoCo suite, the industry standard for continuous control tasks. Tests were conducted on InvertedDoublePendulum-v4, Hopper-v4, HalfCheetah-v4, and Walker2d-v4. Although MuJoCo rewards are computationally inexpensive, they provide a controlled environment to demonstrate that PGKQ can learn effectively with minimal reward samples.

Key Insights

  • Efficiency through Sparsity: Most episodes in a batch are redundant. Kernel Quadrature allows the agent to ignore "noise" and focus the reward-evaluation budget on episodes providing unique information.
  • Escaping Plateaus: Experiments indicated that PGKQ helps vanilla policy gradients escape performance plateaus where standard small-batch versions often stall.
  • Stability: Modeling the static reward function (Option 2) consistently outperformed modeling policy-dependent returns, providing a more reliable training signal.

Results

PGKQ (using $N=64$ generated episodes but only $n=8$ reward evaluations) was compared against a small-batch baseline (8 episodes) and a large-batch baseline (64 episodes). In nearly all tasks, PGKQ significantly outperformed the small-batch baseline and performed nearly as well as the large-batch version, despite using only 12.5% of the rewards.

Limitations and Future Directions

While PGKQ reduces reward evaluation costs, the Kernel Quadrature step introduces a computational overhead of approximately $O(N^2)$. If the reward function is already fast to compute, the wall-clock time might increase. Future work involves incorporating vector-valued GPs to account for the "score function" (gradient of log-probability) and extending the framework to offline RL, where identifying the most valuable data points for labeling is critical.

Summary updated

BibTeX
@article{hayakawa2024policy,
  author = {Satoshi Hayakawa and Tetsuro Morimura},
  title = {{Policy Gradient with Kernel Quadrature}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
}
Figure