Frequency-based Search-control in Dyna

Yangchen Pan, Jincheng Mei, Amir-massoud Farahmand

Overview

This paper introduces a novel search-control strategy for the Dyna reinforcement learning architecture by prioritizing "high-frequency" regions of the value function. By using gradient and Hessian norms to identify where the value function changes most sharply, the agent queries its internal model for simulated experiences in areas that are hardest to approximate. This approach significantly improves sample efficiency and robustness.

The Challenge of Search-Control in MBRL

In Model-Based Reinforcement Learning (MBRL), an agent learns a model of the environment to "plan" by generating simulated experiences. The Dyna architecture is a classic example of this, but it faces a major hurdle: search-control.

Search-control is the process of deciding which states to query the model with. Sampling previously visited states (like standard Experience Replay) yields little new information, while random sampling wastes time on irrelevant parts of the state space. Previous work suggested hill-climbing toward high-value regions, but the authors argue that the magnitude of the value function isn't the only important factor. Agents must also focus on regions where the value function is difficult to learn.

Methods: The Frequency Analogy

The authors draw a clever analogy from signal processing: the Shannon Sampling Theorem. In signal processing, a high-frequency signal requires more samples to reconstruct accurately. They hypothesize that the same applies to value functions in RL: regions with "high frequency" (sharp changes or complex oscillations) are harder for a neural network to approximate and thus need more training data.

Illustration of sampling a varying-frequency signal.

The "Local Frequency" Measure

Since "frequency" is traditionally a global property (via Fourier Transform), the authors develop a way to measure local frequency using two metrics:

  1. Gradient Norms ($\left\|\nabla V\right\|^2$): Captures how fast the value function is changing.
  2. Hessian Norms ($\left\|H_V\right\|_F^2$): Captures the curvature or "spikiness" of the function.

They provide a theoretical proof showing that the sum of these squared norms is proportional to the local frequency distribution of the function.

Performance comparison of Gradient Norm and Hessian Norm biases against an unbiased baseline.

The Dyna-Frequency Algorithm

The proposed algorithm, Dyna-Frequency, populates a search-control queue by performing hill-climbing on this frequency measure. To ensure the agent doesn't just get stuck in high-frequency but low-value "garbage" regions, they use a hybrid approach:

  • With probability $p$, hill-climb on the frequency measure $g(s)$ to find "hard-to-learn" states.
  • With probability $1-p$, hill-climb on the value function $V(s)$ to find "important" states.

Experiments and Key Insights

The authors evaluated their approach on several benchmarks, including MountainCar, a custom continuous MazeGridWorld, and MuJoCo continuous control tasks (Hopper-v2 and Walker2d-v2).

  • Difficulty $\neq$ Magnitude: A high-value state is not necessarily hard to learn. Conversely, a low-value state might be the "key" to a transition (like a narrow doorway) where the value function changes abruptly.
  • The Bottleneck Discovery: In the MazeGridWorld experiment, Dyna-Frequency automatically clustered its simulated samples around the "holes" in the walls. These are high-frequency regions because the value function drops to zero at the wall but stays high at the opening. Standard value-based search-control missed these bottlenecks, focusing only on the final goal.
  • Robustness to Noise: High-frequency search-control is remarkably robust to reward noise. While noise might shift the absolute value of a state, the "spikiness" (frequency) of the underlying function remains a reliable signal for where the model needs more work.
  • Superior Sample Efficiency: In MountainCar, Dyna-Frequency outperformed standard Experience Replay, Prioritized Experience Replay, and the previous state-of-the-art (Dyna-Value). It also successfully scaled to improve the performance of the Normalized Advantage Function (NAF) algorithm on MuJoCo tasks.

Limitations and Future Work

  • Computational Overhead: Calculating Hessians (second-order derivatives) can be computationally expensive for very large neural networks. While the authors used squared norms for stability, scaling this to massive architectures remains a challenge.
  • Heuristic Combinations: Simply adding the value and frequency measures together ($V + g$) proved ineffective due to unpredictable gradient behavior. The authors settled on a probabilistic switching mechanism, but more sophisticated ways to combine these "importance" signals likely exist.
  • Active Learning Integration: The frequency-based approach functions as a form of active learning. Future work could more formally integrate it with established active learning frameworks to further optimize sample efficiency.

Summary updated

BibTeX
@inproceedings{pan2020frequency,
  author = {Yangchen Pan and Jincheng Mei and Amir-massoud Farahmand},
  title = {{Frequency-based Search-control in Dyna}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure