Neural Code Comprehension: A Learnable Representation of Code Semantics
Not on the map. Why?
Abstract (arXiv)
With the recent success of embeddings in natural language processing, research has been conducted into applying similar methods to code analysis. Most works attempt to process the code directly or use a syntactic tree representation, treating it like sentences written in a natural language. However, none of the existing methods are sufficient to comprehend program semantics robustly, due to structural features such as function calls, branching, and interchangeable order of statements. In this paper, we propose a novel processing technique to learn code semantics, and apply it to a variety of program analysis tasks. In particular, we stipulate that a robust distributional hypothesis of code applies to both human- and machine-generated programs. Following this hypothesis, we define an embedding space, inst2vec, based on an Intermediate Representation (IR) of the code that is independent of the source programming language. We provide a novel definition of contextual flow for this IR, leveraging both the underlying data- and control-flow of the program. We then analyze the embeddings qualitatively using analogies and clustering, and evaluate the learned representation on three different high-level tasks. We show that even without fine-tuning, a single RNN architecture and fixed inst2vec embeddings outperform specialized approaches for performance prediction (compute device mapping, optimal thread coarsening); and algorithm classification from raw code (104 classes), where we set a new state-of-the-art.
Key facts. Cited by 59 papers in the map (data through 7 Oct 2026). First posted on arXiv 19 Jun 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 16; 2022: 14; 2023: 12; 2024: 6; 2025: 7; 2026: 4.
59 papers.
Sort:
By area:
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
- 2021PalmTree: Learning an Assembly Language Model for Instruction Embeddingcited by 49
- 2021CompilerGym: Robust, Performant Compiler Optimization Environments for AI Researchcited by 41
- 2021How could Neural Networks understand Programs?cited by 26
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphscited by 16
- 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Trainingcited by 15
- 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representationcited by 14
- 2022Cross-Language Binary-Source Code Matching with Intermediate Representationscited by 13
- 2022A Survey on Pretrained Language Models for Neural Code Intelligencecited by 13
38 more
- 2023Learning Compiler Pass Orders using Coreset and Normalized Value Predictioncited by 11
- 2022Learning Intermediate Representations using Graph Neural Networks for NUMA and Prefetchers Optimizationcited by 9
- 2022MLGOPerf: An ML Guided Inliner to Optimize Performancecited by 9
- 2021Toward Code Generation: A Survey and Lessons from Semantic Parsingcited by 8
- 2023Performance Optimization using Multimodal Modeling and Heterogeneous GNNcited by 7
- 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6
- 2022Pre-Training Representations of Binary Code Using Contrastive Learningcited by 6
- 2024CompilerDream: Learning a Compiler World Model for General Code Optimizationcited by 6
- 2024On the Limitations of Embedding Based Methods for Measuring Functional Correctness for Code Generationcited by 6
- 2021Learning to Make Compiler Optimizations More Effectivecited by 4
- 2022RL4ReAl: Reinforcement Learning for Register Allocationcited by 4
- 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generationcited by 4
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
- 2021deGraphCS: Embedding Variable-based Flow Graph for Neural Code Searchcited by 3
- 2021LS-CAT: A Large-Scale CUDA AutoTuning Datasetcited by 3
- 2021Learning to Extend Program Graphs to Work-in-Progress Codecited by 3
- 2021Generating GPU Compiler Heuristics using Reinforcement Learningcited by 3
- 2022Evaluation of Contrastive Learning with Various Code Representations for Code Clone Detectioncited by 3
- 2023PERFOGRAPH: A Numerical Aware Program Graph Representation for Performance Optimization and Program Analysiscited by 3
- 2021Profile Guided Optimization without Profiles: A Machine Learning Approachcited by 2
- 2022POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learningcited by 2
- 2023xASTNN: Improved Code Representations for Industrial Practicecited by 2
- 2023Learning Generalizable Program and Architecture Representations for Performance Modelingcited by 2
- 2023AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detectioncited by 2
- 2024MIREncoder: Multi-modal IR-based Pretrained Embeddings for Performance Optimizationscited by 2
- 2021Network representation learning systematic review: ancestors and current development statecited by 1
- 2022End-to-end Mapping in Heterogeneous Systems Using Graph Representation Learningcited by 1
- 2022Exploring Representation of Horn Clauses using GNNs (Extended Technical Report)cited by 1
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
- 2024Tadashi: Enabling AI-Based Automated Code Generation With Guaranteed Correctnesscited by 1
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?cited by 1
- 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networkscited by 1
- 2021Report of the Workshop on Program Synthesis for Scientific Computingcited by 0
- 2021Embedding Code Contexts for Cryptographic API Suggestion:New Methodologies and Comparisonscited by 0
- 2022Towards making the most of NLP-based device mapping optimization for OpenCL kernelscited by 0
- 2023Performance Embeddings: A Similarity-based Approach to Automatic Performance Optimizationcited by 0
- 2023The Next 700 ML-Enabled Compiler Optimizationscited by 0
50 most cited of 59 All 59 (JSON)
- 2026Accelerating Transfer-Learning-Based Autotuning with Predictive LLVM IR Performance Ranking14 Sep 2026
- 2026Instruction Alignment for Binary Code Representation Learning12 Aug 2026
- 2026LLM-Based Embeddings for Program Analysis and Optimization8 Aug 2026
- 2026Complexity-based code embeddings1 Jan 2026
- 2025A Deep Learning Model for Predicting Transformation Legality8 Nov 2025
- 2025Behavioral Embeddings of Programs: A Quasi-Dynamic Approach for Optimization Prediction15 Oct 2025
- 2025Enhancing Neural Code Representation with Additional Context14 Oct 2025
- 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networks22 Jun 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?7 Feb 2025
- 2025Data-efficient Performance Modeling via Pre-training24 Jan 2025
- 2024Tadashi: Enabling AI-Based Automated Code Generation With Guaranteed Correctness4 Oct 2024
38 more
- 2024MIREncoder: Multi-modal IR-based Pretrained Embeddings for Performance Optimizations2 Jul 2024
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation3 May 2024
- 2024On the Limitations of Embedding Based Methods for Measuring Functional Correctness for Code Generation26 Apr 2024
- 2024CompilerDream: Learning a Compiler World Model for General Code Optimization24 Apr 2024
- 2024Peer-aided Repairer: Empowering Large Language Models to Repair Advanced Student Assignments2 Apr 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023The Next 700 ML-Enabled Compiler Optimizations17 Nov 2023
- 2023AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detection13 Nov 2023
- 2023Learning Generalizable Program and Architecture Representations for Performance Modeling25 Oct 2023
- 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphs25 Aug 2023
- 2023PERFOGRAPH: A Numerical Aware Program Graph Representation for Performance Optimization and Program Analysis31 May 2023
- 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representation9 May 2023
- 2023Performance Optimization using Multimodal Modeling and Heterogeneous GNN25 Apr 2023
- 2023Performance Embeddings: A Similarity-based Approach to Automatic Performance Optimization14 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
- 2023Learning Compiler Pass Orders using Coreset and Normalized Value Prediction9 Jan 2023
- 2022A Survey on Pretrained Language Models for Neural Code Intelligence20 Dec 2022
- 2022Pre-Training Representations of Binary Code Using Contrastive Learning11 Oct 2022
- 2022Towards making the most of NLP-based device mapping optimization for OpenCL kernels30 Aug 2022
- 2022POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learning27 Jul 2022
- 2022MLGOPerf: An ML Guided Inliner to Optimize Performance18 Jul 2022
- 2022Evaluation of Contrastive Learning with Various Code Representations for Code Clone Detection17 Jun 2022
- 2022Exploring Representation of Horn Clauses using GNNs (Extended Technical Report)14 Jun 2022
- 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Training4 May 2022
- 2022A Survey of Deep Learning Models for Structural Code Understanding3 May 2022
- 2022End-to-end Mapping in Heterogeneous Systems Using Graph Representation Learning25 Apr 2022
- 2022RL4ReAl: Reinforcement Learning for Register Allocation5 Apr 2022
- 2022Learning Intermediate Representations using Graph Neural Networks for NUMA and Prefetchers Optimization1 Mar 2022
- 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detection25 Feb 2022
- 2022Cross-Language Binary-Source Code Matching with Intermediate Representations19 Jan 2022
- 2021Profile Guided Optimization without Profiles: A Machine Learning Approach24 Dec 2021
- 2021Generating GPU Compiler Heuristics using Reinforcement Learning23 Nov 2021
- 2021A Survey on Machine Learning Techniques for Source Code Analysis18 Oct 2021
- 2021CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research17 Sep 2021
- 2021Network representation learning systematic review: ancestors and current development state14 Sep 2021
- 2021Learning to Extend Program Graphs to Work-in-Progress Code28 May 2021
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks25 May 2021
50 newest of 59 All 59 (JSON)
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
- 2021PalmTree: Learning an Assembly Language Model for Instruction Embeddingcited by 49
- 2021CompilerGym: Robust, Performant Compiler Optimization Environments for AI Researchcited by 41
- 2021How could Neural Networks understand Programs?cited by 26
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphscited by 16
- 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Trainingcited by 15
- 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representationcited by 14
- 2022Cross-Language Binary-Source Code Matching with Intermediate Representationscited by 13
- 2022A Survey on Pretrained Language Models for Neural Code Intelligencecited by 13
12 most cited of 57 All 57 (JSON)
- 2026Accelerating Transfer-Learning-Based Autotuning with Predictive LLVM IR Performance Ranking14 Sep 2026
- 2026Instruction Alignment for Binary Code Representation Learning12 Aug 2026
- 2026LLM-Based Embeddings for Program Analysis and Optimization8 Aug 2026
- 2026Complexity-based code embeddings1 Jan 2026
- 2025A Deep Learning Model for Predicting Transformation Legality8 Nov 2025
- 2025Behavioral Embeddings of Programs: A Quasi-Dynamic Approach for Optimization Prediction15 Oct 2025
- 2025Enhancing Neural Code Representation with Additional Context14 Oct 2025
- 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networks22 Jun 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025Can Large Language Models Understand Intermediate Representations in Compilers?7 Feb 2025
- 2025Data-efficient Performance Modeling via Pre-training24 Jan 2025
- 2024Tadashi: Enabling AI-Based Automated Code Generation With Guaranteed Correctness4 Oct 2024
12 newest of 57 All 57 (JSON)