# A Transformer-based Approach for Real-time Multi-agent Path Planning with Varying Initial/Final Conditions

arXiv: https://arxiv.org/abs/2610.30388 · HTML: https://mlsanity.com/paper/2610.30388/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Builds on 17 of its 27 references that are in the map.
- Submitted 21 Oct 2026.

## Builds on (most cited first, 17 of 17)

- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://mlsanity.com/paper/1810.04805/) (2018)
- [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://mlsanity.com/paper/2010.11929/) (2020)
- [The Deep Ritz method: A deep learning-based numerical algorithm for solving variational problems](https://mlsanity.com/paper/1710.00211/) (2017)
- [Solving high-dimensional partial differential equations using deep learning](https://mlsanity.com/paper/1707.02568/) (2017)
- [Are Transformers universal approximators of sequence-to-sequence functions?](https://mlsanity.com/paper/1912.10077/) (2019)
- [OT-Flow: Fast and Accurate Continuous Normalizing Flows via Optimal Transport](https://mlsanity.com/paper/2006.00104/) (2020)
- [Graph Neural Networks for Decentralized Multi-Robot Path Planning](https://mlsanity.com/paper/1912.06095/) (2019)
- [Adaptive Deep Learning for High-Dimensional Hamilton-Jacobi-Bellman Equations](https://mlsanity.com/paper/1907.05317/) (2019)
- [Algorithms for Overcoming the Curse of Dimensionality for Certain Hamilton-Jacobi Equations Arising in Control Theory and Elsewhere](https://mlsanity.com/paper/1605.01799/) (2016)
- [Operator Learning for Reconstructing Flow Fields from Sparse Measurements: an Energy Transformer Approach](https://mlsanity.com/paper/2501.08339/) (2025)
- [SympOCnet: Solving optimal control problems with applications to high-dimensional multi-agent path planning problems](https://mlsanity.com/paper/2201.05475/) (2022)
- [Spiking Neural Operators for Scientific Machine Learning](https://mlsanity.com/paper/2205.10130/) (2022)
- [AOSLO-net: A deep learning-based method for automatic segmentation of retinal microaneurysms from adaptive optics scanning laser ophthalmoscope images](https://mlsanity.com/paper/2106.02800/) (2021)
- [SMS: Spiking Marching Scheme for Efficient Long Time Integration of Differential Equations](https://mlsanity.com/paper/2211.09928/) (2022)
- [Randomized Forward Mode Gradient for Spiking Neural Networks in Scientific Machine Learning](https://mlsanity.com/paper/2411.07057/) (2024)
- [A Splitting Method For Overcoming the Curse of Dimensionality in Hamilton-Jacobi Equations Arising from Nonlinear Optimal Control and Differential Games with Applications to Trajectory Generation](https://mlsanity.com/paper/1803.01215/) (2018)
- [Operator Learning for Reconstructing Flow Fields from Sparse Measurements: a Language Model Approach](https://mlsanity.com/paper/2605.23712/) (2026)

## Abstract (arXiv)

We address the problem of real-time multi-agent path planning under prescribed initial and final configurations, formulated as a high-dimensional optimal control problem subject to inter-agent collision avoidance and obstacle constraints. Classical solvers based on the Hamilton--Jacobi--Bellman equation or Pontryagin's maximum principle (PMP) become computationally intractable as the number of agents grows, due to the curse of dimensionality and the non-convexity introduced by interaction constraints. We propose OCFormer, a transformer-based neural network that parameterizes the inverse of a coordinate transformation mapping a simple, analytically tractable latent space, in which agents evolve independently under a decoupled Hamiltonian, to the physical space of the coupled, interacting system. The model is trained by minimizing a physics-informed loss comprising the Hamiltonian ODE residual from the PMP and a boundary matching term, without requiring pre-computed trajectory data. The self-attention mechanism endows OCFormer with permutation equivariance over agents, a structural symmetry that prior symplectic network approaches do not natively enforce. When trained on a distribution of boundary conditions, the amortized OCFormer produces near-optimal trajectories for unseen initial and final configurations in a single forward pass (~220ms), enabling real-time inference without retraining. We further introduce a lightweight transfer learning framework that adapts a pretrained OCFormer to out-of-distribution perturbations in seconds via L-BFGS fine-tuning. Numerical experiments on two- and three-dimensional multi-agent navigation with up to 128 agents demonstrate the scalability and efficiency of the proposed approach.
