Learning to Represent Programs with Heterogeneous Graphs
Not on the map. Why?
Abstract (arXiv)
Program source code contains complex structure information, which can be represented in structured data forms like trees or graphs. To acquire the structural information in source code, most existing researches use abstract syntax trees (AST). A group of works add additional edges to ASTs to convert source code into graphs and use graph neural networks to learn representations for program graphs. Although these works provide additional control or data flow information to ASTs for downstream tasks, they neglect an important aspect of structure information in AST itself: the different types of nodes and edges. In ASTs, different nodes contain different kinds of information like variables or control flow, and the relation between a node and all its children can also be different. To address the information of node and edge types, we bring the idea of heterogeneous graphs to learning on source code and present a new formula of building heterogeneous program graphs from ASTs with additional type information for nodes and edges. We use the ASDL grammar of programming language to define the node and edge types of program graphs. Then we use heterogeneous graph neural networks to learn on these graphs. We evaluate our approach on two tasks: code comment generation and method naming. Both tasks require reasoning on the semantics of complete code snippets. Experiment results show that our approach outperforms baseline models, including homogeneous graph-based models, showing that leveraging the type information of nodes and edges in program graphs can help in learning program semantics.
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). First posted on arXiv 8 Dec 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 3; 2023: 5; 2024: 2; 2025: 2; 2026: 1.
13 papers.
Sort:
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generatorscited by 21
- 2022Learning Program Representations with a Tree-Structured Transformercited by 6
- 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
- 2022A Library for Representing Python Programs as Graphs for Machine Learningcited by 4
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detectioncited by 3
- 2024Learn from Heterophily: Heterophilous Information-enhanced Graph Neural Networkcited by 3
- 2023xASTNN: Improved Code Representations for Industrial Practicecited by 2
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
- 2023Knowledge Transfer for Pseudo-code Generation from Low Resource Programming Languagecited by 1
- 2023Heterogeneous Directed Hypergraph Neural Network over abstract syntax tree (AST) for Code Classificationcited by 1
- 2025TCProF: Time-Complexity Prediction SSL Frameworkcited by 0
- 2026PLMGH: What Matters in PLM-GNN Hybrids for Code Classification and Vulnerability Detection28 Apr 2026
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025TCProF: Time-Complexity Prediction SSL Framework10 Feb 2025
- 2024Learn from Heterophily: Heterophilous Information-enhanced Graph Neural Network26 Mar 2024
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generators6 Mar 2024
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detection26 Aug 2023
- 2023Heterogeneous Directed Hypergraph Neural Network over abstract syntax tree (AST) for Code Classification7 May 2023
- 2023Knowledge Transfer for Pseudo-code Generation from Low Resource Programming Language16 Mar 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023
- 2023xASTNN: Improved Code Representations for Industrial Practice13 Mar 2023
- 2022Learning Program Representations with a Tree-Structured Transformer18 Aug 2022
- 2022A Library for Representing Python Programs as Graphs for Machine Learning15 Aug 2022
1 more
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generatorscited by 21
- 2022Learning Program Representations with a Tree-Structured Transformercited by 6
- 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
- 2022A Library for Representing Python Programs as Graphs for Machine Learningcited by 4
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detectioncited by 3
- 2024Learn from Heterophily: Heterophilous Information-enhanced Graph Neural Networkcited by 3
- 2023xASTNN: Improved Code Representations for Industrial Practicecited by 2
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
- 2023Knowledge Transfer for Pseudo-code Generation from Low Resource Programming Languagecited by 1
- 2023Heterogeneous Directed Hypergraph Neural Network over abstract syntax tree (AST) for Code Classificationcited by 1
- 2025TCProF: Time-Complexity Prediction SSL Frameworkcited by 0
12 most cited of 13 All 13 (JSON)
- 2026PLMGH: What Matters in PLM-GNN Hybrids for Code Classification and Vulnerability Detection28 Apr 2026
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025TCProF: Time-Complexity Prediction SSL Framework10 Feb 2025
- 2024Learn from Heterophily: Heterophilous Information-enhanced Graph Neural Network26 Mar 2024
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generators6 Mar 2024
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detection26 Aug 2023
- 2023Heterogeneous Directed Hypergraph Neural Network over abstract syntax tree (AST) for Code Classification7 May 2023
- 2023Knowledge Transfer for Pseudo-code Generation from Low Resource Programming Language16 Mar 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023
- 2023xASTNN: Improved Code Representations for Industrial Practice13 Mar 2023
- 2022Learning Program Representations with a Tree-Structured Transformer18 Aug 2022
- 2022A Library for Representing Python Programs as Graphs for Machine Learning15 Aug 2022
12 newest of 13 All 13 (JSON)