mlsanityData to 7 Oct 2026

Neural Code Comprehension: A Learnable Representation of Code Semantics

arXiv 1806.07336 ↗First posted 19 Jun 2018cs.LG cs.NE cs.PLcited by 59

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

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 16; 2022: 14; 2023: 12; 2024: 6; 2025: 7; 2026: 4.

59 papers.

Sort:

By area:

  1. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  2. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
  3. 2021PalmTree: Learning an Assembly Language Model for Instruction Embeddingcited by 49
  4. 2021CompilerGym: Robust, Performant Compiler Optimization Environments for AI Researchcited by 41
  5. 2021How could Neural Networks understand Programs?cited by 26
  6. 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
  7. 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
  8. 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphscited by 16
  9. 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Trainingcited by 15
  10. 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representationcited by 14
  11. 2022Cross-Language Binary-Source Code Matching with Intermediate Representationscited by 13
  12. 2022A Survey on Pretrained Language Models for Neural Code Intelligencecited by 13
38 more
  1. 2023Learning Compiler Pass Orders using Coreset and Normalized Value Predictioncited by 11
  2. 2022Learning Intermediate Representations using Graph Neural Networks for NUMA and Prefetchers Optimizationcited by 9
  3. 2022MLGOPerf: An ML Guided Inliner to Optimize Performancecited by 9
  4. 2021Toward Code Generation: A Survey and Lessons from Semantic Parsingcited by 8
  5. 2023Performance Optimization using Multimodal Modeling and Heterogeneous GNNcited by 7
  6. 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6
  7. 2022Pre-Training Representations of Binary Code Using Contrastive Learningcited by 6
  8. 2024CompilerDream: Learning a Compiler World Model for General Code Optimizationcited by 6
  9. 2024On the Limitations of Embedding Based Methods for Measuring Functional Correctness for Code Generationcited by 6
  10. 2021Learning to Make Compiler Optimizations More Effectivecited by 4
  11. 2022RL4ReAl: Reinforcement Learning for Register Allocationcited by 4
  12. 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
  13. 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generationcited by 4
  14. 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
  15. 2021deGraphCS: Embedding Variable-based Flow Graph for Neural Code Searchcited by 3
  16. 2021LS-CAT: A Large-Scale CUDA AutoTuning Datasetcited by 3
  17. 2021Learning to Extend Program Graphs to Work-in-Progress Codecited by 3
  18. 2021Generating GPU Compiler Heuristics using Reinforcement Learningcited by 3
  19. 2022Evaluation of Contrastive Learning with Various Code Representations for Code Clone Detectioncited by 3
  20. 2023PERFOGRAPH: A Numerical Aware Program Graph Representation for Performance Optimization and Program Analysiscited by 3
  21. 2021Profile Guided Optimization without Profiles: A Machine Learning Approachcited by 2
  22. 2022POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learningcited by 2
  23. 2023xASTNN: Improved Code Representations for Industrial Practicecited by 2
  24. 2023Learning Generalizable Program and Architecture Representations for Performance Modelingcited by 2
  25. 2023AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detectioncited by 2
  26. 2024MIREncoder: Multi-modal IR-based Pretrained Embeddings for Performance Optimizationscited by 2
  27. 2021Network representation learning systematic review: ancestors and current development statecited by 1
  28. 2022End-to-end Mapping in Heterogeneous Systems Using Graph Representation Learningcited by 1
  29. 2022Exploring Representation of Horn Clauses using GNNs (Extended Technical Report)cited by 1
  30. 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
  31. 2024Tadashi: Enabling AI-Based Automated Code Generation With Guaranteed Correctnesscited by 1
  32. 2025Can Large Language Models Understand Intermediate Representations in Compilers?cited by 1
  33. 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networkscited by 1
  34. 2021Report of the Workshop on Program Synthesis for Scientific Computingcited by 0
  35. 2021Embedding Code Contexts for Cryptographic API Suggestion:New Methodologies and Comparisonscited by 0
  36. 2022Towards making the most of NLP-based device mapping optimization for OpenCL kernelscited by 0
  37. 2023Performance Embeddings: A Similarity-based Approach to Automatic Performance Optimizationcited by 0
  38. 2023The Next 700 ML-Enabled Compiler Optimizationscited by 0

50 most cited of 59 All 59 (JSON)