Source-linked AI summary

An Inductive Synthesis Framework for Verifiable Reinforcement Learning

He Zhu, Zikang Xiong, Stephen Magill, Suresh Jagannathan

arXiv:1907.07273v1cs.LGcs.AIstat.ML

TL;DR

Neural-network complexity and neglected deployment conditions make strong safety verification difficult. The paper synthesizes verified deterministic programs that shield neural policies, and reports low runtime-assurance overhead across cyber-physical applications.

  • Problem

    Neural-network complexity and omission of deployment-environment effects make strong safety claims difficult, while infinite-horizon verification remains challenging.

    Source: §1 · p. 1, §2.2 · p. 3, §3 · p. 6
  • Method

    Counterexample-guided synthesis uses a neural policy as an oracle to produce a deterministic program and inductive invariant that shield unsafe proposed actions.

    Source: §1 · pp. 1–2, §7 · p. 14
  • Results

    Runtime assurance overhead is typically on the order of a few percent across a wide range of cyber-physical control systems.

    Source: §1 · p. 2
  • Takeaways & Limitations

    The synthesized program can protect a neural policy by correcting actions only when they could violate the inductive invariant.

    Source: §7 · p. 14

    The sound verification algorithm may not terminate because its radius can shrink arbitrarily and potential counterexamples are unrestricted in size.

    Source: §4.2 · p. 9

Abstract

from arXiv · show

Despite the tremendous advances that have been made in the last decade on developing useful machine-learning applications, their wider adoption has been hindered by the lack of strong assurance guarantees that can be made about their behavior. In this paper, we consider how formal verification techniques developed for traditional software systems can be repurposed for verification of reinforcement learning-enabled ones, a particularly important class of machine learning systems. Rather than enforcing safety by examining and altering the structure of a complex neural network implementation, our technique uses blackbox methods to synthesizes deterministic programs, simpler, more interpretable, approximations of the network that can nonetheless guarantee desired safety properties are preserved, even when the network is deployed in unanticipated or previously unobserved environments. Our methodology frames the problem of neural network verification in terms of a counterexample and syntax-guided inductive synthesis procedure over these programs. The synthesis procedure searches for both a deterministic program and an inductive invariant over an infinite state transition system that represents a specification of an application's control logic. Additional specifications defining environment-based constraints can also be provided to further refine the search space. Synthesized programs deployed in conjunction with a neural network implementation dynamically enforce safety conditions by monitoring and preventing potentially unsafe actions proposed by neural policies. Experimental results over a wide range of cyber-physical applications demonstrate that software-inspired formal verification techniques can be used to realize trustworthy reinforcement learning systems with low overhead.

1 Introduction

The introduction identifies an open verification problem: neural-network complexity and omitted deployment-environment effects weaken safety claims. It presents synthesis of verified deterministic programs as a safety shield for neural policies, with runtime assurance overhead typically only a few percent.

1 Introduction

  • Neural-network complexity makes direct verification difficult, while common safety analyses omit deployment-environment effects, leaving effective verification an open problem.Source: §1 · p. 1
  • The toolchain uses counterexample-guided inductive synthesis to find a simpler deterministic program that approximates a neural policy while satisfying safety constraints.The search is bounded by the control-system specification and deployment-context environment conditions.Source: §1 · pp. 1–2
  • A verified program serves as a runtime shield, overriding neural actions that could lead to unsafe states while preserving the neural policy's performance.Verification uses an inductive invariant over the specified infinite-state transition system.Source: §1 · pp. 1–2
  • Runtime assurance costs are typically only a few percent compared with running an unproven network without shield support.The paper reports experimental study across a wide range of cyber-physical control systems.Source: §1 · p. 2

2 Motivation and Overview

The section uses an inverted pendulum to frame synthesis of a deterministic, oracle-guided program whose safety can be formally verified and used to shield a neural policy. The approach also supports a new shield when deployment constraints change.

2 Motivation and Overview

  • The inverted pendulum illustrates a practical control system for which high assurance is desirable despite verification difficulty.The paper names Segway transporters and autonomous drones as representative systems.Source: §2 · p. 2

