Scalable Polyhedral Verification of Recurrent Neural Networks

Wonryong Ryou, Jiayu Chen, Mislav Balunovic, Gagandeep Singh, Andrei Marian Dan, Martin T. Vechev

TL;DR

This paper introduces PROVER, a novel and scalable verifier for Recurrent Neural Networks (RNNs), particularly LSTMs. PROVER tackles the challenge of certifying the robustness of complex, non-linear RNNs by employing precise polyhedral abstractions and an adaptive refinement strategy, enabling the first-ever verification of real-world speech classification systems.

What Problem Does This Paper Address?

Recurrent Neural Networks (RNNs), especially Long Short-Term Memory (LSTM) networks, are powerful tools for processing sequential data and are widely used in critical applications like speech recognition and malware detection. However, these networks are vulnerable to adversarial perturbations, where small, imperceptible changes to input data can lead to drastically incorrect outputs, posing significant security risks. While methods exist for verifying feedforward networks, certifying the robustness of RNNs, with their inherent non-linearities and temporal dependencies, has remained a significant challenge. Existing approaches struggle with scalability and precision, limiting their application to simple models and datasets, and have not yet been applied to real-world use cases like speech classification. This paper aims to bridge this gap by providing a precise and scalable verification framework for RNNs.

Methods

PROVER is built upon two core innovations:

  1. Scalable Polyhedral Abstractions for Non-linearities: The authors develop a novel method to compute precise polyhedral abstractions for the non-convex and non-linear operations within RNNs (specifically LSTMs). This method combines sampling, linear programming (LP), and Fermat's theorem to derive tight bounds for these complex functions. This is a significant improvement over previous methods that either relied on computationally expensive optimizations or less precise interval abstractions.
  2. Abstraction Refinement via Gradient Descent: To further enhance precision, PROVER employs a gradient descent-based algorithm. This algorithm dynamically refines the polyhedral abstractions by learning to combine multiple candidate bounds for each neuron. This adaptive strategy is guided by the specific certification problem, allowing PROVER to achieve higher end-to-end precision than greedy approaches.

The framework also incorporates custom abstractions for the non-linear speech preprocessing pipeline, which is crucial for real-world speech classification tasks.

Datasets

The paper evaluates PROVER on several datasets:

  • FSDD (Free Spoken Digit Dataset): Used for speech classification.
  • GSC v2 (Google Speech Commands Dataset): Another dataset for speech classification, noted for its larger number of labels.
  • MNIST: Used for image classification to compare with prior work (POPQORN).
  • HAPT (Human Activity Recognition Using Smartphones): Used to demonstrate scalability on a large motion sensor sequence classifier.

Key Insights and Ideas

  • The Challenge of RNN Non-linearities: The paper highlights that the non-linear operations in LSTMs (like sigmoid and tanh combinations) are significantly harder to abstract precisely than those in feedforward networks (like ReLU), as they involve transcendental functions that are neither convex nor concave.
  • Polyhedral Abstractions are Crucial for Speech: Replacing polyhedral bounds with simple interval constraints for speech preprocessing drastically reduces verification precision, underscoring the need for relational information.
  • Adaptive Refinement Beats Greedy Approaches: Simply picking the "best" bounds for individual neurons doesn't guarantee the best overall certification. PROVER's learned combination of bounds significantly improves end-to-end precision.
  • First-Ever Certification of Speech Classifiers: This work represents a significant milestone by successfully certifying real-world, non-trivial RNN-based speech classification systems, a feat not achieved by prior methods.

Key Results

  • Improved Precision: PROVER (OPT) consistently outperforms PROVER (LP) and prior methods like POPQORN in terms of certified robustness percentage across various datasets and perturbation levels. For instance, on FSDD, PROVER (OPT) certifies twice as many samples as PROVER (LP) at a significant perturbation level.
  • Scalability: PROVER demonstrates scalability to larger models, including a 4-layer LSTM with 256 hidden units for motion sensor data classification.
  • Efficiency: While the optimized version (OPT) has a higher runtime than the LP-based version (LP) due to the iterative refinement process, both variants are shown to be more scalable than POPQORN. For example, PROVER (LP) is 33.2x more scalable than POPQORN on image classification tasks.
  • Speech Preprocessing Abstractions: The custom polyhedral abstractions for speech preprocessing significantly improve precision compared to using interval constraints.

Limitations and Future Work

  • Runtime of OPT: The optimized version (PROVER OPT) has a higher runtime that increases with perturbation magnitude, as the optimizer requires more iterations to converge.
  • Generalization to Other Architectures: While the paper mentions the methodology can be extended to other RNN architectures like GRUs, the current work focuses on LSTMs.
  • Future Work: The authors suggest that further refinement can be achieved by increasing the number of splits in their sampling procedure. They also note that their method is generic and can be extended to other architectures like transformers and capsule networks. The work also opens avenues for exploring more complex threat models and larger-scale real-world applications.

Summary updated

Abstract

We present a scalable and precise verifier for recurrent neural networks, called Prover based on two novel ideas: (i) a method to compute a set of polyhedral abstractions for the non-convex and non-linear recurrent update functions by combining sampling, optimization, and Fermat’s theorem, and (ii) a gradient descent based algorithm for abstraction refinement guided by the certification problem that combines multiple abstractions for each neuron. Using Prover, we present the first study of certifying a non-trivial use case of recurrent neural networks, namely speech classification. To achieve this, we additionally develop custom abstractions for the non-linear speech preprocessing pipeline. Our evaluation shows that Prover successfully verifies several challenging recurrent models in computer vision, speech, and motion sensor data classification beyond the reach of prior work.
BibTeX
@inproceedings{ryou2021scalable,
  author = {Wonryong Ryou and Jiayu Chen and Mislav Balunovic and Gagandeep Singh and Andrei Marian Dan and Martin T. Vechev},
  title = {{Scalable Polyhedral Verification of Recurrent Neural Networks}},
  booktitle = {CAV},
  year = {2021},
  doi = {10.1007/978-3-030-81685-8\_10},
}
Figure