Approximate Inference and Stochastic Optimal Control

Konrad Rawlik, Marc Toussaint, Sethu VijayakumararXiv 2010

Abstract

This work explores the deep mathematical connection between Stochastic Optimal Control (SOC) and probabilistic inference. By reformulating the control problem as a task of maximizing the likelihood of a "success" variable in a Bayesian network, we derive a novel class of reinforcement learning algorithms: $\Psi$-learning and its continuous-space extension, Least-Squares $\Psi$ (LS$\Psi$). These algorithms utilize a soft-max approach to value iteration, providing a more robust and sample-efficient alternative to traditional Q-learning. Experimental results on discrete grid worlds and continuous cart-pole systems demonstrate the practical advantages of this inference-based perspective.

Introduction

Stochastic Optimal Control (SOC) is fundamental to robotics and automated systems, where the goal is to minimize expected costs in the presence of environmental uncertainty. Traditionally, SOC problems are tackled using the Bellman optimality equations. However, solving these equations becomes computationally prohibitive for high-dimensional or non-linear systems.

While the "control as inference" paradigm has been explored previously, many existing frameworks rely on restrictive assumptions about system dynamics. This paper presents a general, exact reformulation of SOC as an inference problem. By viewing control through the lens of Bayesian inference, we can leverage established approximate inference techniques to develop more efficient and stable reinforcement learning algorithms.

Bayesian Reformulation and Methods

The core innovation lies in mapping the SOC problem onto a probabilistic graphical model. We define an auxiliary binary "task variable" $r_t$ at each time step $t$. The probability of "success" ($r_t=1$) is defined in terms of the immediate cost: $P(r_t=1 | x_t, u_t) = \exp(-Cost(x_t, u_t))$. Under this formulation, minimizing the total expected cost is equivalent to maximizing the likelihood of task success across a trajectory.

Graphical model representation of the stochastic optimal control problem as an inference task.

As shown in the graphical model above, the state $x_t$ and action $u_t$ influence both the subsequent state $x_{t+1}$ and the success variable $r_t$. Solving the SOC problem is shown to be equivalent to minimizing the Kullback-Leibler (KL) divergence between the trajectory distribution of the controlled process and a "prior" uncontrolled process.

$\Psi$-learning and LS$\Psi$

From this KL divergence framework, we derive $\Psi$-learning, a model-free, off-policy algorithm. Unlike standard Q-learning, which employs a "hard" maximum over future actions, $\Psi$-learning uses a "soft" log-sum-exp operator (the partition function). This approach averages over future possibilities, leading to greater robustness in stochastic environments.

To extend this to continuous state and action spaces, we introduce Least-Squares $\Psi$ (LS$\Psi$). This method uses linear basis functions and a least-squares projection, analogous to Least-Squares Temporal Difference (LSTD) methods, to approximate the value function (or "free energy") in high-dimensional settings.

Experimental Evaluation

The proposed algorithms were evaluated on two benchmark tasks:

  1. Grid World: In a discrete $N \times N$ environment with obstacles, tabular $\Psi$-learning was compared against standard Q-learning. $\Psi$-learning demonstrated significantly higher sample efficiency, reaching convergence with fewer environment interactions.
  2. Cart-Pole (Inverted Pendulum): LS$\Psi$ was applied to this continuous control task. Despite an unstable initial policy, the algorithm successfully learned to stabilize the pole within 600–700 episodes. The use of Gaussian basis functions allowed for analytical solutions to the required integrals, avoiding expensive Monte Carlo sampling.

Discussion and Key Insights

The duality between SOC and inference is not merely an approximation but an exact mathematical equivalence. This perspective reveals that the value function in control is analogous to "free energy" in statistical physics and inference.

Key advantages of the $\Psi$-learning framework include:

  • Off-Policy Learning: The method naturally supports learning from data collected by any policy, which is essential for safe exploration in real-world robotics.
  • Robustness: The soft-max update mechanism provides more stable convergence in the face of noise compared to hard-max updates.

Future work will focus on providing rigorous convergence proofs for the infinite-horizon case and exploring more sophisticated non-linear basis functions for complex robotic systems.

Summary updated

Abstract

We propose a novel reformulation of the stochastic optimal control problem as an approximate inference problem, demonstrating, that such a interpretation leads to new practical methods for the original problem. In particular we characterise a novel class of iterative solutions to the stochastic optimal control problem based on a natural relaxation of the exact dual formulation. These theoretical insights are applied to the Reinforcement Learning problem where they lead to new model free, off policy methods for discrete and continuous problems.
BibTeX
@misc{rawlik2010approximate,
  author = {Konrad Rawlik and Marc Toussaint and Sethu Vijayakumar},
  title = {{Approximate Inference and Stochastic Optimal Control}},
  year = {2010},
  eprint = {1009.3958},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1009.3958},
}
Figure