GraphCode2Vec: Generic Code Embedding via Lexical and Program Dependence Analyses
Not on the map. Why?
Abstract (arXiv)
Code embedding is a keystone in the application of machine learning on several Software Engineering (SE) tasks. To effectively support a plethora of SE tasks, the embedding needs to capture program syntax and semantics in a way that is generic. To this end, we propose the first self-supervised pre-training approach (called GraphCode2Vec) which produces task-agnostic embedding of lexical and program dependence features. GraphCode2Vec achieves this via a synergistic combination of code analysis and Graph Neural Networks. GraphCode2Vec is generic, it allows pre-training, and it is applicable to several SE downstream tasks. We evaluate the effectiveness of GraphCode2Vec on four (4) tasks (method name prediction, solution classification, mutation testing and overfitted patch classification), and compare it with four (4) similarly generic code embedding baselines (Code2Seq, Code2Vec, CodeBERT, GraphCodeBERT) and 7 task-specific, learning-based methods. In particular, GraphCode2Vec is more effective than both generic and task-specific learning-based baselines. It is also complementary and comparable to GraphCodeBERT (a larger and more complex model). We also demonstrate through a probing and ablation study that GraphCode2Vec learns lexical and program dependence features and that self-supervised pre-training improves effectiveness.
Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). First posted on arXiv 2 Dec 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 4; 2023: 3; 2024: 3; 2025: 1.
11 papers.
- 2023Exploring Code Analysis: Zero-Shot Insights on Syntax and Semantics with LLMscited by 19
- 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasetscited by 16
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lackingcited by 7
- 2022Learning Program Representations with a Tree-Structured Transformercited by 6
- 2024A Survey of Source Code Representations for Machine Learning-Based Cybersecurity Taskscited by 5
- 2022MIXCODE: Enhancing Code Classification by Mixup-Based Data Augmentationcited by 4
- 2022NeuDep: Neural Binary Memory Dependence Analysiscited by 3
- 2023Power Constrained Autotuning using Graph Neural Networkscited by 2
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understandingcited by 2
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Codecited by 1
- 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasets21 Mar 2025
- 2024A Survey of Source Code Representations for Machine Learning-Based Cybersecurity Tasks15 Mar 2024
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding24 Feb 2024
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lacking19 Feb 2024
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Code5 Jul 2023
- 2023Exploring Code Analysis: Zero-Shot Insights on Syntax and Semantics with LLMs20 May 2023
- 2023Power Constrained Autotuning using Graph Neural Networks22 Feb 2023
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacities20 Dec 2022
- 2022MIXCODE: Enhancing Code Classification by Mixup-Based Data Augmentation6 Oct 2022
- 2022NeuDep: Neural Binary Memory Dependence Analysis4 Oct 2022
- 2022Learning Program Representations with a Tree-Structured Transformer18 Aug 2022