Are deep neural networks the best choice for modeling source code?
The DOI matches its Crossref record; 44 of the 44 references it cites were found in a registry or an index.
Abstract
Current statistical language modeling techniques, including deep-learning based models, have proven to be quite effective for source code. We argue here that the special properties of source code can be exploited for further improvements. In this work, we enhance established language modeling approaches to handle the special challenges of modeling source code, such as: frequent changes, larger, changing vocabularies, deeply nested scopes, etc. We present a fast, nested language modeling toolkit specifically designed for software, with the ability to add & remove text, and mix & swap out many models. Specifically, we improve upon prior cache-modeling work and present a model with a much more expansive, multi-level notion of locality that we show to be well-suited for modeling software. We present results on varying corpora in comparison with traditional N-gram, as well as RNN, and LSTM deep-learning language models, and release all our source code for public use. Our evaluations suggest that carefully adapting N-gram models for source code can yield performance that surpasses even RNN and LSTM based deep-learning models.
Overview
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
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?
In the citing paper
“Vocabularies of a project are highly local, and functions from the same projects are likely to share same set of identifiers [10,22].”
From Few-shot training LLMs for project-specific code-summarization (2022) · cites this paper as [10]
In the citing paper
“It's been well-known right from the outset that language modeling for code has to deal with project-specific phenomena [10,11,22].”
From Few-shot training LLMs for project-specific code-summarization (2022) · cites this paper as [10]
In the citing paper
“Several methods have been proposed to incorporate repository context into the training of language models, including n-grams (Tu et al., 2014), LSTMs (Hellendoorn and Devanbu, 2017), and Transformers (Svyatkovskiy et al., 2020;Liu et al., 2022;Ding et al., 2022).”
From RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation (2023) · cites this paper as Hellendoorn and Devanbu, 2017
Citations
Cites
Hochreiter, S., & Schmidhuber, J. (1997) · Neural Computation · doi:10.1162/neco.1997.9.8.1735 · Cited by 102,318
Recurrent neural network based language model
Mikolov, T., Karafiát, M., Burget, L., Černocký, J., & Khudanpur, S. (2010) · Interspeech 2010 · doi:10.21437/interspeech.2010-343 · Cited by 5,390 · cited 2×
“We replicate their experiments using the Recurrent Neural Network LanguageModel toolkit (RNNLM6) [25], which includes a hidden layer size of 300 and 1,000 direct connections.”
BackgroundMethodNeural Word Embedding as Implicit Matrix Factorization
Levy, O., & Goldberg, Y. (2014) · neural information processing systems · Cited by 1,582
Character-Aware Neural Language Models
Kim, Y., Jernite, Y., Sontag, D., & Rush, A. M. (2015) · arXiv · doi:10.48550/arxiv.1508.06615 · Cited by 1,530
Character-Aware Neural Language Models
Kim, Y., Jernite, Y., Sontag, D., & Rush, A. (2016) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v30i1.10362 · Cited by 1,491
One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling
Chelba, C., Mikolov, T., Schuster, M., Ge, Q., Brants, T., Koehn, P., & Robinson, T. (2013) · arXiv · doi:10.48550/arxiv.1312.3005 · Cited by 1,051 · cited 1×
“Of these, MKN is best suited for natural language, followed by ADM which we found performed nearly as well as MKN on a one-billion token corpus from [11], as well as on several small corpora.”
MethodVisualizing and Understanding Recurrent Networks
Karpathy, A., Johnson, J., & Fei-Fei, L. (2015) · arXiv · doi:10.48550/arxiv.1506.02078 · Cited by 845 · cited 1×
“Character-LSTM models [21, 22] deal with this issue by modeling one character at the time instead and may provide a solution to this problem in the long term, possibly in a hybrid form, since these models at present cannot compete with word-level models [19].”
BackgroundExploring the Limits of Language Modeling
Józefowicz, R., Vinyals, O., Schuster, M., Shazeer, N., & Wu, Y. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1602.02410 · Cited by 823 · cited 3×
“Finally, The confidence scores can be 3This applies particularly when using normal SoftMax output layers, but also when using NCE or CNN SoftMax[19] derived from various sources, such as the language models themselves or even as parameters learned by an LSTM.”
BackgroundMethodAn empirical study of smoothing techniques for language modeling
Chen, S. F., & Goodman, J. (1996) · Proceedings of the 34th annual meeting on Association for Computational Linguistics - · doi:10.3115/981863.981904 · Cited by 770
One billion word benchmark for measuring progress in statistical language modeling
Chelba, C., Mikolov, T., Schuster, M., Ge, Q., Brants, T., Koehn, P., & Robinson, T. (2014) · Interspeech 2014 · doi:10.21437/interspeech.2014-564 · Cited by 627 · cited 1×
“Of these, MKN is best suited for natural language, followed by ADM which we found performed nearly as well as MKN on a one-billion token corpus from [11], as well as on several small corpora.”
MethodAn Empirical Study of Smoothing Techniques for Language Modeling
Chen, S. F., & Goodman, J. (1996) · arXiv (Cornell University) · doi:10.48550/arxiv.cmp-lg/9606011 · Cited by 612
Deep learning code fragments for code clone detection
White, M., Tufano, M., Vendome, C., & Poshyvanyk, D. (2016) · Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering · doi:10.1145/2970276.2970326 · Cited by 558 · cited 2×
“Count Models DL models are now used everywhere, including for modeling of source code [3, 37].”
MethodCode completion with statistical language models
Raychev, V., Vechev, M., & Yahav, E. (2014) · Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation · doi:10.1145/2594291.2594321 · Cited by 555 · cited 3×
“Similarly, in a source code environment, language migration [20, 27], synthesis of code from natural language and vice versa [5, 14, 28, 30] as well as code suggestion engines [15, 33] all need models that score code fragments accurately.”
BackgroundMethodOn the naturalness of software
Hindle, A., Barr, E. T., Su, Z., Gabel, M., & Dévanbu, P. (2012) · doi:10.5555/2337223.2337322 · Cited by 541
Learning from examples to improve code completion systems
Bruch, M., Monperrus, M., & Mezini, M. (2009) · Proceedings of the 7th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering · doi:10.1145/1595696.1595728 · Cited by 378 · cited 1×
“The package structures in large systems can introduce nesting of such vocabulary scopes, with different identifiers going in and out of use as one traverses the package hierarchy [7, 24, 34, 36].”
BackgroundLearning natural coding conventions
Allamanis, M., Barr, E. T., Bird, C., & Sutton, C. (2014) · Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering · doi:10.1145/2635868.2635883 · Cited by 376 · cited 2×
“As we shall see, performance in this final setting is best-in-class, and has ramifications for code synthesis [14, 30], fault localization [8, 31], code naturalization [2] and many real-world code suggestions settings [15, 29].”
BackgroundMining source code repositories at massive scale using language modeling
Allamanis, M., & Sutton, C. (2013) · 2013 10th Working Conference on Mining Software Repositories (MSR) · doi:10.1109/msr.2013.6624029 · Cited by 313 · cited 5×
“Table 1: Corpus statistics as reproduced from [4], full corpus”
BackgroundMethodInfluentialProceedings of the 11th Working Conference on Mining Software Repositories
(2014) · doi:10.1145/2597073 · Cited by 264
On the "naturalness" of buggy code
Ray, B., Hellendoorn, V., Godhane, S., Tu, Z., Bacchelli, A., & Devanbu, P. (2016) · Proceedings of the 38th International Conference on Software Engineering · doi:10.1145/2884781.2884848 · Cited by 252 · cited 4×
“As we shall see, performance in this final setting is best-in-class, and has ramifications for code synthesis [14, 30], fault localization [8, 31], code naturalization [2] and many real-world code suggestions settings [15, 29].”
BackgroundMethodInfluentialSelf-citationTu, Z., Su, Z., & Devanbu, P. (2014) · Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering · doi:10.1145/2635868.2635875 · Cited by 238
Bimodal Modelling of Source Code and Natural Language
Allamanis, M., Tarlow, D., Gordon, A. D., & Wei, Y. (2015) · Edinburgh Research Explorer (University of Edinburgh) · Cited by 215
A statistical semantic language model for source code
Nguyen, T. T., Nguyen, A. T., Nguyen, H. A., & Nguyen, T. N. (2013) · Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering · doi:10.1145/2491411.2491458 · Cited by 208 · cited 2×
“As we shall see, performance in this final setting is best-in-class, and has ramifications for code synthesis [14, 30], fault localization [8, 31], code naturalization [2] and many real-world code suggestions settings [15, 29].”
BackgroundToward deep learning software repositories
White, M., Vendome, C., & Poshyvanyk, D. (2015) · Cited by 192
Code completion with statistical language models
Raychev, V., Vechev, M., & Yahav, E. (2014) · ACM SIGPLAN Notices · doi:10.1145/2666356.2594321 · Cited by 189
Exploiting Syntactic Structure for Language ModelingPreprint
Chelba, C. I., & Jelinek, F. (1998) · Cited by 163
How Program History Can Improve Code Completion
Robbes, R., & Lanza, M. (2008) · 2008 23rd IEEE/ACM International Conference on Automated Software Engineering · doi:10.1109/ase.2008.42 · Cited by 155
Graph-based statistical language model for code
Nguyen, A. T., & Nguyen, T. N. (2016) · Cited by 142
Lexical statistical machine translation for language migration
Nguyen, A. T., Nguyen, T. T., & Nguyen, T. N. (2013) · Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering · doi:10.1145/2491411.2494584 · Cited by 136
SWIM: synthesizing what i mean: code search and idiomatic snippet synthesis
Raghothaman, M., Wei, Y., & Hamadi, Y. (2016) · Proceedings of the 38th International Conference on Software Engineering · doi:10.1145/2884781.2884808 · Cited by 132 · cited 2×
“Similarly, in a source code environment, language migration [20, 27], synthesis of code from natural language and vice versa [5, 14, 28, 30] as well as code suggestion engines [15, 33] all need models that score code fragments accurately.”
BackgroundA Convolutional Attention Network for Extreme Summarization of Source Code
Allamanis, M., Peng, H. M., & Sutton, C. A. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1602.03001 · Cited by 126
PHOG: probabilistic model for code
Bielik, P., Raychev, V., & Vechev, M. (2016) · International Conference on Machine Learning · Cited by 124
Structured Generative Models of Natural Source Code
Maddison, C. J., & Tarlow, D. (2014) · arXiv (Cornell University) · doi:10.48550/arxiv.1401.0514 · Cited by 122 · cited 3×
“The package structures in large systems can introduce nesting of such vocabulary scopes, with different identifiers going in and out of use as one traverses the package hierarchy [7, 24, 34, 36].”
BackgroundExpoiting Syntactic Structure for Language ModelingPreprint
Chelba, C. I., & Jelinek, F. (1998) · arXiv (Cornell University) · doi:10.48550/arxiv.cs/9811022 · Cited by 122 · cited 1×
“Dependency models: can capture long-distance dependencies between tokens, rather than dependencies between tokens that are sequential in the text1, which are sometimes more effective than Markovian dependencies in left-to-right parses of natural language [9, 10].”
BackgroundPhrase-Based Statistical Translation of Programming Languages
Karaivanov, S., Raychev, V., & Vechev, M. (2014) · Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software · doi:10.1145/2661136.2661148 · Cited by 114 · cited 1×
“Similarly, in a source code environment, language migration [20, 27], synthesis of code from natural language and vice versa [5, 14, 28, 30] as well as code suggestion engines [15, 33] all need models that score code fragments accurately.”
BackgroundProgram synthesis using natural language
Desai, A., Gulwani, S., Hingorani, V., Jain, N., Karkare, A., Marron, M., R, S., & Roy, S. (2016) · Proceedings of the 38th International Conference on Software Engineering · doi:10.1145/2884781.2884786 · Cited by 111
Syntax errors just aren't natural: improving error reporting with language models
Campbell, J. C., Hindle, A., & Amaral, J. N. (2014) · Proceedings of the 11th Working Conference on Mining Software Repositories · doi:10.1145/2597073.2597102 · Cited by 81 · cited 1×
“As we shall see, performance in this final setting is best-in-class, and has ramifications for code synthesis [14, 30], fault localization [8, 31], code naturalization [2] and many real-world code suggestions settings [15, 29].”
BackgroundStructure and Performance of a Dependency Language Model
Chelba, C. I., Engle, D., Printz, H., Jelinek, F., Ristad, E. S., Jiménez, V., Rosenfeld, R., Khudanpur, S. P., Stolcke, A., Mangu, L., et al. (1997) · doi:10.21236/ada640606 · Cited by 68
T2API: synthesizing API code usage templates from English texts with statistical translation
Nguyen, T., Rigby, P. C., Nguyen, A. T., Karanfil, M., & Nguyen, T. N. (2016) · Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering · doi:10.1145/2950290.2983931 · Cited by 53
The Uniqueness of Changes: Characteristics and Applications
Ray, B., Bird, C., & Zimmermann, T. (2016) · Cited by 37
CACHECA: A Cache Language Model Based Code Suggestion Tool
Franks, C., Tu, Z., Dévanbu, P., & Hellendoorn, V. J. (2015) · Cited by 34
Self-citationStructure and performance of a dependency language model
Chelba, C. I., Engle, D., Jelinek, F., Jimenez, V., Khudanpur, S. P., Mangu, L., Printz, H., Ristad, E. S., Rosenfeld, R., Stolcke, A., et al. (1997) · European Conference on Speech Communication and Technology (Eurospeech) · doi:10.21437/eurospeech.1997-700 · Cited by 32
Exploiting syntactic structure for language modeling
Chelba, C., & Jelinek, F. (1998) · Annual Meeting of the Association for Computational Linguistics (ACL) · doi:10.3115/980845.980882 · Cited by 30 · cited 1×
“Dependency models: can capture long-distance dependencies between tokens, rather than dependencies between tokens that are sequential in the text1, which are sometimes more effective than Markovian dependencies in left-to-right parses of natural language [9, 10].”
BackgroundProducts, developers, and milestones: how should I build my N-Gram language model
Saraiva, J. D. A. G., Bird, C., & Zimmermann, T. (2015) · ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) · doi:10.1145/2786805.2804431 · Cited by 10 · cited 1×
“Researchers have even noted applicationand developer-specific vocabularies [35].”
Background
Research works printed but not linked: 7
- 10.5555/2487085.2487127 · doi:10.5555/2487085.2487127
- Stanley F. Chen and Joshua Goodman . 1996 . Stanley F. Chen and Joshua Goodman. 1996.
- Hoa Khanh Dam , Truyen Tran , and Trang Pham . 2016. A deep language model for software code. arXiv preprint arXiv:1608.02715 ( 2016 ). Hoa Khanh Dam, Truyen Tran, and Trang Pham. 2016. A deep language model for software code. arXiv preprint arXiv:1608.02715 (2016). · arXiv
- 10.5555/2819009.2819143 · doi:10.5555/2819009.2819143
- 10.5555/2818754.2818858 · doi:10.5555/2818754.2818858
- Anh Tuan Nguyen , Tung Thanh Nguyen, and Tien N Nguyen . 2013 . Anh Tuan Nguyen, Tung Thanh Nguyen, and Tien N Nguyen. 2013.
- Thanh Nguyen , Peter C Rigby , Anh Tuan Nguyen , Mark Karanfil, and Tien N Nguyen. 2016 . Thanh Nguyen, Peter C Rigby, Anh Tuan Nguyen, Mark Karanfil, and Tien N Nguyen. 2016.
Cited by
Deep Learning for IoT Big Data and Streaming Analytics: A Survey
Mohammadi, M., Al-Fuqaha, A., Sorour, S., & Guizani, M. (2018) · IEEE Communications Surveys & Tutorials · doi:10.1109/comst.2018.2844341 · Cited by 1,471
Hu, X., Li, G., Xia, X., Lo, D., & Jin, Z. (2018) · Proceedings of the 26th Conference on Program Comprehension · doi:10.1145/3196321.3196334 · Cited by 621
“Hellendoorn and Devanbu [16] have demonstrated that it is unreasonable for source code to use such a vocabulary.”
Unified Pre-training for Program Understanding and Generation
Ahmad, W., Chakraborty, S., Ray, B., & Chang, K.-W. (2021) · Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies · doi:10.18653/v1/2021.naacl-main.211 · Cited by 642
CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation
Lu, S., Guo, D., Ren, S., Huang, J., Svyatkovskiy, A., Blanco, A., Clement, C., Drain, D., Jiang, D., Tang, D., et al. (2021) · arXiv · doi:10.48550/arxiv.2102.04664 · Cited by 536
A systematic evaluation of large language models of code
Xu, F. F., Alon, U., Neubig, G., & Hellendoorn, V. J. (2022) · Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming · doi:10.1145/3520312.3534862 · Cited by 540
Self-citation
Metadata
- Authors
- Hellendoorn, V. J., & Devanbu, P.
- Affiliations
- University of California, Davis (US)
- University of California at Davis, USA
- Venue
- Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering
- Publisher
- ACM
- Published
- 2017-08-21
- Pages
- 763-773
- OpenAlex
- W2740130862
- Cited by
- 292
- References
- 42
- Citations by year
- 2026: 7 · 2025: 20 · 2024: 25 · 2023: 32 · 2022: 33 · 2021: 54 · 2020: 50 · 2019: 47 · 2018: 22 · 2017: 2
- FWCI
- 25.41
- Type
- conference paper
- Language
- en
- Open access
- closed
- Locations
- ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) (publishedVersion)
- Funders
- NSF (1414172)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Keywords
- cache model, n-gram language models, deep neural network, recurrent neural networks, LSTM
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
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.