Transformer-based Model Predictive Control: Trajectory Optimization via Sequence Modeling

1Politecnico di Torino, 2Stanford University
*Equal contribution

Transformer-based networks enable effective open-loop trajectory planning (left) and closed-loop Model Predictive Control (right).

Abstract

Model predictive control (MPC) has established itself as the primary methodology for constrained control, enabling general-purpose robot autonomy in diverse real-world scenarios. However, for most problems of interest, MPC relies on the recursive solution of highly dnon-convex trajectory optimization problems, leading to high computational complexity and strong dependency on initialization.

In this work, we present a unified framework to combine the main strengths of optimization-based and learning-based methods for MPC. Our approach entails embedding high-capacity, transformer-based neural network models within the optimization process for trajectory generation, whereby the transformer provides a near-optimal initial guess, or target plan, to a non-convex optimization problem.

Our experiments, performed in simulation and the real world onboard a free-flyer platform, demonstrate the capabilities of our framework to improve MPC convergence and runtime. Compared to purely optimization-based approaches, results show that our approach can improve trajectory generation performance by up to 70%, reduce the number of solver iterations by up to 45%, and improve overall MPC runtime by 7x without loss in performance.

Numerical results

The Transformers for Trajectory Optimization framework is evaluated in three different test scenarios, inlcuding nonlinear dynamics and obstacle avoidance constraints:

  1. Autonomous Rendezvous and Proximity Operations,
  2. Quadrotor Control,
  3. Free Flyer Control.

Although targeting explicitly closed-loop performance, the fine-tuning process benefits the open-loop setting, too. Warm-starting sequential optimizers with the fine-tuned transformer-based neural network (FT-TTO) increases the fuel-optimality of the planned trajectory.

In the closed-loop setting, the fine-tuning process enables FT-TTO to effectively boost MPC performance, providing a long-horizon guidance to short-horizon planning problems. FT-TTO-MPC outperforms all the baselines considered, thanks to its robustness to covariance shifts induced by the closed-loop execution.

Experimental results

Experimental tests on a real-world robotic platform, a Free Flyer testbed, confirm the numerical results. Even when planning with the shortest time-horizon considered, FT-TTO-MPC is able to plan an overall trajectory which is closely aligned to the open-loop solution, limiting the cost increment due to the short-horizon planning approximately to 20%.

BibTeX

@article{transformermpc2024,
  author    = {Celestini, Davide and Gammelli, Daniele and Guffanti, Tommaso and D'Amico, Simone and Capello, Elisa and Pavone, Marco},
  journal   = {IEEE Robotics and Automation Letters},
  title     = {Transformer-Based Model Predictive Control: Trajectory Optimization via Sequence Modeling},
  year      = {2024},
  volume    = {9},
  number    = {11},
  pages     = {9820-9827},
  doi       = {10.1109/LRA.2024.3466069}
}