Real-Time Optimal Control via Transformer Networks and Bernstein Polynomials
Gage MacLin, Venanzio Cichella, Andrew Patterson, Irene Gregory
TL;DR
The paper tackles real-time solution of infinite-dimensional optimal control and calculus-of-variations problems under nonlinear dynamics and constraints. It couples offline data generation via composite Bernstein collocation with a Transformer-based model that maps problem parameters $\bm{\theta}$ to trajectory coefficients expressed as composite Bernstein polynomials $\bm{x}_M(t)$, enabling fast online generation and feasibility verification through Bernstein properties. Core contributions include formalization of $P^{CV}(\bm{\theta})$ and $P^{OC}(\bm{\theta})$, discretization via composite Bernstein collocation, and a training/inference pipeline that uses teacher forcing and autoregressive control-point prediction. Numerical results on the Brachistochrone and obstacle avoidance problems demonstrate accurate, real-time trajectory generation and the potential to warm-start or verify online optimal controllers in safety-critical applications.
Abstract
In this paper, we propose a Transformer-based framework for approximating solutions to infinite-dimensional optimization problems: calculus of variations problems and optimal control problems. Our approach leverages offline training on data generated by solving a sample of infinite- dimensional optimization problems using composite Bernstein collocation. Once trained, the Transformer efficiently generates near-optimal, feasible trajectories, making it well-suited for real-time applications. In motion planning for autonomous vehicles, for instance, these trajectories can serve to warm- start optimal motion planners or undergo rigorous evaluation to ensure safety. We demonstrate the effectiveness of this method through numerical results on a classical control problem and an online obstacle avoidance task. This data-driven approach offers a promising solution for real-time optimal control of nonlinear, nonconvex systems.
