mlsanityData to 7 Oct 2026

Synthesizing Context-free Grammars from Recurrent Neural Networks (Extended Version)

arXiv 2101.08200 ↗First posted 20 Jan 2021cs.FL cs.LGcited by 2

Not on the map. Why?

Abstract (arXiv)

We present an algorithm for extracting a subclass of the context free grammars (CFGs) from a trained recurrent neural network (RNN). We develop a new framework, pattern rule sets (PRSs), which describe sequences of deterministic finite automata (DFAs) that approximate a non-regular language. We present an algorithm for recovering the PRS behind a sequence of such automata, and apply it to the sequences of automata extracted from trained RNNs using the L* algorithm. We then show how the PRS may converted into a CFG, enabling a familiar and useful presentation of the learned language. Extracting the learned language of an RNN is important to facilitate understanding of the RNN and to verify its correctness. Furthermore, the extracted CFG can augment the RNN in classifying correct sentences, as the RNN's predictive accuracy decreases when the recursion depth and distance between matching delimiters of its input sequences increases.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 9 of its 33 references that are in the map. First posted on arXiv 20 Jan 2021.

Builds on

9 of 33 references.

References · 9

  1. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  2. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
  3. 2017Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamplescited by 66
  4. 2020RNNs can generate bounded hierarchical languages with optimal memorycited by 59
  5. 2019On the Computational Power of RNNscited by 35
  6. 2016Rule Extraction Algorithm for Deep Neural Networks: A Reviewcited by 22
  7. 2018Evaluating the Ability of LSTMs to Learn Context-Free Grammarscited by 16
  8. 2018Explaining Black Boxes on Sequential Data using Weighted Automatacited by 11
  9. 2019Connecting First and Second Order Recurrent Networks with Deterministic Finite Automatacited by 1

Built on by

Cited by year

Citing papers per year: 2021: 1; 2022: 1.

2 papers.