Skip to content
Robotics.world

Research

BarrierFormer: Transformer-Guided Predictive Barrier Enforcement for Safe Robot Control

Standard CBF controllers only check safety at the current time step, so a robot can be pushed into a state where no safe action exists later. MPC-style methods fix this by looking ahead, but they…

The paper’s first page · arXiv:2609.23896
arXiv
2609.23896 · accepted · CORL
Published
2026-09-20
Authors
Anandsingh Chauhan, Kunal Garg

In plain words

Standard CBF controllers only check safety at the current time step, so a robot can be pushed into a state where no safe action exists later. MPC-style methods fix this by looking ahead, but they need a known dynamics model and solve a constrained optimization problem online, which is expensive.

AI summary

Overview

Research area: Safe robot control / safety-critical learning-based control, combining control barrier functions (CBFs), model predictive control ideas, and causal transformer policies.

Technical level: Advanced. The paper assumes familiarity with discrete-time control barrier functions, control-invariant sets, sequential quadratic programming, and transformer policy architectures.

Scope: The paper proposes BarrierFormer, a transformer-based, model-free policy that learns to enforce control barrier function constraints over a predicted future horizon through training-time supervision, so that no online optimization or dynamics model is needed at deployment.

What This Paper Is About

Standard CBF controllers only check safety at the current time step, so a robot can be pushed into a state where no safe action exists later. MPC-style methods fix this by looking ahead, but they need a known dynamics model and solve a constrained optimization problem online, which is expensive. BarrierFormer instead teaches a transformer policy, during training only, to imitate the corrections a safety optimizer would make over a predicted rollout, so at inference the policy maps history directly to actions with no optimization.

Key Contributions

  1. BarrierFormer framework: A model-free framework that encodes observation-action histories and incorporates barrier constraints over a future horizon (not just the current step) into safe policy learning.
  2. Learned replacement for online optimization: Horizon-level safe-input computation is replaced by a learned policy, giving faster runtime inference than existing predictive methods such as CBF-MPC and diffusion-based planners.
  3. Partial-observation operation: The method uses past observation-action history, where observations contain the robot state and local LiDAR measurements, with no global map, to predict state increments and reconstruct future observations.
  4. Empirical comparison: Evaluation on linear and nonlinear dynamics against RL-based, diffusion-based, MPC-based, and transformer-based baselines, reporting improved safety rate, faster inference, and claimed zero-shot generalization to larger, more cluttered environments.

Main Findings

  • Best model-free safety/success trade-off (Double Integrator): Ours (Dyn-Head) reaches safety 95.83 ± 1.47, reach 89.58 ± 6.42, success 88.54 ± 6.42, versus ConBaT (72.9 ± 8.20 safety, 68.8 ± 6.80 success), CBF-RL (67.71 ± 2.95 on all three) and CoBL-Diffusion (76.04 ± 3.90 safety, 21.88 ± 5.10 success).
  • Strong results on Dubins Car: Ours (Dyn-Head) obtains safety 95.83 ± 2.95 and success 92.71 ± 2.95, compared with ConBaT (64.6 ± 13.10 safety, 21.9 ± 2.60 success) and CBF-RL (56.25 ± 5.10 safety, 52.08 ± 3.90 success).
  • Diffusion baseline is safe but does not reach goals: CoBL-Diffusion achieves 98.96 ± 1.80 safety on Crazyflie but 0.00 ± 0.00 reaching and success, consistent with the local-trap problem the paper cites where CBF-guided gradient projection during denoising prevents progress.
  • Comparable to MPC in safety, far faster: Ours (Sim) matches MPC safety on Double Integrator and Dubins Car (98.96 ± 1.47 and 97.92 ± 1.47) while per-step time is 4.96 ± 0.03 µs and 4.82 ± 0.04 µs against MPC's 8256 ± 900 µs and 9280 ± 1262 µs. The paper states this is a reduction of two to three orders of magnitude.
  • Crazyflie favors all methods: Performance is higher across methods because the 3D environment has lower obstacle density; Ours (Dyn-Head) reaches 96.88 ± 2.55 safety and 89.58 ± 8.20 success, while MPC reaches 93.75 ± 0.00 safety and 93.75 ± 0.00 success with 2773 ± 103 µs per step.
  • Learned dynamics head works nearly as well as simulator rollouts: The Dyn-Head variant, which trains the barrier critic on rollouts from the learned dynamics model, remains competitive with the Sim variant, answering the paper's second evaluation question.
  • CoBL-Diffusion inference time: Not reported, because diffusion planners require iterative denoising at inference.
  • Generalization claim: The paper states evaluation shows zero-shot generalization to larger and more cluttered environments; the specific generalization numbers fall beyond the truncated content available here and are therefore not reported in this summary.

