Skip to main content
QUICK REVIEW

[Paper Review] Verification of Recurrent Neural Networks Through Rule Extraction

Qinglong Wang, Kaixuan Zhang|arXiv (Cornell University)|Nov 14, 2018
Adversarial Robustness in Machine LearningComputer Science23 references13 citations
TL;DR

This paper proposes a verification framework for recurrent neural networks (RNNs) using deterministic finite automata (DFA) extracted from RNNs as surrogate oracles to detect adversarial perturbations in sequential data. It introduces average edit distance as a metric to measure perturbation scale and demonstrates that second-order RNNs with quadratic hidden interactions yield the most stable and accurate DFA extraction, enabling effective verification on Tomita grammars, where only a few models (e.g., MI-RNN, second-order RNN) remain robust against adversarial samples.

ABSTRACT

The verification problem for neural networks is verifying whether a neural network will suffer from adversarial samples, or approximating the maximal allowed scale of adversarial perturbation that can be endured. While most prior work contributes to verifying feed-forward networks, little has been explored for verifying recurrent networks. This is due to the existence of a more rigorous constraint on the perturbation space for sequential data, and the lack of a proper metric for measuring the perturbation. In this work, we address these challenges by proposing a metric which measures the distance between strings, and use deterministic finite automata (DFA) to represent a rigorous oracle which examines if the generated adversarial samples violate certain constraints on a perturbation. More specifically, we empirically show that certain recurrent networks allow relatively stable DFA extraction. As such, DFAs extracted from these recurrent networks can serve as a surrogate oracle for when the ground truth DFA is unknown. We apply our verification mechanism to several widely used recurrent networks on a set of the Tomita grammars. The results demonstrate that only a few models remain robust against adversarial samples. In addition, we show that for grammars with different levels of complexity, there is also a difference in the difficulty of robust learning of these grammars.

Motivation & Objective

  • To address the lack of verification methods for recurrent neural networks (RNNs) in sequential data applications, where traditional metrics and oracles fail.
  • To develop a rigorous, automated verification framework for RNNs using extracted DFAs as surrogate oracles when ground-truth DFAs are unknown.
  • To define a suitable distance metric for adversarial perturbations in string-based sequential data, overcoming limitations of standard Lp norms.
  • To empirically evaluate the robustness of various RNN architectures against adversarial samples using the proposed framework on regular grammars.
  • To investigate the relationship between grammar complexity and the difficulty of robust learning in RNNs.

Proposed method

  • Extract deterministic finite automata (DFA) from trained RNNs to serve as formal, interpretable surrogates for the RNN's decision logic.
  • Propose average edit distance as a novel metric to measure the scale of adversarial perturbations applied to strings generated by regular grammars.
  • Use the extracted DFA as a formal oracle to validate whether perturbed strings remain within the language of the original grammar.
  • Formulate the verification problem as a constrained optimization task, leveraging MILP or SMT solvers to check robustness under perturbation.
  • Apply the framework to the Tomita grammars, a benchmark set of regular languages, to evaluate adversarial robustness across multiple RNN architectures.
  • Conduct 30 trials per string length to compute average adversarial robustness scores (γ̄₊, γ̄₋) for positive and negative strings, respectively.

Experimental results

Research questions

  • RQ1Can extracted DFAs from RNNs serve as reliable surrogates for ground-truth oracles in verifying adversarial robustness?
  • RQ2How does the choice of RNN architecture affect the stability and accuracy of DFA extraction for sequential data verification?
  • RQ3To what extent do different grammars (in terms of complexity) influence the robustness of RNNs to adversarial perturbations?
  • RQ4Can average edit distance effectively measure and constrain adversarial perturbations in string-based data while preserving linguistic validity?
  • RQ5Which RNN architectures generalize best to long sequences without succumbing to adversarial attacks?

Key findings

  • Second-order RNNs with quadratic or approximate quadratic hidden layer interactions consistently produced the most accurate and stable DFA extractions across all Tomita grammars.
  • Only second-order RNN and MI-RNN achieved perfect adversarial robustness (γ̄₊ = 1.00) on all tested grammars, with no adversarial samples identified.
  • Elman-RNN showed the lowest adversarial accuracy, particularly on grammar 3, and its performance degraded significantly with increasing string length, indicating poor generalization to long sequences.
  • Grammar 7, despite having the lowest complexity, exhibited high vulnerability to adversarial samples due to class imbalance in the training data, suggesting overfitting.
  • Grammar 4 showed better robust learning than grammar 3, even though they are similarly complex, indicating that grammar structure influences robustness beyond mere complexity.
  • The average edit distance metric effectively captured perturbation scale and correlated with the difficulty of robust learning, enabling meaningful comparison across RNNs and grammars.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.