Learning Graph Structure With A Finite-State Automaton Layer

07/09/2020
by   Daniel D. Johnson, et al.
9

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.

READ FULL TEXT
research
12/08/2020

Learning to Represent Programs with Heterogeneous Graphs

Program source code contains complex structure information, which can be...
research
07/23/2020

Learning Differentiable Programs with Admissible Neural Heuristics

We study the problem of learning differentiable functions expressed as p...
research
07/04/2022

ViRel: Unsupervised Visual Relations Discovery with Graph-level Analogy

Visual relations form the basis of understanding our compositional world...
research
11/11/2020

GRCNN: Graph Recognition Convolutional Neural Network for Synthesizing Programs from Flow Charts

Program synthesis is the task to automatically generate programs based o...
research
05/28/2021

Learning to Extend Program Graphs to Work-in-Progress Code

Source code spends most of its time in a broken or incomplete state duri...
research
09/30/2020

Graph-based Heuristic Search for Module Selection Procedure in Neural Module Network

Neural Module Network (NMN) is a machine learning model for solving the ...
research
06/21/2018

Learning Graph Weighted Models on Pictures

Graph Weighted Models (GWMs) have recently been proposed as a natural ge...

Please sign up or login with your details

Forgot password? Click here to reset