Learning Program Representations with a Tree-Structured Transformer
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 35 of its 51 references that are in the map. First posted on arXiv 18 Aug 2022.
Builds on
35 of 51 references.
References · 35
- 2017Attention Is All You Needcited by 60,361
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,361
- 2018How Powerful are Graph Neural Networks?cited by 4,393
- 2017Neural Message Passing for Quantum Chemistrycited by 3,487
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2015Gated Graph Sequence Neural Networkscited by 796
- 2017Dynamic Routing Between Capsulescited by 689
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 306
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
23 more
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2019Deep Graph Library: A Graph-Centric, Highly-Performant Package for Graph Neural Networkscited by 242
- 2017Learning to Represent Programs with Graphscited by 220
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
- 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 100
- 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
- 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 69
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2018Structured Neural Summarizationcited by 54
- 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 41
- 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 41
- 2019Neural Program Repair by Jointly Learning to Localize and Repaircited by 40
- 2020Exploring Software Naturalness through Neural Language Modelscited by 32
- 2020Typilus: Neural Type Hintscited by 29
- 2020Improving BERT with Syntax-aware Local Attentioncited by 26
- 2020TreeCaps: Tree-Based Capsule Networks for Source Code Processingcited by 16
- 2021Learning Structural Edits via Incremental Tree Transformationscited by 16
- 2021GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Searchcited by 15
- 2020Learning to Represent Programs with Heterogeneous Graphscited by 14
- 2021GraphCode2Vec: Generic Code Embedding via Lexical and Program Dependence Analysescited by 11
- 2021Modular Tree Network for Source Code Representation Learningcited by 8
Built on by
Citing papers per year: 2023: 2; 2024: 1; 2025: 2; 2026: 1.
6 papers.
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024Structured Code Representations Enable Data-Efficient Adaptation of Code Language Modelscited by 3
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
- 2025TreeGPT: Pure TreeFFN Encoder-Decoder Architecture for Structured Reasoning Without Attention Mechanismscited by 1
- 2026Phishing the Phishers with SpecularNet: Hierarchical Graph Autoencoding for Reference-Free Web Phishing Detectioncited by 1
- 2025From Illusion to Insight: Change-Aware File-Level Software Defect Prediction Using Agentic AIcited by 0
- 2026Phishing the Phishers with SpecularNet: Hierarchical Graph Autoencoding for Reference-Free Web Phishing Detection2 Mar 2026
- 2025From Illusion to Insight: Change-Aware File-Level Software Defect Prediction Using Agentic AI29 Dec 2025
- 2025TreeGPT: Pure TreeFFN Encoder-Decoder Architecture for Structured Reasoning Without Attention Mechanisms6 Sep 2025
- 2024Structured Code Representations Enable Data-Efficient Adaptation of Code Language Models19 Jan 2024
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023