Safe Beyond the Horizon: Efficient Sampling-based MPC with Neural Control Barrier Functions

Ji Yin, Oswin So, Eric Yang Yu, Chuchu Fan, Panagiotis Tsiotras · OpenReview

Abstract

Model Predictive Control (MPC) is a cornerstone of modern robotics, yet it frequently struggles with ensuring safety beyond its immediate planning horizon. Traditional methods for guaranteeing recursive feasibility—such as terminal set constraints—are often mathematically intractable for complex, nonlinear systems. This paper introduces Neural Shield-VIMPC (NS-VIMPC), a framework that integrates learned Discrete-time Policy Neural Control Barrier Functions (DPNCBF) into a variational inference MPC (VIMPC) paradigm. By combining these neural "shields" with a novel resampling-based rollout strategy, the proposed method achieves significant improvements in sample efficiency and safety, enabling real-time, high-speed autonomous navigation on standard CPU hardware.

Introduction

Model Predictive Control (MPC) operates by simulating potential future trajectories and selecting the optimal control sequence based on a cost function. However, MPC possesses a critical vulnerability: the finite horizon. If a planning horizon is too short, a robot may inadvertently enter a state from which recovery is physically impossible—a failure of recursive feasibility. For example, a high-speed vehicle might accelerate into a curve it cannot see yet, realizing too late that its momentum exceeds its braking capacity.

While theoretical solutions exist, such as enforcing a "safe bubble" (terminal set) at the end of the horizon, these are notoriously difficult to design for "black-box" or highly nonlinear dynamics. Furthermore, sampling-based MPC methods like Model Predictive Path Integral (MPPI) are often computationally inefficient, requiring thousands of samples to find safe paths in constrained environments. NS-VIMPC addresses these challenges by learning the safety boundary and optimizing how trajectories are sampled.

Methodology

1. Neural Control Barrier Functions (The Shield)

To address the difficulty of analytical safety guarantees, the authors propose Discrete-time Policy Neural Control Barrier Functions (DPNCBF). Instead of manual derivation, a neural network is trained to approximate a Control Barrier Function (CBF). This network acts as a "Shield," mapping states to a value that indicates safety: negative values represent safe regions, while positive values indicate potential violations. By maintaining the robot within the Shield’s negative region, the system provides a learned guarantee that a safe control action exists for the subsequent time step, effectively extending the safety horizon indefinitely.

2. Resampling-Based Rollout (RBR)

Standard sampling-based MPC typically draws trajectories from a simple Gaussian distribution. In cluttered environments, this is highly inefficient; many samples are wasted on trajectories that immediately collide with obstacles.

Inspired by particle filtering, the authors introduce Resampling-Based Rollout (RBR). This strategy "rewires" trajectories during the simulation process. If a sampled path begins to violate the safety shield at an early stage of the rollout, the algorithm "teleports" that sample to the state of a currently safe trajectory and continues the simulation from there. This concentration of samples in safe regions of the state space drastically reduces the variance of the estimated optimal control, allowing the controller to find valid paths with far fewer total samples.

Experimental Validation

The framework was evaluated across three distinct platforms to test its robustness and efficiency:

  • Autonomous Racing (AutoRally): Using a 1/5 scale racing car in both high-fidelity simulation and real-world dirt track environments. The car reached speeds of 15 m/s, significantly exceeding previous benchmarks of 8-9 m/s.
  • Planar Quadrotor: A simulated drone navigating a narrow corridor while subject to complex "ground effects" (aerodynamic turbulence).
  • Dubins Car: A standard mathematical model used to validate the theoretical properties of the RBR strategy.

In hardware tests, the system was subjected to "adversarial" cost functions where the robot was intentionally commanded to crash. Because the Neural Shield acts as a hard constraint on the sampling distribution, the vehicle successfully prioritized the learned safety boundaries over the user's unsafe instructions.

Key Results

5x Sample Efficiency

NS-VIMPC demonstrated a 5x improvement in sample efficiency compared to standard Shield-MPPI. By utilizing the RBR strategy, the controller achieved superior safety metrics while requiring significantly fewer simulated trajectories.

Real-Time CPU Performance

Due to its high sample efficiency, NS-VIMPC does not require the high-end GPUs typically associated with sampling-based MPC. The controller runs at over 70Hz on a standard laptop CPU, making it highly accessible for edge computing in robotics.

Zero Crash Rates

In the drone corridor task, NS-VIMPC maintained a 0% crash rate across all tested horizons. In contrast, baseline methods such as standard MPPI and Cross-Entropy Method (CEM) suffered frequent failures, particularly when the planning horizon was shortened.

Conclusion

Neural Shield-VIMPC represents a significant step forward in making sampling-based MPC both safe and computationally efficient. By replacing rigid analytical constraints with learned neural barriers and optimizing sample distribution through RBR, the framework enables robots to handle complex, high-speed maneuvers that were previously too risky or computationally expensive. Future work will explore the integration of Control Lyapunov Functions (CLFs) to further optimize goal-reaching performance alongside safety guarantees.

Summary updated

BibTeX
@misc{yin2025safe,
  author = {Ji Yin and Oswin So and Eric Yang Yu and Chuchu Fan and Panagiotis Tsiotras},
  title = {{Safe Beyond the Horizon: Efficient Sampling-based MPC with Neural Control Barrier Functions}},
  year = {2025},
  eprint = {2502.15006},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.15006},
}
Figure