Stochastic Optimal Control Matching

Carles Domingo-Enrich, Jiequn Han, Brandon Amos, Joan Bruna, Ricky T. Q. Chen

TL;DR

This paper introduces Stochastic Optimal Control Matching (SOCM), a novel algorithm for solving high-dimensional stochastic control problems inspired by the training dynamics of diffusion models. By framing the control problem as a least-squares matching task and introducing a novel "path-wise reparameterization trick" to reduce gradient variance, SOCM achieves up to 10x lower error and significantly more stable training than existing state-of-the-art methods.

Introduction: The Curse of Dimensionality in Optimal Control

Stochastic optimal control provides a mathematical framework for steering noisy systems to minimize a specific cost over time. It is a foundational concept with massive applications across robotics, finance, molecular dynamics, and power systems.

For simple, low-dimensional problems, optimal control can be found by solving the Hamilton-Jacobi-Bellman (HJB) partial differential equation. However, this classical approach suffers from the "curse of dimensionality," rendering it intractable in high-dimensional spaces. To bypass this limitation, modern approaches parameterize the control using neural networks and train them using Iterative Diffusion Optimization (IDO) techniques.

The primary challenge with existing IDO loss functions—such as the relative entropy loss solved via the adjoint method—is their highly non-convex functional landscapes. This non-convexity leads to unstable training, massive gradient variance, and ultimately suboptimal solutions. The authors of this paper sought to overcome these hurdles by adapting the stable, convex, least-squares training dynamics of modern diffusion models (like score matching) to the realm of stochastic optimal control.

Methods: Stochastic Optimal Control Matching (SOCM)

The authors propose Stochastic Optimal Control Matching (SOCM). Instead of directly optimizing the highly non-convex expected cost, SOCM learns the control by solving a least-squares regression problem, effectively trying to fit a "matching vector field."

To make this mathematically tractable, the authors introduce two major innovations:

  1. The Path-wise Reparameterization Trick: A novel mathematical technique to estimate the gradient of an expectation of a random process with respect to its initial value. This allows the dependency on the initial value to be shifted into the stochastic process itself.
  2. Reparameterization Matrices ($M_t$): The path-wise reparameterization trick introduces a family of arbitrary matrix-valued functions. Rather than fixing them, the authors co-optimize these matrices alongside the neural network control function.

By mathematically decomposing the SOCM loss, the authors prove that it consists of a bias term (which dictates the actual control objective) and a variance term. Optimizing the $M_t$ matrices strictly minimizes the variance of the matching vector field without altering the true optimum. This acts as a powerful, built-in variance reduction mechanism.

Experimental Setup

Because the goal is to measure the exact error of the learned control, the authors evaluate SOCM on simulated mathematical environments where the ground-truth optimal control is analytically known. They utilize four primary settings:

  1. Quadratic Ornstein-Uhlenbeck (Easy)
  2. Quadratic Ornstein-Uhlenbeck (Hard)
  3. Linear Ornstein-Uhlenbeck
  4. Double Well: A highly challenging, multimodal problem where the terminal cost function has 1024 distinct modes.

Additionally, they tested the method on a high-dimensional Gaussian mixture sampling task using a Path Integral Sampler.

Key Insights

  • Borrowing from Generative AI: The authors draw a brilliant analogy between continuous normalizing flows (CNFs) and stochastic optimal control. Early CNFs struggled with unstable maximum-likelihood training but were superseded by diffusion models and flow matching, which use stable, convex least-squares objectives. SOCM successfully ports this "matching" philosophy to optimal control.
  • Bias-Variance Separation: The fact that the SOCM loss elegantly splits into a bias term (equivalent to the landscape of the standard cross-entropy loss) and a variance term is a massive theoretical win. It proves SOCM is essentially a super-charged, variance-reduced version of cross-entropy.
  • A New Mathematical Tool: The "path-wise reparameterization trick" is a fundamental contribution. It serves as a general technique for handling gradients of conditional expectations in stochastic differential equations (SDEs) and could be highly useful outside of this specific application.

Key Results

  • Superior Accuracy: SOCM achieved the lowest $L^2$ error against the ground-truth control in 3 out of the 4 simulated environments.
  • Order of Magnitude Improvement: In the Quadratic OU and Linear OU settings, SOCM's error was roughly 10x lower than competing methods, including the Adjoint method, Cross-Entropy, and Variance losses.
  • Training Stability: Baselines like the Adjoint method showed severe gradient spikes and instability throughout training. In contrast, SOCM's co-optimization of the $M_t$ matrices kept gradients smooth and signal-to-noise ratios high.

Limitations and Future Work

Limitations: The SOCM objective relies on an "importance weight" factor ($\alpha$). If the problem is too complex—specifically, if the state/terminal costs are very large or the dimensionality is extremely high—the variance of this weight can explode. This occurs because the initial, untrained neural network control is too far from the optimal control, causing the method to struggle to learn effectively.

Future Work: The authors suggest that their core mathematical innovation—the path-wise reparameterization trick—could be applied back to generative AI. Specifically, it could be used to decrease the variance of matching vector fields in standard diffusion models, potentially leading to faster and more stable training for image and audio generation.

Summary updated

BibTeX
@inproceedings{domingoenrich2024stochastic,
  author = {Carles Domingo-Enrich and Jiequn Han and Brandon Amos and Joan Bruna and Ricky T. Q. Chen},
  title = {{Stochastic Optimal Control Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=wfU2CdgmWt},
}
Figure