paper-with-me

홈 › Papers

Learning Program Representations with a Tree-Structured Transformer

2022-08-18 · Wenhan Wang, Kechi Zhang, Ge Li, Shangqing Liu, Anran Li, Zhi Jin, Yang Liu

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 allow node information passing in two directions, bottom-up and top-down along trees. In this way, Tree-Transformer can learn the information of the node features as well as the global contextual information. The extensive experimental results show that our Tree-Transformer significantly outperforms the existing tree-based and graph-based program representation learning approaches in both the tree-level and node-level prediction tasks.

📄 PDF Abstract BibTeX arXiv:2208.08643

Code (1)

jacobwwh/tree_transformer 공식 구현 pytorch

Tasks

Representation Learning

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.

Similar Papers 제목 키워드 기반

Novel positional encodings to enable tree-structured transformers

2018-09-27 · Vighnesh Leonardo Shiv, Chris Quirk

With interest in program synthesis and similarly flavored problems rapidly increasing, neural models optimized for tree-domain problems are of great value. In the sequence domain, transformers can learn relationships acro…

Program SynthesisSemantic ParsingTranslation

Novel positional encodings to enable tree-based transformers

2019-12-01 · NeurIPS 2019 12 · Vighnesh Shiv, Chris Quirk

Neural models optimized for tree-based problems are of great value in tasks like SQL query extraction and program synthesis. On sequence-structured data, transformers have been shown to learn relationships across arbitra…

Program SynthesisSemantic ParsingTranslation

Global Relational Models of Source Code

2020-05-01 · ICLR 2020 1 · Vincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis 외

Models of code can learn distributed representations of a program's syntax and semantics to predict many non-trivial properties of a program. Recent state-of-the-art models leverage highly structured representations of p…

Inductive BiasProgram RepairVariable misuse

AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarization

2021-12-02 · Ze Tang, Chuanyi Li, Jidong Ge, Xiaoyu Shen 외

Code summarization aims to generate brief natural language descriptions for source code. As source code is highly structured and follows strict programming language grammars, its Abstract Syntax Tree (AST) is often lever…

Code Summarization

Characterizing Intrinsic Compositionality in Transformers with Tree Projections

2022-11-02 · Shikhar Murty, Pratyusha Sharma, Jacob Andreas, Christopher D. Manning

When trained on language data, do transformers learn some arbitrary computation that utilizes the full capacity of the architecture or do they learn a simpler, tree-like computation, hypothesized to underlie compositiona…

Sentence