[论文解读] Learning Graph Structure With A Finite-State Automaton Layer
该论文提出了一种可微分图有限状态自动机(GFSA)层,通过建模有限状态自动机所接受的路径,学习从图结构数据中推导出抽象的关系边。通过在基于图的POMDP上使用隐式微分,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.
研究动机与目标
- 为解决在图结构数据中自动学习高层次、抽象关系的挑战,以提升下游模型性能。
- 受程序分析技术启发,使用有限状态自动机建模派生关系作为基于路径的可达性约束。
- 通过在图上的部分可观察马尔可夫决策过程(POMDP)上进行可微分策略学习,实现这些关系的端到端训练。
- 证明通过GFSA学习的关系在程序理解与导航任务中优于手工设计的边和其他基线方法。
- 为图神经网络提供一种可微分、可解释的机制,以注入领域特定的关系归纳偏置。
提出的方法
- GFSA层定义了一个有限状态自动机(FSA)策略,该策略在基础图上遍历,其中转移由节点和边的标签所决定。
- 通过在基于图的POMDP上使用隐式微分训练FSA策略,实现对自动机路径选择的反向传播。
- 该层输出一个加权邻接矩阵,表示对应于FSA中被接受路径的新边类型。
- 通过随机松弛和梯度估计,将离散路径选择松弛为连续的、可微分的优化问题。
- FSA策略的训练目标是最大化下游任务性能,仅对起始和结束节点提供监督,不涉及中间步骤。
- 该方法可无缝集成到现有的图神经网络(如GGNN、RAT、GREAT)中,使GFSA层作为可学习组件实现端到端训练。
实验结果
研究问题
- RQ1可微分层是否能在不显式监督中间路径步骤的情况下,学习图中抽象且与任务相关的关联关系?
- RQ2在图推理任务中,通过有限状态自动机学习关系是否能提供优于随机游走或强化学习基线方法的归纳偏置?
- RQ3GFSA层是否能再现Python代码图中的已知程序分析模式(例如,数据依赖)?
- RQ4在程序理解任务中,GFSA层与手工设计的语义边相比性能如何?
- RQ5在无显式路径结构监督的情况下,GFSA层是否能在结构化环境(如网格世界)中发现有用的捷径?
主要发现
- 在RAT模型的定位任务中,GFSA层达到94.058 ± 0.064的准确率,优于手工设计边(93.100 ± 0.069)和所有基线方法。
- 在GREAT模型中,GFSA层在定位任务上达到93.266 ± 0.068的准确率,超过次优方法(NRI头为92.446 ± 0.072)。
- 在网格世界任务中,GFSA层在从中间位置训练时达到93.612 ± 0.066的准确率,优于强化学习消融实验(90.643 ± 0.079)和随机游走(92.644 ± 0.071)。
- GFSA层成功再现了Python抽象语法树(AST)中的LastRead程序分析模式,可视化自动机行为与预期的反向执行语义一致。
- 在某些设置下,GFSA层在变量误用检测任务中的性能相比手工设计边最高提升1.5%,相比仅使用AST的基础模型提升3%。
- GFSA层展现出强大的泛化能力,在未见过的网格世界布局中学习到有效的路径查找策略,并能正确识别代码中的相关依赖关系。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。