Learning Program Representations with a Tree-Structured Transformer
Wenhan Wang, Kechi Zhang, Ge Li, Shangqing Liu, Anran Li, Zhi Jin,, Yang Liu

TL;DR
This paper introduces Tree-Transformer, a recursive neural network with multi-head attention and bi-directional propagation, effectively capturing long-range dependencies in program trees for better code understanding and prediction tasks.
Contribution
The paper presents a novel Tree-Transformer model that improves program representation learning by modeling sibling and parent-children dependencies with attention and bidirectional information flow.
Findings
Outperforms existing tree-based approaches in prediction tasks
Effectively captures long-range dependencies in program trees
Enhances node-level and tree-level program understanding
Abstract
Learning vector representations for programs is a critical step in applying deep learning techniques for program understanding tasks. Various neural network models are proposed to learn from tree-structured program representations, e.g., abstract syntax tree (AST) and concrete syntax tree (CST). However, most neural architectures either fail to capture long-range dependencies which are ubiquitous in programs, or cannot learn effective representations for syntax tree nodes, making them incapable of performing the node-level prediction tasks, e.g., bug localization. In this paper, we propose Tree-Transformer, a novel recursive tree-structured neural network to learn the vector representations for source codes. We propose a multi-head attention mechanism to model the dependency between siblings and parent-children node pairs. Moreover, we propose a bi-directional propagation strategy to…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Online Learning and Analytics
MethodsSoftmax · Linear Layer
