Verification-guided safety repair for learned controllersVerification-Guided Safety-Repair of Learned Controllers
The authors propose ReachECO, which derives repair constraints from failed closed-loop reachability analysis, repairs the abstracted controller so that it passes safety verification, and demonstrates it on ACC, Docking2D, and Car2D.
The paper targets trained controllers that fail closed-loop safety verification, not adversarial attackers. A repair instance consists of an abstracted controller π0, an initial set X0, an unsafe set U, an optional target set XG, a finite repair action alphabet Acont, and a verification budget T; the goal is to obtain a π′ certified safe according to Definition 1 while preserving the original controller's behavior as much as possible.
- Closed-loop controllers trained with reinforcement learning may fail formal safety verification; single-step repair cannot handle dangers that only manifest after multiple steps, and retraining changes the policy globally. The authors study how to repair a controller after verification failure so that it subsequently passes closed-loop safety verification.
- ReachECO alternates forward closed-loop reachability analysis and backward repair search: it generates repair obligations from verification failure regions, searches for safe continuations and accumulates them as constraints, and then jointly solves them with CP-SAT; for DWCs, repairs are compiled into circuit patches that act only on the target policy cells.
- The authors demonstrate repair on ACC, Docking2D, and Car2D. For ACC with Pmax=100 and known L*, verification plus repair is 2±1 s with behavior change 8.2±2% (Table 2); Docking2D seed 3 modifies 3,309 policy cells; Car2D modifies 39 cells and passes verification after 42 s.
- The authors note that deep continuation games for long-horizon problems are computationally expensive, the number of patches may be large, the current tube/post-image computation is relatively coarse and customized to the benchmarks, and the experimental system dimensions are low; extending to high-dimensional dynamics is what the authors call the most important future challenge.
- Evaluated models
- Differentiable Weightless Controller (DWC)
- Benchmarks
- ACCDocking2DCar2D
- Metrics
- certified safetyruntimerepair size (LUT6 / parameters)Change [%]mean |∆|rewardempirical safety
ReachECO is a verification-guided safety repair method for learned controllers that uses information from failures of multi-step reachability analysis to synthesize explicit constraints on controller behavior. For differentiable weight-free controllers, the repair compiles into an exact circuit patch, and controller behavior outside the target policy unit remains unchanged. The paper proves the soundness and termination of the repair, and successfully repairs originally unsafe controllers on three continuous control benchmarks: ACC, Docking2D, and Car2D.
Paper analysis
What problem does this paper attempt to solve?
How to repair a trained controller that fails verification so that it subsequently passes closed-loop safety verification while preserving the original behavior as much as possible.
Core problem: given a trained controller that fails closed-loop safety verification, how to repair it so that it subsequently passes verification.
- Problem setting: The authors note that when RL-trained controllers are used in physical-world systems, optimizing reward alone cannot provide formal safety guarantees; and the consequences of safety violations may only manifest after multiple steps, so temporal reasoning is needed over the closed-loop system composed of the controller and the environment.
- Shortcomings of existing methods: The authors state that local methods start only from single-step constraints or counterexamples and cannot handle the case where "the current state is safe but there is no feasible action at the next step"; trajectory-level methods typically do not look at verifier results and rely on fine-tuning, which the authors state loses termination or progress guarantees.
- Core observation: Static feedforward network repair can turn input regions found by verification into output constraints; the authors transfer this idea to closed-loop settings, but the repair constraints must account for the effect of current modifications on future multi-step behavior.
- Paper's approach: They propose ReachECO, which derives controller repair constraints from failed multi-step closed-loop reachability analysis; for Differentiable Weightless Controllers (DWCs), repairs can be compiled into exact circuit patches that change only the target policy cells.
- Problem setting (non-adversarial): The paper does not posit an attacker; a repair instance consists of an abstracted controller π0, an initial set X0, an unsafe set U, an optional target set XG, a finite repair action alphabet Acont, and a verification budget T, and the goal is to obtain a π′ certified safe according to Definition 1.
What related research exists?
Related work falls into several categories: closed-loop verification, local and trajectory-level repair, static network constraint repair, and shielding and circuit patching.
Closed-loop verification and abstracted controllers
- Xiang & Johnson (2018), Ivanov et al. (2019; 2021), Dutta et al. (2019), Tran et al. (2020), Huang et al. (2022a), Schilling et al. (2022), Lopez et al. (2023), Sidrane et al. (2022), Tian et al. (2024)—closed-loop safety verification of neural networks using over-approximation of reachable sets.
- Jin et al. (2022), Tian et al. (2023; 2024), Yang et al. (2025)—training controllers that are piecewise constant on a finite state partition, so that closed-loop verification avoids over-approximating the neural network; the abstracted controller setting of this paper builds on this line.
- Chang et al. (2019), Zhao et al. (2020), Mandal et al. (2024), Edwards et al. (2024)—certificate-based verification, reducing trajectory-level arguments to single-step certificate queries.
Controller repair
- Yang et al. (2022), Santa Cruz et al. (2022)—local repair based on single-step constraints or counterexamples; the paper states that such methods shift the difficulty of temporal reasoning to additional future safety information.
- Zhou et al. (2020), Hamilton et al. (2022), Lu et al. (2023), Lyu et al. (2023), Lu et al. (2025)—trajectory-level repair; the paper states that these methods typically do not use verifier results and mostly rely on fine-tuning, lacking termination guarantees.
- Teuber et al. (2024)—using control envelopes to reduce the global controller safety problem to a local problem; the paper notes that this requires the envelope to be available.
Static network repair and circuit patching
- Goldberger et al. (2020), Sotoudeh & Thakur (2021), Fu & Li (2022), Tao et al. (2023)—formulating neural network repair as an output constraint satisfaction problem with formal guarantees; the paper states that this paper extends this perspective to multi-step closed-loop settings.
- Lin et al. (1995), Krishnaswamy et al. (2009)—engineering change order (ECO)-style local circuit patching; the patch compilation in this paper draws on this idea, but the constraints are automatically generated by closed-loop reachability verification.
Shielding and baselines
- Bloem et al. (2015), Alshiekh et al. (2018), Bastani (2021), Könighofer et al. (2022), Corsi et al. (2024), Maderbacher et al. (2025)—runtime monitoring and overriding unsafe actions; the authors state that the ReachECO repaired controller is similar to a sparse statically compiled shield, but does not require runtime safety reasoning at deployment.
- Baselines and benchmarks: Experimental baselines include BBReach + Supervised, NCubeV + Supervised, NCubeV + REASSURE, STLGym; benchmarks are ACC, Docking2D, Car2D.
The authors position this paper as: bringing the constraint-based approach from static network repair into closed-loop multi-step settings, and using verification failure information to generate localized, certifiable repairs.
How does the paper address this problem?
ReachECO alternates between forward reachability verification and backward repair search, turning failure information into constraints, then jointly solving and compiling them into local circuit patches.
The overall idea is: ReachECO extracts repair constraints from failed closed-loop reachability analysis, first finds a jointly realizable repair at the abstracted controller level, and then compiles it into an exact circuit patch for the DWC.
Problem setting and formalization
- The paper studies closed-loop systems with continuous state space X ⊆ R^d and dynamics ẋ = f(x, a); the controller is evaluated every ∆ time, and actions are held constant between updates (zero-order hold).
- The controller is a piecewise-constant abstracted controller: the state space is partitioned into a finite number of axis-aligned policy cells Q, and each cell q is assigned an action a ∈ A.
- Certified safety is defined as Reachπ,H(X0) ∩ U = ∅; meaning that, starting from the initial set and within the first H control steps, the over-approximated reachable set does not intersect the unsafe set U.
- A repair instance consists of π0, Post/Tube over-approximation operators, X0, U, an optional target set XG, and a budget T; repair can select a new action from Acont or keep the original action in each policy cell.
Forward verification and backward repair search
- ReachECO maintains the set of reachable boxes X^0,…,X^k under the current controller and a certified losing set L; L can initially contain only U, can later be extended, and is always a subset of the true losing set L*.
- The single-step safety predicate is SafeStep(B,a) ⟺ Tube(B,a) ∩ U = ∅ ∧ Post(B,a) ∩ L = ∅; meaning that the inter-sample trajectory of action a avoids U, and the successor avoids the current losing set.
- When forward verification encounters a box that does not satisfy SafeStep, it collects it as an initial repair obligation F; each obligation is (B, h), meaning that from box B a safe continuation of h steps must be established, with initial h = 1.
- If no safe continuation can be found from a failure box, ReachECO backtracks to the previous time step and increases the required continuation horizon by one; if it still fails after backtracking to the initial time, it returns UNKNOWN.
Constraints, conflicts, and joint solving
- A successful continuation search is stored as a repair constraint γ = (G, i), where G is a finite game DAG, the root node corresponds to the obligation, and child nodes correspond to successor boxes of the safe continuation.
- Constraints arising from different failures may require the same policy cell to take incompatible actions; ReachECO encodes the joint realization problem with CP-SAT, requiring each policy cell to select only one action and satisfy all accumulated constraints.
- JOINT has three outcomes: SAT returns a jointly satisfying controller; BACKTRACK returns conflicting non-anchored constraints as new obligations; UNKNOWN means the conflict involves only anchored constraints and cannot be resolved.
- Anchored constraints (root time step i = 0) are never discarded; the authors state that this guarantees ReachECO returns UNKNOWN only when it fails at the initial time.
ECO patch compilation
- For DWCs, repair acts only on a set of policy cells Qr; the patch selects a correction ∆r based on whether the input falls in a repaired cell and adds it to the controller's integer output.
- Address 0 stores a zero correction, so unrepaired regions keep the original controller unchanged; the authors state that the patch can execute in parallel with the original controller and adds no latency.
- The paper gives theoretical results: Theorem 1 claims soundness, Theorem 2 claims termination, and Theorem 3 and Corollary 2.4 claim completeness relative to the reachability abstraction under the exhaustive search assumption.
Implementation details
- Forward verification uses the authors' implementation of BBReach; boxes within the same policy cell can be merged to improve scalability, and on failure, unmerged candidate parent boxes are lazily replayed to recover exact lineage.
- JOINT's optimization objective is to stay as close as possible to the original policy among feasible solutions; the authors state that optimal repair is generally computationally hard, so the implementation uses a heuristic and accepts a non-optimal feasible solution after a 60 s search timeout.
What experiments did the paper conduct?
The experiments cover three closed-loop benchmarks, ACC, Docking2D, and Car2D, comparing repair success rate, runtime, patch size, and behavior change.
Experimental setup
- Controllers under test: ACC trains 5 DWC seeds; Docking2D trains 3 DWC seeds; Car2D trains 1 DWC. Additionally, the 4-layer ReLU MLP of Teuber et al. (2024) and the tanh controller of Lopez et al. (2025) are used as comparisons.
- Benchmarks: ACC, Docking2D, Car2D; the initial region of Docking2D is larger than the AINNCS competition region, and the reach-avoid property proposed by Mandal et al. (2024) is verified.
- Baselines: BBReach + Supervised, NCubeV + Supervised, NCubeV + REASSURE, STLGym; Docking2D is also compared with a lower-bound estimate of naive patching.
- Metrics: whether certification passes, verification plus repair time, patch size (LUT6 or floating-point parameters), Change [%], mean |∆|, reward, empirical safety rate.
- Review method: no LLM or human review is involved; certification is given by closed-loop reachability verification, and empirical safety is counted from sampled rollouts.
- Samples and repetitions: ACC repair results are reported on 5 training seeds; ACC evaluation is 1,000 rollouts per controller; Docking2D empirical safety is 1,000 rollouts; the Car2D original controller is sampled for 1,000 rollouts.
Main results
Swipe horizontally to read the table
Task Method Condition Certified Time Repair size/change Source ACC ReachECO Pmax=100, L* ✓ 2±1 s 129±24 LUT6; Change 8.2±2% Table 2 ACC BBReach + Supervised Pmax=100, L* ✓ 25±2 s Change 96.9±7.0% Table 2 ACC NCubeV + Supervised† Pmax=100, L* ✓ 1760±1188 s Change 47.77±4.51% Table 2 ACC NCubeV + REASSURE† Pmax=100, L* ? 88 s 2350 parameters; Change 1.2% Table 2 ACC ReachECO (Wbrake) Pmax=100, U ✓ 19±3 s 211±18 LUT6; Change 12.6±3.2% Table 2 ACC STLGym† Pmax=100, U × 47±2 s Change 41.4±7.2% Table 2 Docking2D ReachECO seed 3 initial region ✓ 1.09 h +6.4k LUT6; 3,309 cells Table 3 Car2D ReachECO 1 m × 1 m initial box ✓ 42 s 39 cells Appendix A.2 - The authors state that among methods that can obtain safety certificates, ReachECO is faster and has smaller behavior change than supervised fine-tuning baselines.
- The authors state that the REASSURE-style patch has smaller behavior change, but the paper also notes that its underlying ReLU network was already safer and that the patch cannot be certified with NCubeV.
- The authors state that STLGym fine-tuning is unstable in training across 5 seeds, and none of the resulting controllers achieves 100% empirical safety.
Effect of losing set knowledge on runtime
- What was measured: ACC at Pmax = 30 compares four levels of losing set information: no L extension, online L extension, offline-computed L fixed-point initialization, and the exact braking invariant.
- Results: Runtime decreases from 163±103 s to 29±20 s, 11±5 s, 3±1 s; Wbrake is 5±1 s (Table 1).
- Authors' interpretation: The authors state that stronger safety information reduces repair runtime; Appendix Figure 5 shows that losing-set extension reduces continuation games at depths 3–7, while L* requires only depth-1 games.
Localized repair in Docking2D
- What was measured: certification, reward, empirical safety, and patch size for three DWC seeds on a larger initial region.
- Results: seed 1 modifies 5 policy cells; seed 2 certifies without modification; seed 3 modifies 3,309 policy cells, which the authors state is less than 10^-3 % of the total policy cells (Table 3).
- Authors' interpretation: The authors state that the repair is highly localized in input space; Figure 3 shows that the repair region for seed 3 is mainly concentrated near the docking region.
Restoring certifiability in Car2D
- What was measured: the original controller has no unsafe in 1,000 sampled rollouts, but closed-loop reachability finds a potential safety violation at step 3; ReachECO is then applied.
- Results: ReachECO constructs 1358 depth-1, 88 depth-2, and 7 depth-3 continuation games; after 42 s it returns a repaired controller that modifies 39 policy cells and passes verification (Appendix A.2).
- Authors' interpretation: The authors state that several repaired regions almost never appear in sampled trajectories; these regions may correspond to rare behaviors missed by sampling, or may come from the conservativeness of reachability over-approximation.
Other ablations and analyses
- ACC reward change: the average reward across 5 DWC seeds increases from 2434 to 3861 (Section 3.1).
- ACC empirical safety before and after repair: before repair, Unsafe for the DWC seeds is 12.20%–33.40%, and after repair all are 0.00% (Table 5).
- Docking2D naive patching: the naive approach is estimated to require +87k to +120k LUT6, higher than ReachECO's +0 to +6.4k (Table 3).
- Hardware synthesis: the ACC L* patch is 114±21 logic LUT, Car2D is 64, and Docking2D seed 3 is 5,249 (Table 7).
What are some points that can be further explored?
The authors explicitly mention long-horizon search cost, patch count, over-approximation conservativeness, and high-dimensional scaling; the experiments cover three low-dimensional benchmarks.
Limitations and future directions noted by the authors
- Long-horizon cost: The authors state that ReachECO relies on deep continuation games, and the computational cost may be high on long-horizon problems (Summary and Discussion).
- Patch count: The authors state that even if patches are highly localized in input space, an originally unsafe controller may require many patches (Summary and Discussion).
- Patch compilation structure: The authors state that future work could exploit additional structure in patch compilation (Summary and Discussion).
- Coarse and customized over-approximation: The authors state that the current implementation uses coarser, benchmark-specific post-image and inter-sample tube computations for efficient GPU execution (Summary and Discussion).
- Tighter reachability and more general tubes: The authors state that a tighter GPU reachability procedure could reduce conservativeness, and a more general tube construction could make the method easier to transfer to other dynamical systems (Summary and Discussion).
- High-dimensional scaling: The authors state that the experiments consider relatively low-dimensional systems, and extending verification and additional repair search to higher-dimensional dynamics is the most important future challenge (Summary and Discussion).
Scope of experimental coverage
- The systems under test are three continuous-control benchmarks: ACC, Docking2D, Car2D; ACC has 5 DWC seeds, Docking2D has 3 DWC seeds, and Car2D has 1 DWC.
- Comparison methods include BBReach + Supervised, NCubeV + Supervised, NCubeV + REASSURE, STLGym, and a lower-bound estimate of naive patching for Docking2D.
- All ACC certification runs reach a closed-loop fixed point within T = 200; Docking2D set propagation requires more than 850 time steps to converge to the target region.
- Empirical safety evaluation includes 1,000 rollouts per controller for ACC, 1,000 rollouts for Docking2D, and 1,000 sampled rollouts for Car2D.
- The paper does not report experiments across more dynamical systems or higher-dimensional systems.
Summarize the main content of the paper
ReachECO turns verification failure information into local repair constraints for closed-loop controllers, and demonstrates certifiable repair on three benchmarks.
This paper studies the problem of repairing closed-loop controllers after formal safety verification fails. The authors argue that single-step repair cannot handle dangers that only manifest after multiple steps, while retraining changes the policy globally and loses termination guarantees.
- Method: They propose ReachECO, which alternates forward closed-loop reachability analysis and backward repair search, turns failure regions into repair obligations and constraints, and then jointly solves them with CP-SAT; for DWCs, repairs are compiled into exact circuit patches that act only on the target policy cells.
- Theory: The authors claim to prove soundness, termination, and, under the assumption of exhaustive continuation search, completeness relative to the reachability abstraction.
- ACC: With Pmax=100 and known L*, ReachECO verification plus repair time is 2±1 s, behavior change is 8.2±2%, and the patch is 129±24 LUT6 (Table 2).
- Docking2D: All three DWCs were certified to docking completion; seed 3 modifies 3,309 policy cells, which the authors state is less than 10^-3 % of the total policy cells (Table 3).
- Car2D: The original controller had no unsafe in 1,000 rollouts, but verification found a potential violation at step 3; ReachECO modifies 39 policy cells and passes verification after 42 s (Appendix A.2).
- Authors' conclusion: The authors argue that ReachECO brings the constraint-based perspective of static network repair into closed-loop multi-step settings and can generate highly localized and certifiable repairs; they also note that long-horizon search, patch count, over-approximation conservativeness, and high-dimensional scaling remain future challenges.