论文标题

使用有限状态自动机层学习图形结构

Learning Graph Structure With A Finite-State Automaton Layer

论文作者

Johnson, Daniel D., Larochelle, Hugo, Tarlow, Daniel

论文摘要

基于图形的神经网络模型在许多域中产生强大的结果,部分是因为图为图中节点之间的关系结构(边缘)的形式编码域知识提供了灵活性。在实践中,边缘既用于表示内在结构(例如,程序的抽象语法树)和更抽象的关系,这些关系有助于推理下游任务(例如,相关程序分析的结果)。在这项工作中,我们研究了学习从固有图结构中得出抽象关系的问题。由于其在程序分析中的力量,我们考虑了有限状态自动机接受的基本图上的路径所定义的关系。我们通过将问题放松到基于图的POMDP上学习有限状态自动机政策,然后使用隐式差异来训练这些政策,从而端对端学习这些关系。结果是一个可区分的图形有限状态自动机(GFSA)层,该图层添加了一种新的边缘类型(以加权邻接矩阵表示)。我们证明,该层可以在网格世界图中找到快捷方式,并在Python程序上重现简单的静态分析。此外,我们将GFSA层与可变滥用程序理解任务的较大基于图的模型端到端的较大模型结合在一起,并发现与使用手工设计的语义边缘或其他基线方法相比,使用GFSA层可以提高性能。

Graph-based neural network models are producing strong results in a number of domains, in part because graphs provide flexibility to encode domain knowledge in the form of relational structure (edges) between nodes in the graph. In practice, edges are used both to represent intrinsic structure (e.g., abstract syntax trees of programs) and more abstract relations that aid reasoning for a downstream task (e.g., results of relevant program analyses). In this work, we study the problem of learning to derive abstract relations from the intrinsic graph structure. Motivated by their power in program analyses, we consider relations defined by paths on the base graph accepted by a finite-state automaton. We show how to learn these relations end-to-end by relaxing the problem into learning finite-state automata policies on a graph-based POMDP and then training these policies using implicit differentiation. The result is a differentiable Graph Finite-State Automaton (GFSA) layer that adds a new edge type (expressed as a weighted adjacency matrix) to a base graph. We demonstrate that this layer can find shortcuts in grid-world graphs and reproduce simple static analyses on Python programs. Additionally, we combine the GFSA layer with a larger graph-based model trained end-to-end on the variable misuse program understanding task, and find that using the GFSA layer leads to better performance than using hand-engineered semantic edges or other baseline methods for adding learned edge types.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源