State Constrained Stochastic Optimal Control Using LSTMs

Bolun Dai, Prashanth Krishnamurthy, Andrew Papanicolaou, Farshad Khorrami

Introduction

Stochastic Optimal Control (SOC) is fundamental to robotics and autonomous systems, where agents must determine optimal trajectories while navigating random disturbances. Traditionally, SOC problems are addressed by solving the Hamilton-Jacobi-Bellman (HJB) equation. However, the HJB equation suffers from the "curse of dimensionality," becoming computationally intractable as the system's state space grows. Furthermore, real-world applications often impose strict state constraints—such as physical boundaries or velocity limits—which are notoriously difficult to enforce in neural network-based solvers due to numerical instabilities like exploding gradients.

This paper introduces a novel deep learning framework that combines Long Short-Term Memory (LSTM) networks with Forward-Backward Stochastic Differential Equations (FBSDE) and an adaptive penalty scheme to solve high-dimensional, state-constrained SOC problems.

Methodology: LSTM-based FBSDE Solver

The proposed approach reformulates the SOC problem into a system of FBSDEs. Instead of solving the HJB partial differential equation directly, the framework simulates trajectories forward in time and propagates the "cost-to-go" (the value function) backward.

The neural network architecture integrates LSTMs to approximate the gradient of the value function across time steps within the FBSDE framework.

LSTM Architecture

Unlike standard feedforward networks, LSTMs are employed to estimate the gradient of the value function at each time step. LSTMs are particularly suited for this task because they share weights across time, reducing the total number of parameters and effectively capturing long-term temporal dependencies inherent in control trajectories.

Adaptive Penalty Function

To enforce state constraints without causing training failure, the authors utilize a "U-shaped" penalty function. A key innovation is the adaptive update scheme. Training begins with a "soft" boundary (low penalty stiffness $k$) to allow the network to learn the primary control task. As the model converges, the boundary is gradually "hardened" by increasing $k$. This curriculum learning approach prevents the massive gradients that typically occur when a controller first encounters a hard constraint boundary.

Experimental Results

The framework was evaluated on a simulated cart-pole swing-up task, a classic benchmark involving nonlinear dynamics and random noise.

Comparison of the constrained LSTM controller versus an unconstrained version. The constrained model successfully respects boundaries for cart position and velocity while achieving the swing-up goal.

Task I: Kinematic Constraints

In this scenario, the cart-pole was required to swing up while maintaining the cart position within $\pm 1.5m$ and velocity within $\pm 2.5m/s$. As shown in the results, the constrained controller successfully kept the system within these bounds, whereas the unconstrained version frequently violated them.

Task II: Energy Constraints

The system was also tested with a constraint on total energy (potential plus kinetic), limited to $5J$. The proposed controller effectively mitigated energy spikes during the high-velocity swing-up phase, demonstrating the versatility of the penalty-based approach for various types of state constraints.

Conclusion

By leveraging the temporal modeling capabilities of LSTMs and a stabilized adaptive penalty scheme, this research provides a scalable solution for state-constrained SOC. The method effectively bypasses the curse of dimensionality and offers a robust way to integrate hard physical constraints into deep learning-based control. Future work will focus on extending this framework to systems with partial observability and enhancing robustness against extreme environmental uncertainties.

Summary updated

Abstract

In this paper, we propose a new methodology for state constrained stochastic optimal control (SOC) problems. The solution is based on past work in solving SOC problems using forward-backward stochastic differential equations (FB-SDE). Our approach in solving the FBSDE utilizes a deep neural network (DNN), specifically Long Short-Term Memory (LSTM) networks. LSTMs are chosen to solve the FBSDE to address the curse of dimensionality, non-linearities, and long time horizons. In addition, the state constraints are incorporated using a hard penalty function, resulting in a controller that respects the constraint boundaries. Numerical instability that would be introduced by the penalty function is dealt with through an adaptive update scheme. The control design methodology is applicable to a large class of control problems. The performance and scalability of our proposed algorithm are demonstrated by numerical simulations.
BibTeX
@inproceedings{dai2021state,
  author = {Bolun Dai and Prashanth Krishnamurthy and Andrew Papanicolaou and Farshad Khorrami},
  title = {{State Constrained Stochastic Optimal Control Using LSTMs}},
  booktitle = {ACC},
  year = {2021},
  url = {https://openreview.net/forum?id=o0TjREutM-J},
}
Figure