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

01/20/2021
by   Daniel M. Yellin, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/28/2022

Extracting Finite Automata from RNNs Using State Merging

One way to interpret the behavior of a blackbox recurrent neural network...
research
01/16/2018

A Comparison of Rule Extraction for Different Recurrent Neural Network Models and Grammatical Complexity

It has been shown that rules can be extracted from highly non-linear, re...
research
02/27/2019

Representing Formal Languages: A Comparison Between Finite Automata and Recurrent Neural Networks

We investigate the internal representations that a recurrent neural netw...
research
10/30/2019

Learning Deterministic Weighted Automata with Queries and Counterexamples

We present an algorithm for extraction of a probabilistic deterministic ...
research
05/23/2016

Generative Choreography using Deep Learning

Recent advances in deep learning have enabled the extraction of high-lev...
research
09/22/2020

Property-Directed Verification of Recurrent Neural Networks

This paper presents a property-directed approach to verifying recurrent ...
research
09/28/2020

Distillation of Weighted Automata from Recurrent Neural Networks using a Spectral Approach

This paper is an attempt to bridge the gap between deep learning and gra...

Please sign up or login with your details

Forgot password? Click here to reset