The DOI matches its Crossref record; 5 of the 5 references it cites were found in a registry or an index.
code2vec: learning distributed representations of code
Abstract
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 code vector, which can be used to predict semantic properties of the snippet. To this end, code is first decomposed to a collection of paths in its abstract syntax tree. Then, the network learns the atomic representation of each path while simultaneously 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 12M methods. We show that code vectors trained on this dataset can predict method names from files that were unobserved during training. Furthermore, we show that our model learns useful method name vectors that capture semantic similarities, combinations, and analogies. A comparison of our approach to previous techniques over the same dataset shows an improvement of more than 75%, making it 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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Code-DKT extends code2vec for code classification, encoding an AST using a set of leaf-to-leaf paths.
“Code-DKT extends the code2vec model for code classification, which encodes an AST using a set of leaf-to-leaf paths throughout the AST.”
From Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks (2022) · cites this paper as [5]
code2vec outperformed prior models on code classification.
“Another recent model, code2vec, outperformed these models.”
From Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks (2022) · cites this paper as [5]
Code-DKT integrates DKT with the code2vec classification algorithm.
“Our proposed Deep Code Knowledge Tracing (Code-DKT) model integrates deep knowledge tracing (DKT) [34]) with the code2vec classification algorithm [5].”
From Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks (2022) · cites this paper as [5]
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Efficient Estimation of Word Representations in Vector Space
Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013) · arXiv · doi:10.48550/arxiv.1301.3781 · Cited by 26,568
Effective Approaches to Attention-based Neural Machine Translation
Luong, T., Pham, H., & Manning, C. D. (2015) · Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d15-1166 · Cited by 8,382
Harris, Z. S. (1954) · WORD · doi:10.1080/00437956.1954.11659520 · Cited by 4,807
Zero-Shot Relation Extraction via Reading Comprehension
Levy, O., Seo, M., Choi, E., & Zettlemoyer, L. (2017) · arXiv · doi:10.48550/arxiv.1706.04115 · Cited by 482
Self-citationZero-Shot Relation Extraction via Reading Comprehension
Levy, O., Seo, M., Choi, E., & Zettlemoyer, L. (2017) · Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017) · doi:10.18653/v1/k17-1034 · Cited by 482 · cited 4×
“…recently, mainly for neural machine translation (NMT) [Bahdanau et al. 2014; Luong et al. 2015; Vaswani et al. 2017], reading comprehension [Levy et al. 2017; Seo et al. 2016], image captioning [Xu et al. 2015], and more [Ba et al. 2014; Bahdanau et al. 2016; Chorowski et al. 2015; Mnih et…”
BackgroundMethodInfluentialSelf-citation
Flagged first, then by citations
Research works printed but not linked: 67
- 10.1145/2635868.2635883 · DOI
- 10.1145/2786805.2786849 · DOI
- Allamanis Miltiadis, 2017, A Survey of Machine Learning for Big Code and Naturalness. arXiv preprint arXiv:1709.06182 · arXiv
- Miltiadis Allamanis Marc Brockschmidt and Mahmoud Khademi. 2018. Learning to Represent Programs with Graphs. In ICLR . Miltiadis Allamanis Marc Brockschmidt and Mahmoud Khademi. 2018. Learning to Represent Programs with Graphs. In ICLR .
- Allamanis Miltiadis, 2016, Proceedings of the 33nd International Conference on Machine Learning, ICML 2016
- 10.5555/2487085.2487127 · DOI
- 10.1145/2635868.2635901 · DOI
- Allamanis Miltiadis, 2015, Proceedings of the 32nd International Conference on International Conference on Machine Learning -, 37
- 10.1145/3192366.3192412 · DOI · Paper page
- Amodio Matthew, 2017, Reps
- Thierry, Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics . 177–184
- Ba Jimmy, 2014, Multiple object recognition with visual attention. arXiv preprint arXiv:1412.7755 · arXiv
- Bahdanau Dzmitry, 2014, Neural Machine Translation by Jointly Learning to Align and Translate. CoRR abs/1409.0473 · arXiv
- 10.1109/ICASSP.2016.7472618 · DOI
- Bengio Yoshua, 2003, A Neural Probabilistic Language Model. J. Mach. Learn. Res. 3 (March
- Bielik Pavol, 2016, Proceedings of the 33nd International Conference on Machine Learning, ICML 2016
- Callison-Burch Chris, 2006, 11th Conference of the European Chapter of the Association for Computational Linguistics.
- Jan K Chorowski Dzmitry Bahdanau Dmitriy Serdyuk Kyunghyun Cho and Yoshua Bengio. 2015. Attention-based models for speech recognition. In Advances in Neural Information Processing Systems. 577–585. Jan K Chorowski Dzmitry Bahdanau Dmitriy Serdyuk Kyunghyun Cho and Yoshua Bengio. 2015. Attention-based models for speech recognition. In Advances in Neural Information Processing Systems. 577–585.
- 10.1145/1390156.1390177 · DOI · Paper page
- 10.1145/2908080.2908126 · DOI
- 10.1145/3062341.3062387 · DOI
- 10.1145/2594291.2594343 · DOI
- 10.1002/(SICI)1097-4571(199009)41:6<391::AID-ASI1>3.0.CO;2-9 · DOI
- 10.1145/3236024.3236059 · DOI
- 10.3115/v1/P15-1030 · DOI
- Firth J.R., 1930, A Synopsis of Linguistic Theory
- Fowler Martin, 1999, Refactoring: Improving the Design of Existing Code
- Glorot Xavier, 2010, Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics . 249–256
- Glorot Xavier, 2011, Proceedings of the 28th International Conference on Machine Learning (ICML-11)
- 10.1145/2814270.2814295 · DOI
- Hermann Karl Moritz, 2015, Proceedings of the 28th International Conference on Neural Information Processing Systems -, 1
- 10.5555/2337223.2337322 · DOI
- 10.1007/978-3-642-03013-0_14 · DOI
- 10.18653/v1/P16-1195 · DOI
- 10.1145/2837614.2837674 · DOI
- 10.1145/3173162.3173202 · DOI
- Kingma Diederik, 2014, Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 · arXiv
- Le Quoc, 2014, Proceedings of the 31st International Conference on Machine Learning (ICML-14) , Tony Jebara and Eric P. Xing (Eds.). JMLR Workshop and Conference Proceedings, 1188–1196
- 10.3115/v1/W14-1618 · DOI
- Levy Omer, 2014, Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014
- 10.1145/3133908 · DOI · Paper page
- Lu Yanxin, 2017, Data-Driven Program Completion. CoRR abs/1705.09042 · arXiv
- Chris, Proceedings of the 31st International Conference on International Conference on Machine Learning -, 32
- Mikolov Tomas, 2013, Proceedings of the 26th International Conference on Neural Information Processing Systems (NIPS’13)
- 10.1145/2384616.2384689 · DOI
- Mnih Volodymyr, 2014, Proceedings of the 27th International Conference on Neural Information Processing Systems (NIPS’14)
- Murali Vijayaraghavan, 2017, Bayesian Sketch Learning for Program Synthesis. CoRR abs/1703.05698 · arXiv
- 10.1145/2491411.2491458 · DOI
- Pennington Jeffrey, 2014, Manning
- 10.1145/2983990.2984041 · DOI
- 10.1145/2837614.2837671 · DOI
- 10.1145/2676726.2677009 · DOI
- 10.1145/2594291.2594321 · DOI · Paper page
- 10.1023/A:1010091220143 · DOI
- 10.1007/978-1-4757-6594-6_14 · DOI
- 10.1145/361219.361220 · DOI · Paper page
- Seo Minjoon, 2016, Bidirectional attention flow for machine comprehension. arXiv preprint arXiv:1611.01603 · arXiv
- Socher Richard, Proceedings of the 26th International Conference on Machine Learning (ICML).
- 10.5555/2627435.2670313 · DOI
- Tsoumakas Grigorios, 2006, Multi-label classification: An overview, International Journal of Data Warehousing and Mining, 3
- Turian Joseph, 2010, Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics (ACL ’10)
- 10.1162/coli.2006.32.3.379 · DOI
- Ashish Vaswani Noam Shazeer Niki Parmar Jakob Uszkoreit Llion Jones Aidan N Gomez Łukasz Kaiser and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems. 6000–6010. Ashish Vaswani Noam Shazeer Niki Parmar Jakob Uszkoreit Llion Jones Aidan N Gomez Łukasz Kaiser and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems. 6000–6010.
- 10.1561/2500000028 · DOI
- 10.5555/2820518.2820559 · DOI
- Xu Kelvin, 2015, International Conference on Machine Learning . 2048–2057
- 10.1145/2986012.2986013 · DOI
Cited by
Sorted by citations
Machine Learning Testing: Survey, Landscapes and Horizons
Zhang, J. M., Harman, M., Ma, L., & Liu, Y. (2022) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2019.2962027 · Cited by 897
Program Synthesis with Large Language Models
Austin, J., Odena, A., Nye, M., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C., Terry, M., Le, Q., et al. (2021) · arXiv · doi:10.48550/arxiv.2108.07732 · Cited by 388
“…models for code have shown to be effective for transfer learning across software engineering tasks, including CuBERT [Kanade et al., 2020], CodeBERT [Feng et al., 2020], PyMT5 [Clement et al., 2020], code2vec [Alon et al., 2019], and other T5 models trained on code [Mastropaolo et al., 2021].”
BackgroundMethodInfluentialAn empirical evaluation of GitHub copilot's code suggestions
Nguyen, N., & Nadi, S. (2022) · Proceedings of the 19th International Conference on Mining Software Repositories · doi:10.1145/3524842.3528470 · Cited by 313
The adverse effects of code duplication in machine learning models of code
Allamanis, M. (2019) · Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software · doi:10.1145/3359591.3359735 · Cited by 284
Code Prediction by Feeding Trees to Transformers
Kim, S., Zhao, J., Tian, Y., & Chandra, S. (2021) · 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE) · doi:10.1109/icse43902.2021.00026 · Cited by 209
An extensive study on pre-trained models for program understanding and generation
Zeng, Z., Tan, H., Zhang, H., Li, J., Zhang, Y., & Zhang, L. (2022) · Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis · doi:10.1145/3533767.3534390 · Cited by 153
Predicting Defective Lines Using a Model-Agnostic Technique
Wattanakriengkrai, S., Thongtanunam, P., Tantithamthavorn, C., Hata, H., & Matsumoto, K. (2022) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2020.3023177 · Cited by 137
No Need to Lift a Finger Anymore? Assessing the Quality of Code Generation by ChatGPT
Liu, Z., Tang, Y., Luo, X., Zhou, Y., & Zhang, L. F. (2024) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2024.3392499 · Cited by 128
Automated conformance testing for JavaScript engines via deep compiler fuzzing
Ye, G., Tang, Z., Tan, S. H., Huang, S., Fang, D., Sun, X., Bian, L., Wang, H., & Wang, Z. (2021) · Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation · doi:10.1145/3453483.3454054 · Cited by 77
Multilingual training for software engineering
Ahmed, T., & Devanbu, P. (2022) · Proceedings of the 44th International Conference on Software Engineering · doi:10.1145/3510003.3510049 · Cited by 57
Code Review Automation: Strengths and Weaknesses of the State of the Art
Tufano, R., Dabić, O., Mastropaolo, A., Ciniselli, M., & Bavota, G. (2024) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2023.3348172 · Cited by 48
Distilled GPT for source code summarization
Su, C.-Y., & McMillan, C. (2024) · Automated Software Engineering · doi:10.1007/s10515-024-00421-4 · Cited by 49
Diet code is healthy: simplifying programs for pre-trained models of code
Zhang, Z., Zhang, H., Shen, B., & Gu, X. (2022) · Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering · doi:10.1145/3540250.3549094 · Cited by 41
Predictive Comment Updating With Heuristics and AST-Path-Based Neural Learning: A Two-Phase Approach
Lin, B., Wang, S., Liu, Z., Xia, X., & Mao, X. (2023) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2022.3185458 · Cited by 27
Malla: Demystifying Real-world Large Language Model Integrated Malicious Services
Lin, Z., Cui, J., Liao, X., & Wang, X. (2024) · arXiv · doi:10.48550/arxiv.2401.03315 · Cited by 13
“Given the multifaceted nature of the responses, which could be a mix of text and code, we employed SBERT [67] and Code2Vec [85] for vectorization.”
MethodZhang, Y., Zhao, X., Wang, Z. Z., Yang, C., Wei, J., & Wu, T. (2025) · Findings of the Association for Computational Linguistics: EMNLP 2025 · doi:10.18653/v1/2025.findings-emnlp.430 · Cited by 11
Security of Language Models for Code: A Systematic Literature Review
Chen, Y., Sun, W., Fang, C., Chen, Z., Ge, Y., Han, T., Zhang, Q., Liu, Y., Chen, Z., & Xu, B. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3735554 · Cited by 10
Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks
Shi, Y., Chi, M., Barnes, T., & Price, T. (2022) · Zenodo · doi:10.5281/zenodo.6853105 · Cited by 7
Post-Incorporating Code Structural Knowledge Into Pretrained Models via ICL for Code Translation
Du, Y., Sun, H., & Li, M. (2025) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2025.3605768
Metadata
- Authors
- Alon, U., Zilberstein, M., Levy, O., & Yahav, E.
- Affiliations
- Technion, Israel
- Facebook AI Research, USA
- Venue
- Proceedings of the ACM on Programming Languages
- Published
- 2019-01-02
- Volume
- 3
- Issue
- POPL
- Pages
- 1-29
- ISSN
- 2475-1421
- Cited by
- 962
- References
- 5
- Language
- en
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review