Methodology in Plain English

The robot sees only its own state, the goal direction, and a fan of LiDAR rays within a fixed sensing radius (R = 0.5) with robot radius r = 0.05, and has no map of where obstacles are.

The system has three learned parts sharing one GPT-2-style causal transformer backbone. The backbone reads a history of T = 12 observations and the preceding actions, encoded as 2T−1 interleaved tokens. An action head outputs a correction added to a simple nominal goal-seeking controller. A dynamics head predicts the next state increment, which lets the model roll the future forward itself instead of relying on a known physics model. A barrier critic scores how safe each observation is.

During training, the transformer autoregressively generates a rollout H = 6 steps into the future, reconstructing predicted observations along the way. The barrier critic checks a discrete-time CBF condition at every step of that rollout, and violations are aggregated with a smooth log-sum-exp maximum. An SQP-based "safety teacher" then solves a receding-horizon problem that minimally modifies the nominal controller while satisfying those horizon constraints, using slack variables for feasibility. Only the first element of that solution is kept as the label the action head is trained to reproduce.

Training has two phases: Phase 1 pretrains the backbone and dynamics head and initializes the action head by behavioral cloning on offline trajectories; Phase 2 minimizes the combined actor, dynamics, and barrier losses with on-policy data from a replay buffer plus a separate buffer of unsafe rollouts. Observations are labeled safe only if the current state and the next T_label = 32 states are collision-free, otherwise unsafe or left unlabeled.

At deployment, the teacher and the online optimization disappear; the transformer maps history to an action directly.

Why This Matters

This work shows that horizon-level safety reasoning can be moved from inference time into policy parameters, which directly attacks the cost barrier that keeps predictive safety methods off real robots. It also demonstrates that a learned dynamics model coupled with a learned barrier critic can substitute for a known model inside the safety-checking loop.

Real-world applications:

  • Drone flight in cluttered indoor spaces: The Crazyflie experiments target quadrotor navigation with only local sensing.
  • Ground robot warehouse navigation: The Double Integrator and Dubins Car setups map onto differential-drive and car-like warehouse or delivery robots.
  • Automotive and mobile machinery: Fast, optimization-free safety layers suit platforms with tight control-loop budgets.
  • Field robotics without maps: Operating from local LiDAR alone fits subterranean, search-and-rescue, or planetary scenarios where a global map is unavailable.

Industry relevance centers on latency: per-step times of roughly 5 µs (4.79–5.12 µs across environments) versus thousands of microseconds for MPC make this class of policy plausible on embedded hardware, and removing the online solver removes a common certification headache.

Future Directions

  1. Formal guarantees: The approach learns safety empirically; establishing certified forward invariance for the learned policy, rather than barrier-supervised imitation, remains open.
  2. Robustness to prediction error: The safety margin η_s tightens constraints to cover mismatch between predicted and true observations, but how to set it systematically, and how performance degrades under model error, is unaddressed.
  3. Real-hardware validation: All results are in simulation on three dynamical systems; deployment on physical robots with sensing noise and actuation delay is the natural next step.
  4. Scaling and generalization measurement: The paper claims zero-shot transfer to larger and more cluttered environments; quantifying that systematically, and testing longer horizons than H = 6 and histories beyond T = 12, would clarify where the approach breaks.

Target Audience

Robotics and control researchers working on safety-critical learning-based control, especially those familiar with CBFs, MPC, or transformer policies. It also suits practitioners building real-time safety layers for drones, ground vehicles, or manipulators who need predictive safety without an online solver, and graduate students studying the intersection of imitation learning and constrained optimization.

Authors’ abstract

Control barrier functions (CBFs) have become one of the most popular tools for encoding and enforcing state constraints in safety-critical robotics. Standard CBF approaches are inherently myopic in nature as they enforce safety only at the current time step. Consequently, the system can be driven toward the boundary of the safe set where no feasible safe control exists at a future timestep. Model predictive control (MPC) based approaches address this by enforcing state…

The full abstract on arXiv
Read the original paper

Related papers