mlsanityData to 7 Oct 2026

code2vec: Learning Distributed Representations of Code

arXiv 1803.09473 ↗First posted 26 Mar 2018cs.LG cs.AI cs.PLcited by 249

Not on the map. Why?

Abstract (arXiv)

We present a neural model for representing snippets of code as continuous distributed vectors ("code embeddings"). The main idea is to represent a code snippet as a single fixed-length textitcode vector, which can be used to predict semantic properties of the snippet. This is performed by decomposing code to a collection of paths in its abstract syntax tree, and learning the atomic representation of each path textitsimultaneously with learning how to aggregate a set of them. We demonstrate the effectiveness of our approach by using it to predict a method's name from the vector representation of its body. We evaluate our approach by training a model on a dataset of 14M methods. We show that code vectors trained on this dataset can predict method names from files that were completely unobserved during training. Furthermore, we show that our model learns useful method name vectors that capture semantic similarities, combinations, and analogies. Comparing previous techniques over the same data set, our approach obtains a relative improvement of over 75%, being the first to successfully predict method names based on a large, cross-project, corpus. Our trained model, visualizations and vector similarities are available as an interactive online demo at http://code2vec.org. The code, data, and trained models are available at https://github.com/tech-srl/code2vec.

Key facts. Cited by 249 papers in the map (data through 7 Oct 2026). First posted on arXiv 26 Mar 2018.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 70; 2022: 59; 2023: 47; 2024: 30; 2025: 26; 2026: 17.

249 papers.

Sort:

By area:

  1. 2021Program Synthesis with Large Language Modelscited by 3,509
  2. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  3. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  4. 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 101
  5. 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 85
  6. 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
  7. 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
  8. 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
  9. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
  10. 2022PanGu-Coder: Program Synthesis with Function-Level Language Modelingcited by 47
  11. 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 44
  12. 2021Multilingual training for Software Engineeringcited by 43
38 more
  1. 2021MLGO: a Machine Learning Guided Compiler Optimizations Frameworkcited by 40
  2. 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 40
  3. 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
  4. 2021What do pre-trained code models know about code?cited by 36
  5. 2023Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Reviewcited by 32
  6. 2024LLMs are Also Effective Embedding Models: An In-depth Overviewcited by 32
  7. 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
  8. 2023Distilled GPT for Source Code Summarizationcited by 30
  9. 2021How could Neural Networks understand Programs?cited by 26
  10. 2021On Multi-Modal Learning of Editing Source Codecited by 25
  11. 2021Project-Level Encoding for Neural Source Code Summarization of Subroutinescited by 24
  12. 2021Counterfactual Explanations for Models of Codecited by 24
  13. 2024Malla: Demystifying Real-world Large Language Model Integrated Malicious Servicescited by 24
  14. 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agentcited by 24
  15. 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
  16. 2023InstructABSA: Instruction Learning for Aspect Based Sentiment Analysiscited by 22
  17. 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
  18. 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 20
  19. 2021Improving Code Summarization with Block-wise Abstract Syntax Tree Splittingcited by 19
  20. 2023Trustworthy and Synergistic Artificial Intelligence for Software Engineering: Vision and Roadmapscited by 19
  21. 2024Analyzing the Performance of Large Language Models on Code Summarizationcited by 19
  22. 2021Memorization and Generalization in Neural Code Intelligence Modelscited by 17
  23. 2022VUDENC: Vulnerability Detection with Deep Learning on a Natural Codebase for Pythoncited by 17
  24. 2023Semantic Compression With Large Language Modelscited by 17
  25. 2025cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Treecited by 17
  26. 2022Code-DKT: A Code-based Knowledge Tracing Model for Programming Taskscited by 16
  27. 2023GrACE: Generation using Associated Code Editscited by 16
  28. 2024Stable Code Technical Reportcited by 16
  29. 2021GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Searchcited by 15
  30. 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
  31. 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Trainingcited by 15
  32. 2022AEON: A Method for Automatic Evaluation of NLP Test Casescited by 15
  33. 2023CodeApex: A Bilingual Programming Evaluation Benchmark for Large Language Modelscited by 15
  34. 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representationcited by 14
  35. 2023A systematic literature review on source code similarity measurement and clone detection: techniques, applications, and challengescited by 14
  36. 2023Efficient Avoidance of Vulnerabilities in Auto-completed Smart Contract Code Using Vulnerability-constrained Decodingcited by 14
  37. 2021Neural Program Generation Modulo Static Analysiscited by 13
  38. 2022Cross-Language Binary-Source Code Matching with Intermediate Representationscited by 13

50 most cited of 249 All 249 (JSON)