TL;DR
Latent safety filters protect end-to-end visuomotor policies but traditionally rely on jarring, binary switches between task-oriented and safety behaviors. This paper introduces LatentCBF, a method that enables smooth, optimization-based safety filtering directly in learned latent spaces by smoothing the constraint landscape and mixing policy data during training, doubling task success rates on real hardware.
What Problem Does This Paper Address?
Modern robots increasingly rely on end-to-end visuomotor policies (like diffusion models) to handle complex tasks directly from image inputs. However, ensuring safety under hard-to-model constraints—such as preventing a robot from spilling an open bag of candy—is incredibly difficult because classical safety filters require explicit analytical models of the environment and robot state.
While recent "latent safety filters" use world models to learn constraints from data, they rely on "least-restrictive" filtering. This means they discretely switch from the task policy to a conservative safety policy at the last second, which often causes the robot to stall completely and fail the task.
Control Barrier Functions (CBFs) offer a smoother alternative by minimally modifying actions via optimization. But trying to apply CBFs directly to learned latent spaces fails due to two core issues:
- Saturated Gradients: Safety boundaries are usually trained as binary classifiers (safe vs. unsafe), leading to steep, discontinuous jumps that leave optimization algorithms blind to relative action safety until it's too late.
- Distribution Mismatch: The safety value function is typically trained only on data generated by the conservative safety policy, making it highly inaccurate when evaluating the safety of actions proposed by the nominal task policy.
Methods
The authors propose LatentCBF to bridge this theory-practice gap with three key innovations:
- Smooth Margin Functions via WGAN-GP: Instead of a standard binary classifier, they train a smooth safety discriminator inspired by Wasserstein GANs with gradient penalties (WGAN-GP). This forces the boundary to have smooth gradients, providing a rich signal for optimization.
- Mixed Exploration Strategy: To fix the distribution mismatch, they populate the reinforcement learning replay buffer with an equal mix of trajectories from both the conservative safety policy and the nominal task policy. This ensures the safety critic accurately evaluates task-relevant actions.
- Parallelized Zeroth-Order Optimization: Because discrete-time latent CBF optimization is non-convex, they use a massively parallelized sampling approach, evaluating thousands of candidate actions (7,600 on hardware) in just 10 milliseconds to find the safest action closest to the nominal policy.
Datasets
- Simulated Dubins' Car Navigation: A vision-based benchmark evaluated over 100 trajectories with image inputs and privileged simulator information for ground-truth failure labeling (colliding with circular obstacles).
- Real-world Franka Manipulation Dataset: Consists of 735 trajectories (nominal rollouts, random actions, and teleoperated exploration) using a Franka robot arm attempting to lift an open bag of Skittles without spilling.
Key Insights and Ideas
- The Lipschitz Connection: The authors mathematically prove (Theorem 3) that the smoothness (Lipschitz constant) of the safety value function scales linearly with the smoothness of the underlying margin function. If your safety classifier has a sharp, discontinuous boundary, your safety filter's value function will inherently suffer from saturated gradients.
- Model-Free Filtering Scales Better: Instead of predicting future latent states ($z' = f_z(z,a)$) for every sample action (model-based), evaluating the state-action value function $Q(z,a)$ directly (model-free) bypasses heavy vision-transformer inference bottlenecks, enabling real-time scaling to thousands of action samples.
Key Results
- Simulation: The gradient penalty (GP) reduced the maximum margin function gradients by 86% compared to the baseline. LatentCBF decreased the average action override magnitude by 45% relative to least-restrictive filtering while maintaining a 100% safety rate.
- Hardware: On the real Franka robot, LatentCBF doubled the safe task-completion rate (from 38% to 80%) compared to traditional switching methods, successfully guiding the robot to slide and regrasp the bag safely rather than stalling out.
- Speed: Model-free filtering evaluated 7,600 actions in 9.6 ms, whereas model-based filtering ran out of memory at just 50 actions due to the large DINO-WM transformer bottleneck.
Limitations and Future Work
- No Formal Guarantees: Because it relies entirely on learned latent representations and neural network approximations, LatentCBF lacks the rigorous mathematical safety guarantees of classical CBFs.
- Out-of-Distribution (OOD) Vulnerability: If the safety filter pushes the robot into states completely unseen during training, performance drops. The authors note that future work should integrate uncertainty estimation or OOD detection to handle these edge cases safely.
Summary updated