Skip to main content
QUICK REVIEW

[Paper Review] A Comparative Study of Rule Extraction for Recurrent Neural Networks

Qinglong Wang, Kaixuan Zhang|arXiv (Cornell University)|Jan 16, 2018
Machine Learning and AlgorithmsComputer Science35 references12 citations
TL;DR

This paper compares rule extraction via deterministic finite automata (DFA) from five recurrent neural network architectures—Elman-RNN, second-order RNN, MI-RNN, LSTM, and GRU—on seven Tomita grammars of varying complexity. It finds that second-order RNN consistently outperforms others in DFA extraction accuracy and stability, especially on complex grammars, while simpler models like Elman-RNN struggle with success rates below 10% on certain tasks.

ABSTRACT

Understanding recurrent networks through rule extraction has a long history. This has taken on new interests due to the need for interpreting or verifying neural networks. One basic form for representing stateful rules is deterministic finite automata (DFA). Previous research shows that extracting DFAs from trained second-order recurrent networks is not only possible but also relatively stable. Recently, several new types of recurrent networks with more complicated architectures have been introduced. These handle challenging learning tasks usually involving sequential data. However, it remains an open problem whether DFAs can be adequately extracted from these models. Specifically, it is not clear how DFA extraction will be affected when applied to different recurrent networks trained on data sets with different levels of complexity. Here, we investigate DFA extraction on several widely adopted recurrent networks that are trained to learn a set of seven regular Tomita grammars. We first formally analyze the complexity of Tomita grammars and categorize these grammars according to that complexity. Then we empirically evaluate different recurrent networks for their performance of DFA extraction on all Tomita grammars. Our experiments show that for most recurrent networks, their extraction performance decreases as the complexity of the underlying grammar increases. On grammars of lower complexity, most recurrent networks obtain desirable extraction performance. As for grammars with the highest level of complexity, while several complicated models fail with only certain recurrent networks having satisfactory extraction performance.

Motivation & Objective

  • To investigate whether symbolic rule extraction via deterministic finite automata (DFA) is feasible and effective across diverse recurrent neural network architectures.
  • To analyze how the complexity of underlying regular grammars affects DFA extraction performance in RNNs.
  • To evaluate and compare the success rate and quality of extracted DFAs across multiple RNN models on a standardized benchmark set.
  • To identify architectural and training factors that enhance or hinder symbolic knowledge extraction from RNNs.

Proposed method

  • Formally categorize the seven Tomita grammars using two complexity metrics: entropy and average edit distance.
  • Train five recurrent network architectures—Elman-RNN, second-order RNN, MI-RNN, LSTM, and GRU—on each Tomita grammar to learn the language.
  • Apply a generic compositional DFA extraction method that partitions the RNN’s hidden state space into finite states and infers transition rules based on input symbols.
  • Evaluate extraction performance using two metrics: (1) the quality of the extracted DFA (e.g., correctness and completeness), and (2) the success rate of recovering the unique target DFA.
  • Perform multiple random trials per model-grammar pair to ensure statistical reliability of results.
  • Use the extracted DFAs to compare model behavior and assess the stability and accuracy of symbolic rule extraction across architectures.

Experimental results

Research questions

  • RQ1How does the complexity of a regular grammar influence the success rate of DFA extraction from trained recurrent networks?
  • RQ2Which recurrent network architecture yields the most accurate and stable DFA extraction across different grammars?
  • RQ3To what extent do architectural components such as second-order interactions or gated mechanisms affect symbolic rule extraction?
  • RQ4Are there specific grammars where certain RNNs fail to extract correct DFAs, and if so, why?
  • RQ5How does the choice of activation function (e.g., tanh vs. ReLU) impact DFA extraction performance?

Key findings

  • On low-complexity Tomita grammars (e.g., grammar 1), all models achieve high success rates, with second-order RNN and MI-RNN showing particularly strong performance.
  • For grammars of medium complexity, most models achieve success rates below 50%, with second-order RNN maintaining significantly higher accuracy than others.
  • On the most complex grammars (grammars 5 and 6), only second-order RNN and MI-RNN successfully extract correct DFAs, while all other models fail.
  • Elman-RNN with tanh activation achieves high DFA quality (near 100% accuracy) on grammar 2 but only a 10% success rate, indicating a disconnect between DFA quality and correct structural recovery.
  • Second-order RNN demonstrates the most stable and consistent DFA extraction performance across all grammars, outperforming even LSTM and GRU on complex tasks.
  • The results suggest that quadratic interaction mechanisms (as in second-order RNN and MI-RNN) are more conducive to generating spatially separable hidden states suitable for DFA extraction.

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.