Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?
Not on the map. Why?
Abstract (arXiv)
Programming language understanding and representation (a.k.a code representation learning) has always been a hot and challenging task in software engineering. It aims to apply deep learning techniques to produce numerical representations of the source code features while preserving its semantics. These representations can be used for facilitating subsequent code-related tasks. The abstract syntax tree (AST), a fundamental code feature, illustrates the syntactic information of the source code and has been widely used in code representation learning. However, there is still a lack of systematic and quantitative evaluation of how well AST-based code representation facilitates subsequent code-related tasks. In this paper, we first conduct a comprehensive empirical study to explore the effectiveness of the AST-based code representation in facilitating follow-up code-related tasks. To do so, we compare the performance of models trained with code token sequence (Token for short) based code representation and AST-based code representation on three popular types of code-related tasks. Surprisingly, the overall quantitative statistical results demonstrate that models trained with AST-based code representation consistently perform worse across all three tasks compared to models trained with Token-based code representation. Our further quantitative analysis reveals that models trained with AST-based code representation outperform models trained with Token-based code representation in certain subsets of samples across all three tasks. We also conduct comprehensive experiments to evaluate and reveal the impact of the choice of AST parsing/preprocessing/encoding methods on AST-based code representation and subsequent code-related tasks. Our study provides future researchers with detailed guidance on how to select solutions at each stage to fully exploit AST.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 45 of its 102 references that are in the map. First posted on arXiv 1 Dec 2023.
Builds on
45 of 102 references.
References · 45
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
- 2015Microsoft COCO Captions: Data Collection and Evaluation Servercited by 1,447
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 305
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2017Learning to Represent Programs with Graphscited by 219
33 more
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
- 2018Tree-to-tree Neural Networks for Program Translationcited by 93
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
- 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
- 2021On the Evaluation of Neural Code Summarizationcited by 47
- 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 40
- 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 40
- 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
- 2021CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax Treescited by 31
- 2020Code Summarization with Structure-induced Transformercited by 29
- 2018A General Path-Based Representation for Predicting Program Propertiescited by 28
- 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
- 2021Project-Level Encoding for Neural Source Code Summarization of Subroutinescited by 24
- 2021CoCoSum: Contextual Code Summarization with Multi-Relational Graph Neural Networkcited by 22
- 2020A Multi-Perspective Architecture for Semantic Code Searchcited by 20
- 2021Improving Code Summarization with Block-wise Abstract Syntax Tree Splittingcited by 19
- 2021A Multi-Modal Transformer-based Code Summarization Approach for Smart Contractscited by 16
- 2021GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Searchcited by 15
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2022Source Code Summarization with Structural Relative Position Guided Transformercited by 14
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2020CRaDLe: Deep Code Retrieval Based on Semantic Dependency Learningcited by 12
- 2021Multimodal Representation for Neural Code Searchcited by 11
- 2022Code Search based on Context-aware Code Translationcited by 11
- 2021API2Com: On the Improvement of Automatically Generated Code Comments Using API Documentationscited by 10
- 2020Authorship Attribution of Source Code: A Language-Agnostic Approach and Applicability in Software Engineeringcited by 9
- 2022Learning Program Semantics with Code Representations: An Empirical Studycited by 6
- 2022Learning Program Representations with a Tree-Structured Transformercited by 6
- 2022CSRS: Code Search with Relevance Matching and Semantic Matchingcited by 4
- 2022Unified Abstract Syntax Tree Representation Learning for Cross-Language Program Classificationcited by 2
- 2022Evaluating the Impact of Source Code Parsers on ML4SE Modelscited by 1
Built on by
Citing papers per year: 2025: 2; 2026: 3.
5 papers.
- 2025Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoningcited by 10
- 2025Secure Resource Allocation via Constrained Deep Reinforcement Learningcited by 1
- 2026Enhancing LLM-Based Test Generation by Eliminating Covered Codecited by 1
- 2026Breaking Validity-Induced Boundaries to Expand Algorithm Search Space: A Two-Stage AST-Based Operator for LLM-Driven Automated Heuristic Evolutioncited by 1
- 2026Agent4cs: A Multi-agent System for Code Summarization in Large Hierarchical Codebasescited by 1
- 2026Agent4cs: A Multi-agent System for Code Summarization in Large Hierarchical Codebases1 Jul 2026
- 2026Breaking Validity-Induced Boundaries to Expand Algorithm Search Space: A Two-Stage AST-Based Operator for LLM-Driven Automated Heuristic Evolution3 Apr 2026
- 2026Enhancing LLM-Based Test Generation by Eliminating Covered Code25 Feb 2026
- 2025Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning5 Oct 2025
- 2025Secure Resource Allocation via Constrained Deep Reinforcement Learning20 Jan 2025