How to Learn a Model Checker

Dung T. Phan, Radu Grosu, Nicola Paoletti, Scott A. Smolka, Scott D. StollerarXiv 2017

Introduction

Formal verification is the gold standard for ensuring safety in critical systems, such as robotics or medical devices. However, hybrid systems—which integrate continuous physical dynamics with discrete software logic—present significant computational challenges. Traditional model checking (MC) often fails to scale for real-time monitoring. This paper proposes Neural Model Checking (NMC), an approach that trains neural networks to serve as approximate model checkers (AMC), providing constant-time, highly accurate reachability analysis.

Methodology

The NMC framework treats reachability as a binary classification problem: predicting whether a system starting at state $s$ will enter an unsafe region within a time bound $T$.

The pipeline consists of four primary stages:

  1. Sampling & Simulation: Trajectories are generated from a system model or black-box simulator. Adaptive sampling is employed to ensure sufficient representation of rare "unsafe" states.
  2. Training: Feedforward neural networks are trained to classify states. Deep architectures are compared against shallow models and traditional ML techniques like SVMs.
  3. Statistical Certification: To address the "black-box" nature of NNs, Wald’s Sequential Probability Ratio Test (SPRT) provides a posteriori statistical guarantees on performance.
  4. Tuning for Safety: Since False Negatives (FNs) are catastrophic in safety-critical contexts, the model is tuned via adaptation (retraining on counterexamples) and threshold selection.

Tuning for Safety

In verification, a False Negative—predicting safety for an unsafe state—is far more costly than a False Positive. By adjusting the classification threshold, the model can be made more conservative.

Threshold selection trade-off between False Negatives (FN) and False Positives (FP).

As shown in the threshold selection analysis, moving the decision boundary allows for a significant reduction in FNs at the cost of a slight increase in FPs, prioritizing safety over raw precision.

Experimental Evaluation

The methodology was tested on three hybrid system benchmarks:

  • Inverted Pendulum: A classic non-linear control problem.
  • Spiking Neuron: A hybrid system with discrete jumps, representing biological neuron firing.
  • Quadcopter Controller: A complex 7-variable model with non-linear climbing and descending modes.

Results and Discussion

The best-performing models, particularly deep NNs and ensembles, achieved accuracies between 99.82% and 100%. Crucially, the FN rate was reduced to near-zero (0.0007 to 0) through targeted tuning.

Key insights include:

  • Constant-Time Performance: Once trained, NMC inference takes approximately 1ms, enabling real-time online safety monitoring.
  • Boundary Sensitivity: Errors are concentrated at the decision boundary between safe and unsafe regions. Adaptation effectively "pushes" this boundary to ensure a conservative safety margin.
  • Scalability: Deep learning models consistently outperformed shallow architectures and SVMs as system complexity increased.

Conclusion

NMC flips the traditional script by using machine learning to perform formal verification rather than the other way around. While currently limited to deterministic dynamics, future work aims to extend this to stochastic systems and more complex verification properties.

Summary updated

BibTeX
@misc{phan2017how,
  author = {Dung T. Phan and Radu Grosu and Nicola Paoletti and Scott A. Smolka and Scott D. Stoller},
  title = {{How to Learn a Model Checker}},
  year = {2017},
  eprint = {1712.01935},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.01935},
}
Figure