An Efficient On-Policy Deep Learning Framework for Stochastic Optimal Control

Mengjian Hua, Mathieu Lauriere, Eric Vanden-Eijnden

TL;DR

This paper introduces a novel, efficient on-policy deep learning framework for solving complex stochastic optimal control (SOC) problems. By cleverly leveraging the Girsanov theorem, their method avoids computationally expensive backpropagation through stochastic differential equations, leading to significant speedups and improved scalability for high-dimensional problems and long time horizons.

What Problem Does This Paper Address?

Stochastic Optimal Control (SOC) problems are fundamental in many fields, from finance and robotics to the cutting edge of AI for sampling complex data distributions and fine-tuning generative models. The core challenge is to find an optimal control strategy (often represented by a neural network) that minimizes a cost function while navigating a system influenced by randomness. Traditional methods struggle with high-dimensional state spaces and long time horizons. Existing deep learning approaches, like Neural SDEs, often require differentiating through the entire trajectory of the stochastic process, which is computationally prohibitive. While some methods use the Girsanov theorem to reformulate the problem, they can suffer from high variance in their gradient estimates. This paper aims to bridge this gap by providing a computationally efficient and scalable on-policy method for solving these challenging SOC problems.

Methods

The authors propose an "on-policy" approach, meaning they learn by simulating trajectories using the control policy they are currently optimizing. The key innovation lies in how they compute the gradient of the objective function. Instead of backpropagating through the entire simulated trajectory of the stochastic differential equation (SDE), they use a reformulation based on the Girsanov theorem. This allows them to express the gradient as an expectation over the controlled process itself, but crucially, they detach the control parameters from the computational graph when calculating this expectation. This "simulation-free" gradient computation avoids the costly differentiation through SDE solutions.

Specifically, they build upon a gradient formula derived by Yang & Kushner (1991). Their implementation uses automatic differentiation but strategically detaches parts of the computation graph to achieve the desired efficiency. This approach is then applied to several challenging tasks:

  • Sampling from unnormalized distributions: They show how to construct Föllmer processes to sample from target distributions, which is a key step in tasks like estimating normalization constants.
  • Fine-tuning diffusion models: They formulate the problem of adapting a diffusion model to sample a "tilted" distribution (weighted by a reward function) as an SOC problem, which their method can efficiently solve.

Datasets

The paper does not introduce new datasets. Instead, it evaluates its method on:

  • Classical SOC benchmarks: Specifically, linear Ornstein-Uhlenbeck (OU) processes with linear and quadratic costs. These are used for benchmarking as they often have analytical solutions.
  • Neal's funnel distribution: A challenging, high-dimensional distribution used for testing sampling capabilities.
  • The $\phi^4$ model: A statistical lattice field theory model used to test fine-tuning of generative models.

Key Insights and Ideas

  • On-policy gradients without backprop through SDEs: This is the central breakthrough. By reformulating the gradient calculation using the Girsanov theorem and strategic detachment in the computational graph, they bypass the most computationally expensive part of traditional Neural SDE approaches.
  • Scalability to high dimensions and long horizons: The efficiency gains directly translate to the ability to tackle problems that were previously intractable due to computational constraints.
  • Unified framework for diverse applications: The method proves effective not only for traditional SOC problems but also for modern AI tasks like sampling and generative model fine-tuning, demonstrating its broad applicability.
  • Memory efficiency: The detachment of the computational graph also leads to significant reductions in memory usage, allowing for larger models and more complex problems to be handled.

Key Results

  • Significant speedup: The proposed method demonstrates substantial reductions in computational time compared to existing approaches that require SDE differentiation. For example, in the quadratic OU example, their method converges in under 3 hours, while the vanilla approach takes over 14 hours for a significantly higher dimensional problem.
  • Improved accuracy: In benchmarks like the linear OU example, their method achieves comparable or better accuracy than vanilla methods, often at a faster rate.
  • Reduced memory usage: Table 2 and 3 show that their method uses significantly less GPU memory (e.g., ~0.96 GB vs. ~2.59 GB for linear OU) and has much faster backpropagation runtimes.
  • Effective sampling: For the funnel distribution, their method achieves a Maximum Mean Discrepancy (MMD) comparable to state-of-the-art methods, outperforming some baselines.
  • Successful fine-tuning: They successfully fine-tune a Gaussian distribution to match the complex $\phi^4$ model, outperforming a vanilla approach that struggles with the model's complexity.

Limitations and Future Work

  • Invertible volatility: The current formulation relies on an invertible, control-independent volatility matrix. While they mention extensions using Malliavin calculus for control-dependent volatilities, this is a current limitation.
  • Base distribution: The fine-tuning application (Section 2.6) currently requires the reference SDE to start from a Dirac delta distribution. The authors note that if the base distribution is not atomic, the statement of Proposition 5 does not hold.
  • Future work: The paper implicitly suggests future work by highlighting these limitations and by demonstrating the method's effectiveness on challenging problems, opening doors for its application to even more complex SOC tasks and generative modeling scenarios. The improved scalability and efficiency naturally pave the way for tackling larger and more intricate real-world problems.

Summary updated

BibTeX
@inproceedings{hua2025efficient,
  author = {Mengjian Hua and Mathieu Lauriere and Eric Vanden-Eijnden},
  title = {{An Efficient On-Policy Deep Learning Framework for Stochastic Optimal Control}},
  booktitle = {FPI @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=sv5PiLZbUr},
}
Figure