2.1 State Transition System

  • The model uses angle and angular velocity as state, discrete-time transitions under continuous actions, and unsafe states to represent falling.The environment context can add constraints beyond the transition system, such as bounds on pendulum motion.Source: §2.1 · pp. 2–3

2.2 Synthesis, Verification and Shielding

  • Synthesis seeks a deterministic program that remains close to its neural oracle while satisfying the environment’s logical safety property.The feasible program space is restricted to programs whose safety can be formally verified.Source: §2.2 · p. 3
  • The search runs candidate programs in the environment, collects trajectories, and optimizes their proximity to oracle actions while favoring safety.The procedure samples program parameters iteratively.Source: §2.2 · p. 4
  • Verification seeks an inductive invariant containing initial states, excluding unsafe states, and preserved by transitions; counterexamples guide resynthesis when verification fails.For the pendulum example, the discovered invariant separates reachable states from unsafe states.Source: §2.2 · p. 4
  • At runtime, the shield lets the neural policy act within the verified boundary and substitutes the deterministic program’s safe action when a proposed transition leaves it.For changed environment constraints, the framework can synthesize and verify a new program and shield without retraining the original network from scratch.Source: §2.2 · pp. 4–5
  • 41 unsafe-region entries were prevented, with only 414 of 5,000,000 neural decisions overridden (0.00828%) in the restricted pendulum environment.The evaluation covered 1,000 trajectories of 5,000 simulation steps each.Source: §2.2 · p. 5

3 Problem Setup

The setup models a controller within an infinite-state environment, where continuous dynamics and policy actions determine possible transitions. It frames learning around finite-rollout reward estimates while safety concerns whether trajectories can reach unsafe states over an infinite horizon.

3 Problem Setup

  • The environment context C models real-valued state variables, continuous actions, initial and unsafe states, policy-dependent transitions, system dynamics, and reward.External disturbances are modeled as bounded nondeterministic values, with bounds assumed estimable at runtime using multivariate normal fitting.Source: §3 · pp. 5–6
  • A neural control policy maps an environment state to an action, which changes the rate of change of state variables.The transition relation is parameterized by the deployed policy and represents all allowed state-to-state transitions.Source: §3 · p. 6
  • The discrete-time model assumes a fixed time step and a constant action during each interval, and uses Euler’s method to approximate continuous dynamics.Higher-order methods such as Runge-Kutta can compensate when Euler’s method poorly approximates highly nonlinear dynamics.Source: §3 · p. 6
  • Reinforcement learning seeks to maximize expected cumulative reward estimated from finite-length simulations of the transition system.The reward is collected along trajectories of the policy in the environment context.Source: §3 · p. 6
  • Safety verification asks whether any trajectory from an initial state reaches an unsafe state, unlike reinforcement learning’s finite-length rollouts.The paper identifies the complexity of verifying a neural policy’s long-term safety within a nontrivial environment as a challenge.Source: §3 · p. 6

4 Verification Procedure

The procedure synthesizes a deterministic program that resembles a neural policy while satisfying safety requirements in an environment model, then uses an inductive invariant to verify safety. Counterexamples guide synthesis, and the verified program and invariant can shield the neural policy at runtime.

4.1 Synthesis

  • Program sketches define deterministic policies, and synthesis searches for parameters that keep the policy close to the neural oracle while penalizing unsafe states.The search estimates this objective on sampled trajectories encountered in the environment.Source: §4.1 · pp. 6–7

4.2 Verification

  • Verification seeks an inductive invariant that contains initial states, is preserved by transitions, and excludes unsafe states; polynomial barrier certificates are one supported form.The invariant is inferred over the synthesized program’s environment transition system.Source: §4.2 · pp. 7–8
  • When verification cannot establish safety, CEGIS uses uncovered initial states as counterexamples to synthesize additional policies and invariants until the initial-state space is covered.If a candidate fails, the procedure can shrink the initial-state region considered for synthesis; the algorithm is sound but may not terminate.Source: §4.2 · pp. 8–9
  • Theorem 4.2 establishes that the conditional program built from verified policy–invariant pairs is safe because their combined invariant makes unsafe states unreachable.The CEGIS output covers the initial state space with these pairs.Source: §4.2 · p. 9
  • In the Duffing-oscillator example, two individually insufficient policies together cover the initial states and form a verified safe program.The combined invariant is φ1 ∨ φ2.Source: §4.2 · p. 9

