Autonomous systems—from self-driving cars to aerial drones—are bound by one inescapable demand: safety. But encoding safety directly into algorithms is harder than it sounds. We can write explicit constraints (“don’t crash,” “stay upright”), yet the boundary between safe and unsafe states often defies simple equations. The recent paper Learning Neural Control Barrier Functions from Expert Demonstrations using Inverse Constraint Learning (Yang & Sibai, 2025) offers a different path. It suggests that machines can learn what safety looks like—not from rigid formulas, but from watching experts.
From Control Rules to Learned Barriers
Control Barrier Functions (CBFs) are a powerful tool for guaranteeing safety in control systems. Think of them as mathematical safety bubbles that enclose all the “allowed” states of a robot. A control policy is safe if it keeps the system within that bubble. Traditionally, these bubbles are designed by engineers through optimization or reachability analysis—a process that quickly collapses under real-world complexity.
Neural CBFs emerged to sidestep this, training neural networks to approximate the safety boundary from data. But this approach faces a bottleneck: how do you label what’s safe and what’s not? For many systems, like autonomous driving, it’s not always obvious where safety ends. We know when a car doesn’t crash—but what about tailgating, hesitation, or borderline maneuvers? The boundaries blur.
That’s where Inverse Constraint Learning (ICL) enters.
Watching Experts to Infer Constraints
Inverse Constraint Learning flips the script. Instead of specifying the failure set manually, it assumes we have access to expert demonstrations—trajectories that achieve a task while staying safe. From these, ICL infers a constraint function that classifies states into “safe” and “unsafe,” effectively discovering the hidden safety rule that the expert is following.
Yang and Sibai extend this idea to train neural CBFs. Their algorithm—ICL-CBF—works iteratively:
- Learn a constraint function from expert and simulated trajectories.
- Label new trajectories using that function.
- Train a neural CBF on those labels.
- Filter unsafe actions using the learned barrier.
- Repeat until both the constraint and the CBF converge.
This loop allows the system to gradually refine its sense of safety, even when the precise failure set is unknown. In essence, it builds a safety model from behavior rather than rules.
A Safer Path Without Overcorrection
The experiments are revealing. Across four tasks—a simple 2D robot, a Dubins car, an inverted pendulum, and a quadrotor—the ICL-CBF consistently outperformed prior methods such as ROCBF and iDBF. It not only avoided collisions but did so without excessively hindering the robot’s progress. In other words, it maintained task efficiency while staying safe.
Consider the inverted pendulum case: where other methods misclassified safe states as unsafe, causing the pendulum to freeze or oscillate, the ICL-CBF learned to intervene only when necessary—mirroring human-like judgment. The method’s ability to generalize from imperfect demonstrations makes it particularly promising for autonomous vehicles or drones, where safety constraints are implicit and context-dependent.
Why It Matters: From Hard Rules to Soft Learning
The shift from hand-crafted safety constraints to learned safety concepts mirrors a broader movement in AI: letting systems infer structure from examples rather than enforcing rigid formalisms. It’s akin to how humans learn—by seeing what works and internalizing boundaries without formal equations.
Still, this approach raises critical questions. How do we ensure that learned safety barriers generalize to unseen scenarios? What happens when expert demonstrations themselves contain subtle risks? And can this process ever be certified in safety-critical domains like aviation or healthcare?
Yang and Sibai’s work doesn’t resolve these issues, but it reframes the debate. Safety, they imply, doesn’t have to mean rigidity—it can emerge from adaptive learning, provided we train systems to recognize why experts act safely, not just what they do.
The Bigger Picture
This paper signals a convergence between control theory and machine learning, two traditions that long spoke different languages. The former prized guarantees; the latter, flexibility. Inverse constraint learning—and its offspring, neural CBFs—are a bridge between the two. They translate human caution into machine intuition, one trajectory at a time.
As AI systems take on more physical agency, learning from the right kind of examples—those that embody implicit safety—may prove as vital as any formal proof. If so, the future of autonomy might depend not only on better algorithms but on better teachers.
Cognaptus: Automate the Present, Incubate the Future