论文标题
从自然语言的复发神经网络中提取加权有限自动机
Extracting Weighted Finite Automata from Recurrent Neural Networks for Natural Languages
论文作者
论文摘要
复发性神经网络(RNN)在顺序数据处理中取得了巨大的成功。但是,直接解释和验证RNN的行为非常具有挑战性。为此,已经做出了许多努力,从RNN中提取有限的自动机。现有的方法(例如精确学习)有效地提取有限状态模型来表征正式语言的RNN状态动态,但在处理自然语言的可扩展性方面受到限制。可分配的自然语言的组成方法的提取精度不足。在本文中,我们确定了对提取精度的严重影响的过渡稀疏问题。为了解决这个问题,我们提出了一种过渡规则提取方法,该方法可扩展到自然语言处理模型,并有效提高提取精度。具体而言,我们提出了一种经验方法,以补充过渡图中缺少的规则。此外,我们进一步调整了过渡矩阵,以增强提取的加权有限自动机(WFA)的上下文感知能力。最后,我们提出了两种数据增强策略,以跟踪目标RNN的动态行为。两个流行的自然语言数据集的实验表明,我们的方法可以从RNN中提取自然语言处理的WFA,其精度比现有方法更好。我们的代码可在https://github.com/weizeming/extract_wfa_from_rnn_for_nl上找到。
Recurrent Neural Networks (RNNs) have achieved tremendous success in sequential data processing. However, it is quite challenging to interpret and verify RNNs' behaviors directly. To this end, many efforts have been made to extract finite automata from RNNs. Existing approaches such as exact learning are effective in extracting finite-state models to characterize the state dynamics of RNNs for formal languages, but are limited in the scalability to process natural languages. Compositional approaches that are scablable to natural languages fall short in extraction precision. In this paper, we identify the transition sparsity problem that heavily impacts the extraction precision. To address this problem, we propose a transition rule extraction approach, which is scalable to natural language processing models and effective in improving extraction precision. Specifically, we propose an empirical method to complement the missing rules in the transition diagram. In addition, we further adjust the transition matrices to enhance the context-aware ability of the extracted weighted finite automaton (WFA). Finally, we propose two data augmentation tactics to track more dynamic behaviors of the target RNN. Experiments on two popular natural language datasets show that our method can extract WFA from RNN for natural language processing with better precision than existing approaches. Our code is available at https://github.com/weizeming/Extract_WFA_from_RNN_for_NL.