[Paper Review] Distance and Equivalence between Finite State Machines and Recurrent Neural Networks: Computational results
This paper investigates the computational complexity of approximating recurrent neural network language models (RNN-LMs) with finite state machines (FSMs), proving that equivalence and distance computation between weighted FSMs (PFA/WFA) and general RNN-LMs with ReLU activation are undecidable. For consistent RNN-LMs, Tchebychev distance approximation is decidable, but NP-hard in finite support, with implications for LSTMs, GRUs, and finite-precision RNNs.
The need of interpreting Deep Learning (DL) models has led, during the past years, to a proliferation of works concerned by this issue. Among strategies which aim at shedding some light on how information is represented internally in DL models, one consists in extracting symbolic rule-based machines from connectionist models that are supposed to approximate well their behaviour. In order to better understand how reasonable these approximation strategies are, we need to know the computational complexity of measuring the quality of approximation. In this article, we will prove some computational results related to the problem of extracting Finite State Machine (FSM) based models from trained RNN Language models. More precisely, we'll show the following: (a) For general weighted RNN-LMs with a single hidden layer and a ReLu activation: - The equivalence problem of a PDFA/PFA/WFA and a weighted first-order RNN-LM is undecidable; - As a corollary, the distance problem between languages generated by PDFA/PFA/WFA and that of a weighted RNN-LM is not recursive; -The intersection between a DFA and the cut language of a weighted RNN-LM is undecidable; - The equivalence of a PDFA/PFA/WFA and weighted RNN-LM in a finite support is EXP-Hard; (b) For consistent weight RNN-LMs with any computable activation function: - The Tcheybechev distance approximation is decidable; - The Tcheybechev distance approximation in a finite support is NP-Hard. Moreover, our reduction technique from 3-SAT makes this latter fact easily generalizable to other RNN architectures (e.g. LSTMs/RNNs), and RNNs with finite precision.
Motivation & Objective
- To analyze the computational complexity of approximating trained RNN language models with finite state machines (FSMs), particularly in terms of equivalence and distance metrics.
- To assess the feasibility of post-hoc extraction of symbolic, interpretable FSMs from trained RNNs, a key challenge in interpretable AI.
- To determine whether distance and equivalence problems between probabilistic/weighted finite automata (PFA/WFA) and RNN-LMs are decidable or computationally intractable.
- To extend results on RNN interpretability to broader architectures, including LSTMs, GRUs, and finite-precision RNNs.
- To provide theoretical foundations for evaluating the quality of symbolic approximations of RNNs, crucial for safety-critical applications.
Proposed method
- Reduction from the 3-SAT satisfiability problem to prove undecidability of equivalence and distance computation between PFA/WFA and general RNN-LMs with ReLU activation.
- Construction of a memoryless, first-order RNN with a single hidden layer and ReLU activation to simulate a PFA’s behavior on input strings.
- Use of a cut-point language construction where the RNN’s output is thresholded to define a language, enabling comparison with DFA and PFA languages.
- Definition of the Tchebychev (L∞) distance between RNN and PFA output distributions over finite-length strings to measure approximation quality.
- Proof of NP-hardness for Tchebychev distance approximation in finite support via a reduction from 3-SAT, using rational parameters and bounded precision.
- Generalization of the NP-hardness result to LSTMs, GRUs, and finite-precision RNNs by showing the core construction relies only on output bias and does not depend on internal recurrent dynamics.
Experimental results
Research questions
- RQ1Is the equivalence problem between a probabilistic/weighted finite automaton (PFA/WFA) and a general weighted first-order RNN-LM with ReLU activation decidable?
- RQ2Can the distance between the languages generated by a PFA/WFA and a weighted RNN-LM be computed, and is it recursive?
- RQ3Is the intersection between a deterministic finite automaton (DFA) and the cut-point language of a weighted RNN-LM decidable?
- RQ4Is the equivalence between a PFA/WFA and a weighted RNN-LM decidable when restricted to a finite support of input strings?
- RQ5Is the Tchebychev distance approximation between a consistent RNN-LM and a PFA decidable, and what is its computational complexity in finite support?
Key findings
- The equivalence problem between a PFA/WFA and a general weighted first-order RNN-LM with ReLU activation is undecidable.
- As a corollary, the distance between the languages generated by a PFA/WFA and a weighted RNN-LM is not recursive.
- The intersection between a DFA and the cut-point language of a weighted RNN-LM is undecidable.
- Equivalence between a PFA/WFA and a weighted RNN-LM in a finite support is EXP-Hard.
- For consistent RNN-LMs with any computable activation function, the Tchebychev distance approximation is decidable.
- The Tchebychev distance approximation between consistent RNN-LMs and PFAs in finite support is NP-Hard, and this result generalizes to LSTMs, GRUs, and finite-precision RNNs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.