Abstract
Model-based reinforcement learning (RL) improves sample efficiency by using an internal world model to simulate experiences, a process known as planning. However, the effectiveness of planning depends heavily on the "search control" strategy—the selection of states used to query the model. We introduce Meta-Gradient Search Control (MGSC), an approach that dynamically learns an optimal search control distribution. By utilizing meta-gradients to minimize the discrepancy between planning-based updates and real-world transitions, MGSC enables agents to focus on informative states while ignoring regions where the model is inaccurate or the environment is non-stationary.
Introduction
In Dyna-style RL architectures, agents alternate between direct environment interaction and background planning. While planning can significantly accelerate learning, it is susceptible to model errors and non-stationarity. Traditional search control heuristics, such as uniform sampling of previously visited states, often fail to adapt when certain parts of the model become unreliable or when task goals shift. This paper addresses the search control problem by framing it as a meta-learning task: the agent learns to "dream" about states that provide the most useful updates for its current value function.
Methodology: Meta-Gradient Search Control
MGSC replaces fixed search control heuristics with a learnable distribution over states, $d(\tilde{s}|\eta)$, parameterized by $\eta$. The learning process follows a three-step meta-gradient cycle:
- Planning Update: The agent performs a value function update using states sampled from the current search control distribution.
- Real-World Comparison: Upon observing a real transition $(s_t, a_t, r_{t+1}, s_{t+1})$, the agent computes a target update representing the "ground truth."
- Meta-Update: The agent calculates the gradient of a meta-loss—defined as the distance between the planning-influenced parameters and the real-world target—with respect to the search control parameters $\eta$.
This mechanism allows the agent to retrospectively adjust its planning strategy: "Which states should I have planned with to better predict the real-world outcome I just experienced?"
Experimental Evaluation
The performance of MGSC was evaluated in two stochastic, non-stationary gridworld environments:
- TMaze: A task where the goal location swaps periodically, testing adaptation to non-stationary rewards.
- TwoRooms: A larger navigation task with moving goals, testing scalability and the ability to focus on relevant state subspaces.
A key challenge in these environments was the presence of "broken" model components—specifically, terminal states where the model provided inaccurate data.
Results and Discussion
Experimental results demonstrate that MGSC effectively learns to navigate the trade-offs of model-based planning.
Robustness to Model Inaccuracy
A significant advantage of MGSC is its ability to avoid "hallucinations" caused by imperfect models. In the TMaze environment with a learned model, MGSC outperformed all baselines, including the "Avoid Terminal" heuristic which was manually programmed to ignore unreliable states.
Adaptation to Non-Stationarity
In tasks with shifting goals, MGSC automatically re-tunes its search control distribution. It prioritizes states where values are changing (e.g., central hallways) and ignores stable or irrelevant regions. Unlike uniform sampling, which can degrade performance if planning steps are increased in the presence of a flawed model, MGSC remains robust, effectively filtering out noise and focusing on high-utility updates.
Conclusion
Meta-Gradient Search Control provides a principled way to automate search control in model-based RL. By learning what to "dream" about, agents can maintain high sample efficiency even in complex, changing environments with imperfect models. Future work will focus on scaling MGSC to high-dimensional state spaces using function approximation for the search control distribution and exploring the simultaneous learning of planning policies.
Summary updated