Control-Oriented Model-Based Reinforcement Learning with Implicit Differentiation

Evgenii Nikishin, Romina Abachi, Rishabh Agarwal, Pierre-Luc Bacon

Abstract: The shortcomings of maximum likelihood estimation in the context of model-based reinforcement learning have been highlighted by an increasing number of papers. When the model class is misspecified or has a limited representational capacity, model parameters with high likelihood might not necessarily result in high performance of the agent on a downstream control task. To alleviate this problem, we propose an end-to-end approach for model learning which directly optimizes the expected returns using implicit differentiation. We treat a value function that satisfies the Bellman optimality operator induced by the model as an implicit function of model parameters and show how to differentiate the function. We provide theoretical and empirical evidence highlighting the benefits of our approach in the model misspecification regime compared to likelihood-based methods.

Introduction

Traditional model-based reinforcement learning (MBRL) typically follows a two-step paradigm: first, learning a transition model of the environment via Maximum Likelihood Estimation (MLE), and second, utilizing that model for planning or policy optimization. However, this approach often suffers from objective mismatch. MLE focuses on minimizing global prediction error, which may lead a model with limited capacity to waste resources on task-irrelevant details, such as background noise or complex but irrelevant dynamics. This paper introduces Optimal Model Design (OMD), a framework that treats model learning as a control-oriented task, optimizing parameters directly for the end goal of maximizing rewards.

Methodology

OMD utilizes a bi-level optimization framework to bridge the gap between model accuracy and control performance:

  1. Inner Loop: For a given set of model parameters, the agent determines an action-value function ($Q$) that satisfies the Bellman optimality equation induced by that model.
  2. Outer Loop: The agent evaluates the resulting policy's performance in the actual environment and updates the model parameters to maximize this real-world return.

To compute gradients through the inner loop's fixed-point solution, the authors employ the Implicit Function Theorem (IFT). This allows for direct differentiation of the reward with respect to model parameters without the need to unroll the entire value iteration process. For scalability, the authors introduce a practical approximation by replacing the complex inverse Jacobian term in the IFT with an identity matrix, significantly reducing computational overhead while maintaining robust performance.

Experimental Results

The efficacy of OMD was evaluated across several benchmarks, including tabular MDPs, CartPole, and MuJoCo HalfCheetah. The experiments focused on scenarios where the model is intentionally limited in capacity or the environment contains significant distractions.

Capacity Efficiency and Scalability

In high-dimensional tasks like HalfCheetah, OMD demonstrates superior performance as model capacity decreases. While MLE-based agents fail to learn effective policies when the model's hidden layer size is small, OMD successfully identifies the critical dynamics necessary for control.

Figure 6: Sum of rewards on the HalfCheetah task as a function of model hidden size. OMD significantly outperforms MLE in the low-capacity regime.

Robustness to Distractors

A key advantage of the reward-driven objective is its inherent robustness to noise. In experiments where random Gaussian noise was added to the state space (distracting states), OMD maintained stable performance by ignoring variables that do not impact the reward signal. In contrast, MLE-based methods experienced a sharp decline in performance as they attempted to model the irrelevant noise.

Figure 4: Performance comparison in CartPole with an increasing number of distracting states. OMD exhibits much higher robustness to noise than MLE.

Discussion and Key Insights

  • The "Useful Lie": OMD models often exhibit higher Mean Squared Error (MSE) than MLE models. Despite being "worse" predictors in a general sense, they provide more effective targets for the value function, leading to superior policies. This suggests that for control, a model that is "usefully wrong" is better than one that is "averagely accurate."
  • Capacity Allocation: OMD prioritizes representing transitions that are critical to the task. When capacity is a bottleneck, it effectively ignores irrelevant regions of the state space that MLE would otherwise attempt to fit.
  • Theoretical Grounding: The authors provide proofs showing that OMD yields tighter error bounds on the optimal $Q$-function approximation compared to MLE in misspecified regimes.

Conclusion

Optimal Model Design offers a principled approach to learning world models that are specifically tailored for control. By differentiating through the Bellman optimality operator, OMD overcomes the objective mismatch inherent in traditional MBRL. Future research will focus on scaling this approach to high-dimensional visual inputs and further investigating the theoretical implications of the Jacobian approximations used in the implicit differentiation step.

Summary updated

BibTeX
@inproceedings{nikishin2022control,
  author = {Evgenii Nikishin and Romina Abachi and Rishabh Agarwal and Pierre-Luc Bacon},
  title = {{Control-Oriented Model-Based Reinforcement Learning with Implicit Differentiation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=7eOlI7y0WI},
}
Figure