Learning Sampling Distributions for Model Predictive Control

Jacob Sacks, Byron Boots

Abstract

Sampling-based methods have become a cornerstone of contemporary approaches to Model Predictive Control (MPC), as they make no restrictions on the differentiability of the dynamics or cost function and are straightforward to parallelize. However, their efficacy is highly dependent on the quality of the sampling distribution itself, which is often assumed to be simple, like a Gaussian. This restriction can result in samples which are far from optimal, leading to poor performance. Recent work has explored improving the performance of MPC by sampling in a learned latent space of controls. However, these methods ultimately perform all MPC parameter updates and warm-starting between time steps in the control space. This requires us to rely on a number of heuristics for generating samples and updating the distribution and may lead to sub-optimal performance. Instead, we propose to carry out all operations in the latent space, allowing us to take full advantage of the learned distribution. Specifically, we frame the learning problem as bi-level optimization and show how to train the controller with backpropagation-through-time. By using a normalizing flow parameterization of the distribution, we can leverage its tractable density to avoid requiring differentiability of the dynamics and cost function. Finally, we evaluate the proposed approach on simulated robotics tasks and demonstrate its ability to surpass the performance of prior methods and scale better with a reduced number of samples.

Introduction

Model Predictive Control (MPC) is a fundamental tool in robotics, enabling systems to plan actions by simulating potential future trajectories. Sampling-based MPC algorithms, such as Model Predictive Path Integral (MPPI) control, are particularly valued for their ability to handle non-differentiable dynamics and cost functions. These methods typically generate control sequences by sampling from a distribution, often a simple Gaussian.

However, in environments characterized by complex obstacles or narrow feasible regions, a Gaussian distribution is often inadequate. Most samples may fall into high-cost or infeasible regions, leading to computational inefficiency and poor control performance. While recent approaches have utilized Normalizing Flows (NFs) to learn more expressive sampling distributions, they often revert to the original control space for optimization updates and temporal "warm-starting." This hybrid approach introduces heuristics that can degrade the performance gains offered by the learned distribution.

Methodology: NFMPC

We introduce NFMPC (Normalizing Flow MPC), a framework that performs all optimization and warm-starting operations directly within the latent space of a Normalizing Flow.

Latent Space Optimization

Rather than updating control sequences in the high-dimensional control space, NFMPC optimizes the parameters of a simple distribution in a latent space. These latent samples are transformed through a Normalizing Flow into complex, multi-modal control sequences in the actual control space. This ensures that the optimization process respects the learned structure of the environment.

Bi-level Optimization and Training

The training of NFMPC is framed as a bi-level optimization problem. The lower-level optimization determines the best plan for a given environment using Mirror Descent in the latent space. The upper-level optimization trains the NF parameters using Backpropagation-Through-Time (BPTT), treating the entire MPC planning episode as a recurrent process. This allows the model to learn a distribution that specifically facilitates successful planning across diverse scenarios.

Learned Shift Model and Constraints

To maintain temporal consistency, we learn a shift model that predicts the evolution of the latent distribution between time steps. This replaces the standard heuristic of shifting control sequences in time. Additionally, physical control limits (box constraints) are integrated directly into the NF architecture via sigmoid transformations, ensuring that all generated samples are physically feasible.

Experimental Results

The proposed method was evaluated on two challenging benchmarks: a planar robot navigation task with dynamic obstacles (PNRANDDYN) and a 7-DOF Franka Panda arm obstacle avoidance task (FRANKAOBSTACLES).

Quantitative Performance and Sample Efficiency

NFMPC demonstrates significant improvements in both success rate and cost across both tasks. In the planar navigation task, it achieved a 20% lower median cost compared to standard MPPI. The most striking advantage is observed in sample efficiency.

Success rate and total cost for the Franka arm task.

As shown in the results for the Franka arm task, when the number of samples is reduced from 1024 to 16, NFMPC's success rate drops by only 29%, whereas the previous state-of-the-art method, FlowMPPI, experiences a drop of nearly 70%. This robustness suggests that the learned latent distribution effectively captures the relevant regions of the control space, requiring fewer "guesses" to find a near-optimal path.

Qualitative Analysis

Visualizations of the planned trajectories indicate that NFMPC effectively learns complex behaviors, such as pausing for dynamic obstacles or navigating through narrow gaps, which standard MPPI often fails to do. The multi-modal nature of the learned distribution allows the controller to simultaneously consider multiple distinct paths around obstacles.

Qualitative comparison of trajectories across different MPC methods.

Conclusion

NFMPC represents a significant step forward in sampling-based MPC by fully integrating learned distributions into the optimization loop. By operating entirely in the latent space, the method achieves superior sample efficiency and performance in complex robotic tasks. Future work will focus on extending the framework to handle variable planning horizons and improving its generalization to entirely out-of-distribution environments.

Summary updated

BibTeX
@inproceedings{sacks2022learning,
  author = {Jacob Sacks and Byron Boots},
  title = {{Learning Sampling Distributions for Model Predictive Control}},
  booktitle = {Conference on Robot Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=8ktEdb5NHEh},
}
Figure