4.3 Shielding

  • At runtime, the shield predicts the next state and intervenes with the verified program when the neural policy would leave the invariant’s safety boundary.The intervention is intended to occur only when necessary.Source: §4.3 · pp. 9–10

5 Experimental Results

Experiments across cyber-physical benchmarks found that synthesized programs and invariants can shield neural controllers while retaining their performance. Results also show tradeoffs in intervention rates, invariant degree, and adapting shields to changed environments.

5 Experimental Results

  • The authors also extended the approach to synthesize deterministic programs that guarantee stability in supplementary material.Source: §5 · p. 10
  • In the inverted-pendulum case, the neural controller made 60 unsafe decisions, all prevented by the synthesized program in 65 interventions over 1000 runs.Source: §5 · p. 10
  • Direct reinforcement-learning or random-search training failed to find a safe linear pendulum controller under the added action constraint, while neural-oracle-guided synthesis found one.Source: §5 · p. 10
  • Across benchmarks, shielded neural policies retained performance while maintaining safety; programmatic policies were less performant, sometimes by a factor of two or more.The table reports experimental results on program synthesis, verification, and shielding.Source: Table 1 · p. 11, §5 · p. 12
  • The first five benchmarks had no observed safety violations or performance-affecting interventions, while violations in Quadcopter, Pendulum, and Cartpole were eliminated by shielding.Source: §5 · p. 11
  • Oscillator required many interventions because its neural controller repeatedly approached the safety boundary; 74% of interventions prevented unsafe decisions, with the shield trading performance for safety.Source: §5 · pp. 11–12
  • Higher-degree invariants generally reduce interventions but increase synthesis and verification time and overhead; a degree-8 Self-Driving shield incurred 26.85% overhead.Source: §5 · p. 12, Table 2 · p. 12
  • After environment changes, shields were synthesized faster than retraining; the Cartpole shield took 239 seconds, and the adapted Pendulum shield took 581 seconds.For Cartpole, the changed environment increased pole length by 0.15 meters; the Pendulum mass increased by 0.3 kg.Source: §5 · pp. 12–13, Table 3 · p. 13

6 Related Work

Related approaches verify neural-network internals, learn safe policies, synthesize interpretable models, or shield controllers. The paper distinguishes its blackbox synthesis and invariant-based shielding for continuous, infinite-state systems from these approaches.

6 Related Work

  • Unlike whitebox verification and testing that reason over network architecture and may ignore deployment environments, this framework learns a simpler program from the network as an oracle and verifies safety through shielding.Source: §6 · p. 13
  • The framework can be incorporated into existing reinforcement-learning methods and can synthesize new shields for legacy models after reasonable environment changes without retraining.Source: §6 · p. 13
  • Unlike interpretable-model approaches that verify generated outputs afterward, this method uses CEGIS to synthesize only safe programs and infer invariants that support guarantees for the original neural network.Source: §6 · p. 13
  • The approach can synthesize conditional families of linear controllers, whereas a single linear controller was insufficient for safety in the authors’ benchmark experience.Source: §6 · p. 14
  • Unlike finite-state shielding and reachability methods limited to about five dimensions, the framework learns symbolic shields for infinite-state systems and focuses on states a learned controller attempts to explore.Source: §6 · p. 14

7 Conclusions

The toolchain verifies neural-network control policies in an infinite-state transition system by synthesizing a deterministic policy program and using it with an inductive invariant to shield the neural policy.

  • The toolchain verifies neural-network control policies within an environment formalized as an infinite-state transition system.Source: §7 · p. 14
  • A counterexample-guided synthesis loop searches from a user-given sketch resembling a neural policy oracle for a deterministic program satisfying the safety specification.Source: §7 · p. 14
  • At runtime, the deterministic program and learned inductive invariant shield the neural policy, correcting its action only when it can violate the invariant.Source: §7 · p. 14
  • Experimental results indicate the approach can realize trustworthy reinforcement-learning systems with low overhead.Source: §7 · p. 14
Loading 1907.07273v1…