Ensuring Deployment-Time Safety of Neural Network Controlled Systems via Localized Certificate Repair

Xiaoyang Lv, Peixin Wang, Jianhao Bai, Bai Xue, Min Zhang, Luke OngNeurIPS 2026

TL;DR

When a robot controlled by a neural network encounters a brand-new, persistent obstacle in the wild, its pre-deployment safety guarantees shatter. Instead of halting everything to retrain the brain from scratch or relying on laggy emergency brakes every time it passes by, this paper introduces a way to surgically "patch" the safety certificate and policy only around the new obstacle. It restores ironclad, global safety guarantees in tens of seconds, reusing what the network already knows everywhere else.

What Problem Does This Paper Address?

Suppose you train a deep reinforcement learning (DRL) agent to drive an autonomous mining vehicle. Because crashing is expensive, you pair the controller with a Barrier Certificate (BC)—a mathematical function (here, parameterized as a neural network) that acts like an invisible forcefield. If a valid BC exists, it formally proves the system's trajectories will never cross from safe states into unsafe ones.

Here is the catch: BCs are typically forged offline for a static map. Once deployed, the real world happens—a rockfall blocks a tunnel, introducing a persistent new obstacle. Now your controller might steer right into it, and your mathematical proof of safety is invalid.

Problem statement and comparison of deployment-time safety solutions.

Until now, engineers faced two unappealing choices:

  1. Global Retraining: Retrain both the controller and certificate from scratch. This throws away everything already learned and is far too slow for deployment budgets.
  2. Runtime Shielding: Keep an online monitor running that overrides the controller whenever danger is near. Great for a pedestrian walking by, but if the obstacle is persistent (like that rockfall on a daily route), the system pays a heavy, recurring computational tax every single trip.

The authors ask: Can we do a fast, one-time local surgical repair around the new obstacle, stitch it seamlessly into our existing global guarantee, and move on?

Methods

The authors introduce Adaptive Piecewise Barrier Certificates alongside a three-stage Transfer-Based Repair pipeline.

First, they draw a box around the new obstacle (creating a local repair region, $S_{\text{new}}$) and leave the rest of the state space ($S_{\text{origin}}$) untouched. To ensure the system doesn't cheat safety when crossing the border between the old map and the patched zone, they establish switching interface conditions—mathematical rules governing entry and exit transitions that guarantee global safety holds if the pieces fit together.

Overview of the problem and the three-stage localized repair framework.

Next, to synthesize the local certificate fast, they reuse the internal feature representations of a previously certified neural BC, aligning regions via a simple affine transformation. Furthermore, instead of playing an endless game of "whack-a-mole" searching for continuous-space counterexamples, they discretize the local region into a finite grid padded with Lipschitz-continuity margins—meaning if the math holds on the grid points, it provably holds everywhere in between.

Repair then proceeds through a progressive, three-stage escalation:

  • Stage I (Last-layer certificate repair): Keep the control policy fixed and just tweak the final layer weights of the transferred BC. Because only the last layer changes, this reduces to a super-fast Linear Program (LP).
  • Stage II (Joint adaptation): If the original policy stubbornly drives straight into the new rock, tweaking the certificate alone won't work. Stage II unlocks the local policy parameters and uses bilevel optimization (backpropagating through the LP's error slack) to gently nudge both the policy and the BC's last layer together.
  • Stage III (Localized retraining): If all else fails before timeout, retrain a new policy and BC from scratch—but strictly inside that tiny local box.

Datasets

Because this is a dynamical systems control paper, evaluation happens on continuous-control simulation benchmarks rather than static static datasets:

  • B1 and B2: Standard 2D nonlinear control benchmarks trained with DDPG.
  • Mountain Car Continuous (MC) and Pendulum (PD): Classic OpenAI Gym control environments trained with PPO and SAC, respectively.

The authors modify these existing benchmarks by sequentially injecting up to five randomly placed, persistent obstacles after initial training and certification to test deployment-time adaptation.

Key Insights and Ideas

  • The "Warm-Up" Phenomenon: On complex environments (MC and PD), adapting to the very first new obstacle using the original global certificate is tough, forcing the system to fall back to Stage III (local retraining). However, once that first local certificate is forged, reusing it as the template for obstacles 2 through 5 lets the system solve every subsequent obstacle in Stage I alone (pure linear programming) in seconds! Local obstacle-avoidance features transfer remarkably well to other local obstacles.
  • The Goldilocks Zone of Repair Regions: Make the local repair box too tight around an obstacle, and the math becomes infeasible—the system literally doesn't have enough room to steer away. Make it too big, and optimization slows down. Doubling the obstacle's dimensions hits a sweet spot.
  • Continuous Guarantees from Finite Grids: Using Lipschitz bounds to turn infinite continuous-state safety constraints into a single-shot finite LP bypasses slow, iterative verification loops during repair.

Key Results

  • 100% Success & Massive Speedup: Across 4 benchmarks with 5 sequential obstacles each, the proposed framework succeeded in all cases within tens of seconds on average (e.g., ~11–14s for subsequent obstacles on B1/B2, ~29s on MC). Global retraining failed (timed out after 2 hours) in most multi-obstacle scenarios; where global retraining did succeed, localized repair was 17.3$\times$ faster on average.
  • Preserved Performance: After 5 added obstacles, the patched policies suffered only 16.2% average reward degradation compared to the obstacle-free nominal policy.
  • Beating Runtime Shielding: Over 200 test runs on B1 with 3 obstacles, shielding intervened 1,354 times, racking up 573.2s of total runtime and achieving a 97% success rate. Localized repair paid a one-time fix cost for a total runtime of 95.7s, achieved a 100% success rate, and earned higher rewards.

Limitations and Future Work

  • Last-Layer Bottleneck: Stages I and II only modify the final layer of the neural barrier certificate. In highly complex dynamics, the frozen earlier layers might lack the expressiveness needed, forcing the pipeline into slower Stage III retraining. Future work aims to extend fast repair to multiple network layers.
  • Obstacle Placement Sensitivity: How close an obstacle spawns to initial states or tight corridors affects feasibility and speed; the authors plan to systematically study how obstacle locations impact repair efficiency.

Summary updated

Abstract

Barrier certificates provide formal safety guarantees for neural network controlled systems by ensuring that system trajectories avoid unsafe regions over time. However, after deployment, previously unseen obstacles or constraint changes may introduce new unsafe regions, invalidating the original certificate and potentially leading to unsafe behavior. We address this setting with $\textit{adaptive piecewise barrier certificates}$, which preserve the original certificate and policy in unchanged regions while introducing localized updates around newly emerged unsafe regions. The central question is how to perform such updates efficiently during system execution without retraining from scratch. Our key idea is to cast deployment-time adaptation as a localized certificate repair problem and reduce it to an optimization task that leverages the learned structure of previous barrier certificates, enabling fast updates without global retraining. We further design a staged repair framework that progressively transitions from localized repair to joint policy–certificate updates and, when necessary, localized retraining. Empirical results on four benchmarks with five new obstacles show that our method succeeds in all cases and completes within tens of seconds on average, whereas retraining from scratch fails in most cases. On instances where retraining succeeds, our method is **17.3** $\times$ faster on average. It incurs only **16.2\%** performance degradation relative to the original policy.
BibTeX
@inproceedings{lv2026ensuring,
  author = {Xiaoyang Lv and Peixin Wang and Jianhao Bai and Bai Xue and Min Zhang and Luke Ong},
  title = {{Ensuring Deployment-Time Safety of Neural Network Controlled Systems via Localized Certificate Repair}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=fMUyPAggFz},
}
Figure