Ensuring Deployment-Time Safety of Neural Network Controlled Systems via Localized Certificate Repair
Organizations: Shanghai Key Laboratory of Trustworthy Computing, East China Normal University · KLSS, Institute of Software, Chinese Academy of Sciences · College of Computing and Data Science, Nanyang Technological University
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 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 faster on average. It incurs only 16.2% performance degradation relative to the original policy.
Figures & tables
| Benchmark | Original BC | Baseline | Ours | |||||
|---|---|---|---|---|---|---|---|---|
| Obstacle ID | Global retrain | Stage I | Stage II | Stage III | Verification | Total time | ||
| B1 | 616.6 | 1516.3 | 10.6 ✗ | 55.3 ✓ | 0 | 2.0 | 67.9 | |
| F | 10.3 ✓ | 0 | 0 | 3.2 | 13.5 | |||
| F | 11.2 ✓ | 0 | 0 | 3.1 | 14.3 | |||
| B2 | 685.3 | 1309.5 | 8.2 ✗ | 40.7 ✓ | 0 | 1.2 | 50.1 | |
| F | 8.1 ✗ | 44.8 ✓ | 0 | 1.5 | 54.4 | |||
| Benchmark | Scale of | Stage I | Stage II | Total time of Stages I,II | Stage III |
|---|---|---|---|---|---|
| MC | 5.1 ✗ | F | F | F | |
| 8.2 ✓ | 0 | 8.2 | 0 | ||
| 11.9 ✓ | 0 | 11.9 | 0 | ||
| 17.7 ✗ | 77.3 ✓ | 95.0 | 0 | ||
| 22.3 ✗ | F | F | 402.5 ✓ | ||
| PD | 6.4 ✗ | F | F | F |
| Benchmark | Obstacle ID | Original global BC | First repaired local BC | Previous template | ||||||
| Stage I | Stage II | Total time | Stage I | Stage II | Total time | Stage I | Stage II | Total time | ||
| MC | O1 | 11.5 | F | F | – | – | – | 11.5 | F | F |
| O2 | 11.6 | F | F | 12.2 | 0 | 12.2 | 12.2 | 0 | 12.2 | |
| O3 | 12.1 | F | F | 11.8 | 0 | 11.8 | 11.9 | 0 | 11.9 | |
| PD | O1 | 14.4 | F | F | – | – | – | 14.4 | F | F |
| O2 | 14.0 | F | F | 14.8 | 0 | 14.8 | 14.8 | 0 | 14.8 | |
| Benchmark | # Obs. | Ours | Shielding | |||||
|---|---|---|---|---|---|---|---|---|
| Total runtime | Avg. reward | Success rate (%) | # Shield Interventions | Total runtime | Avg. reward | Success rate (%) | ||
| B1 | 67.9 | 57.10 | 100 | 622 | 269.8 | 56.14 | 100 | |
| 81.4 | 55.37 | 100 | 972 | 413.6 | 53.96 | 100 | ||
| 95.7 | 54.59 | 100 | 1354 | 573.2 | 51.30 | 97 | ||
| B2 | 50.1 | 95.11 | 100 | 241 | 102.0 | 94.83 | 100 | |
| 104.5 | 94.89 | 100 | 270 | 116.2 | 94.12 | 100 | ||
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Benchmark | Original BC | Baseline | Ours | |||||
|---|---|---|---|---|---|---|---|---|
| Obstacle ID | Global retrain | Stage I | Stage II | Stage III | Verification | Total time | ||
| B1 | 616.6 | 1516.3 | 10.6✗ | 55.3✓ | 222.1 | 2.0 | 67.9 | |
| F | 10.3✓ | 0 | 194.9 | 3.2 | 13.5 | |||
| F | 11.2✓✓ | 0 | 204.2 | 3.1 | 14.3 | |||
| F | 11.3✓ | 0 | 270.7 | 3.2 | 14.5 | |||
| F | 11.6✓ | 0 | 234.0 | 3.2 | 14.8 | |||
| Benchmark | Scale of | Stage I | Stage II | Stage III | Total time of Stages I,II |
|---|---|---|---|---|---|
| B1 | 5.6✗ | F✗ | F✗ | F | |
| 8.3✗ | F✗ | F✗ | F | ||
| 11.0✓ | 0 | 204.2 | 11.0 | ||
| 17.2✓ | 0 | 281.5 | 17.2 | ||
| 19.9✗ | 72.5✓ | 366.1 | 92.4 | ||
| B2 | 4.7✗ | F✗ | F✗ | F |
| Benchmark | Obstacle ID | Original global BC | First repaired local BC | Previous template | ||||||
| Stage I | Stage II | Step time | Stage I | Stage II | Step time | Stage I | Stage II | Step time | ||
| B1 | O1 | 10.6 | 55.3 | 65.9 | – | – | – | 10.6 | 55.3 | 65.9 |
| O2 | 10.5 | 54.2 | 64.7 | 10.3 | 0 | 10.3 | 10.3 | 0 | 10.3 | |
| O3 | 10.9 | 0 | 10.9 | 10.6 | 0 | 10.6 | 11.0 | 0 | 11.0 | |
| O4 | 11.4 | 0 | 11.4 | 10.9 | 0 | 10.9 | 11.3 | 0 | 11.3 | |
| O5 | 11.3 | 0 | 11.3 | 11.3 | 0 | 11.3 | 11.6 | 0 | 11.6 | |
| Benchmark | # Obs. | Ours | Shield | |||||
|---|---|---|---|---|---|---|---|---|
| Total runtime | Avg. reward | Success rate (%) | # Shield Interventions | Total runtime | Avg. reward | Success rate (%) | ||
| B1 | 67.9 | 57.10 | 100 | 622 | 269.8 | 56.14 | 100 | |
| 81.4 | 55.37 | 100 | 972 | 413.6 | 53.96 | 100 | ||
| 95.7 | 54.59 | 100 | 1354 | 573.2 | 51.30 | 97 | ||
| B2 | 50.1 | 95.11 | 100 | 241 | 102.0 | 94.83 | 100 | |
| 104.5 | 94.89 | 100 | 270 | 116.2 | 94.12 | 100 | ||
| Benchmark | Obstacle ID | Learning rate | ||
|---|---|---|---|---|
| (main setting) | ||||
| B1 | 1728.5 | F | F | |
| F | F | F | ||
| F | F | F | ||
| F | F | F | ||
| F | F | F | ||