On the localness of software
The DOI matches its Crossref record; 52 of the 52 references it cites were found in a registry or an index.
Abstract
The n-gram language model, which has its roots in statistical natural language processing, has been shown to successfully capture the repetitive and predictable regularities (“naturalness") of source code, and help with tasks such as code suggestion, porting, and designing assistive coding devices. However, we show in this paper that this natural-language-based model fails to exploit a special property of source code: localness. We find that human-written programs are localized: they have useful local regularities that can be captured and exploited. We introduce a novel cache language model that consists of both an n-gram and an added “cache" component to exploit localness. We show empirically that the additional cache component greatly improves the n-gram approach by capturing the localness of software, as measured by both cross-entropy and suggestion accuracy. Our model’s suggestion accuracy is actually comparable to a state-of-the-art, semantically augmented language model; but it is simpler and easier to implement. Our cache language model requires nothing beyond lexicalization, and thus is applicable to all programming languages.
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 [22]
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 [22]
Citations
Cites
(1992) · doi:10.5555/176313.176316 · Cited by 2,892
A statistical approach to machine translation
Brown, P. F., Cocke, J., Pietra, S. A. D., Pietra, V. J. D., Jelinek, F., Lafferty, J., Mercer, R. L., & Roossin, P. S. (1990) · doi:10.5555/92858.92860 · Cited by 1,655
Estimation of probabilities from sparse data for the language model component of a speech recognizer
Katz, S. (1987) · IEEE Transactions on Acoustics, Speech, and Signal Processing · doi:10.1109/tassp.1987.1165125 · Cited by 1,637
A Maximum Likelihood Approach to Continuous Speech Recognition
Bahl, L. R., Jelinek, F., & Mercer, R. L. (1983) · IEEE Transactions on Pattern Analysis and Machine Intelligence · doi:10.1109/tpami.1983.4767370 · Cited by 1,212
On 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
Self-citationTowards automatically generating summary comments for Java methods
Sridhara, G., Hill, E., Muppaneni, D., Pollock, L., & Vijay-Shanker, K. (2010) · Proceedings of the IEEE/ACM international conference on Automated software engineering · doi:10.1145/1858996.1859006 · Cited by 514 · cited 1×
“on GitHub and BitBucket), software engineering researchers have turned to empirical methods to study the process of developing and maintaining software [11, 27, 38, 40, 42–45, 47, 49].”
MethodSemantic clustering: Identifying topics in source code
Kuhn, A., Ducasse, S., & Gîrba, T. (2007) · Information and Software Technology · doi:10.1016/j.infsof.2006.10.017 · Cited by 496
A cache-based natural language model for speech recognition
Kuhn, R., & De Mori, R. (1990) · IEEE Transactions on Pattern Analysis and Machine Intelligence · doi:10.1109/34.56193 · Cited by 495
Using task context to improve programmer productivity
Kersten, M., & Murphy, G. C. (2006) · Proceedings of the 14th ACM SIGSOFT international symposium on Foundations of software engineering · doi:10.1145/1181775.1181777 · Cited by 452
Dixon, W. J., & Mood, A. M. (1946) · Journal of the American Statistical Association · doi:10.1080/01621459.1946.10501898 · Cited by 422
Research works printed but not linked: 4
- 10.5555/2487085.2487127 · doi:10.5555/2487085.2487127
- M. Broy , F. Deißenböck , and M. Pizka . A holistic approach to software quality at work. In 3WCSQ , 2005 . M. Broy, F. Deißenböck, and M. Pizka. A holistic approach to software quality at work. In 3WCSQ, 2005.
- K. Knight . Bayesian inference with tears . Tutorial Workbook , 2009 . K. Knight. Bayesian inference with tears. Tutorial Workbook, 2009.
- 10.1145/1062455.1062526 · doi:10.1145/1062455.1062526 · Paper page
Cited by
Items 101–200 of 240
Toward a Theory of Causation for Interpreting Neural Code Models
Nader Palacio, D., Velasco, A., Cooper, N., Rodriguez, A., Moran, K., & Poshyvanyk, D. (2024) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2024.3379943 · Cited by 18
“Since then, NCMs have been used for a number of SE tasks such as code completion [3], [15], [39], [40], [41], [42], [43], [44] and translation [4], [9], [45], [46], [47], [48], [49].”
MethodWen, F., Aghajani, E., Nagy, C., Lanza, M., & Bavota, G. (2021) · ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) · doi:10.1109/icse43902.2021.00025 · Cited by 22
A Cross-Project Defect Prediction Model Based on Deep Learning With Self-Attention
Wen, W., Zhang, R., Wang, C., Shen, C., Yu, M., Zhang, S., & Gao, X. (2022) · IEEE Access · doi:10.1109/access.2022.3214536 · Cited by 18
“The semantic information of code plays an important role in the research related to code completion and code defect location [7], [12], [13], [14], [15].”
BackgroundStepwise API usage assistance using n -gram language models
Santos, A. L., Prendi, G., Sousa, H., & Ribeiro, R. (2016) · Journal of Systems and Software · doi:10.1016/j.jss.2016.06.063 · Cited by 21
Are mutants really natural? a study on how "naturalness" helps mutant selection
Jimenez, M., Checkam, T. T., Cordy, M., Papadakis, M., Kintis, M., Traon, Y. L., & Harman, M. (2018) · Proceedings of the ... ACM-IEEE International Symposium on Empirical Software Engineering and Measurement/International Symposium on Empirical Software Engineering and Measurement · doi:10.1145/3239235.3240500 · Cited by 25
“Following the lines of previous work [15, 18, 45], we base our investigations on N-Gram”
BackgroundMethodInfluentialZhu, T., Li, Z., Pan, M., Shi, C., Zhang, T., Pei, Y., & Li, X. (2024) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3631975 · Cited by 18
“Several research works have been conducted to leverage the project-level information and achieve much improvement on software engineering tasks [4, 11, 32, 86].”
BackgroundDeep learning for code generation: a survey
Zhang, H., Zhang, K., Li, Z., Li, J., Li, J., Li, Y., Zhao, Y., Zhu, Y. S., Liu, F., Li, G., et al. (2024) · Science China Information Sciences · doi:10.1007/s11432-023-3956-3 · Cited by 27
“Concretely, programming languages are less natural, but much stronger in locality and structure [191].”
On the Impact of Tokenizer and Parameters on N-Gram Based Code Analysis
Jimenez, M., Cordy, M., Traon, Y. L., & Papadakis, M. (2018) · IEEE International Conference on Software Maintenance (ICSM) · doi:10.1109/icsme.2018.00053 · Cited by 26
“[11] propose a cache model that captures local regularities.”
BackgroundMethodLSTM-based argument recommendation for non-API methods
Li, G., Liu, H., Li, G., Shen, S., & Tang, H. (2020) · Science China Information Sciences · doi:10.1007/s11432-019-2830-8 · Cited by 17
Aligning the Objective of LLM-Based Program Repair
Xu, J., Fu, Y., Tan, S. H., & He, P. (2025) · ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) · doi:10.1109/icse55347.2025.00169 · Cited by 72
“Additionally, although D4C can rank the patches by comparing their naturalness (quantified by perplexity or entropy) [63], [64], a prior study indicates that it is inaccurate to identify the correctness of the program using naturalness [65].”
Can Identifier Splitting Improve Open-Vocabulary Language Model of Code?
Shi, J., Yang, Z., He, J., Xu, B., & Lo, D. (2022) · IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) · doi:10.1109/saner53432.2022.00130 · Cited by 18
Code-line-level Bugginess Identification: How Far have We Come, and How Far have We Yet to Go?
Guo, Z., Liu, S., Liu, X., Lai, W., Ma, M., Zhang, X., Ni, C., Yang, Y., Li, Y., Chen, L., et al. (2023) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3582572 · Cited by 23
“Natural language processing technique has been widely applied for transforming natural language texts into computable values in software engineering [68].”
BackgroundMethodStudying the characteristics of AIOps projects on GitHub
Aghili, R., Li, H., & Khomh, F. (2023) · Empirical Software Engineering · doi:10.1007/s10664-023-10382-z · Cited by 26
“Other works also illustrate that logs are even more predictable and repetitive than natural languages, such as English (He et al. 2018a; Tu et al. 2014; Yao et al. 2020).”
BackgroundOn the Impact of Refactoring Operations on Code Naturalness
Lin, B., Nagy, C., Bavota, G., & Lanza, M. (2019) · IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) · doi:10.1109/saner.2019.8667992 · Cited by 26
“In our study, we adopted the cache language model proposed by Tu et al. [3].”
InfluentialFine-grained code-comment semantic interaction analysis
Geng, M., Wang, S., Dong, D., Gu, S., Peng, F., Ruan, W., & Liao, X. (2022) · IEEE International Conference on Program Comprehension (ICPC) · doi:10.1145/3524610.3527887 · Cited by 20
Khapre, S. P., Singh, P., Shankar, A., Nayak, S. R., & Diwakar, M. (2021) · International Journal of Intelligent Unmanned Systems · doi:10.1108/ijius-07-2021-0055 · Cited by 15
RetractedCORAL: COde RepresentAtion learning with weakly-supervised transformers for analyzing data analysis
Zhang, G., Merrill, M. A., Liu, Y., Heer, J., & Althoff, T. (2022) · EPJ Data Science · doi:10.1140/epjds/s13688-022-00327-9 · Cited by 19
“Early methods for code representational learning treated source code as sequence of tokens and built language models on top [18], [19], [20], [21], [22].”
MethodVulAdvisor: Natural Language Suggestion Generation for Software Vulnerability Repair
Zhang, J., Wang, C., Li, A., Wang, W., Li, T., & Liu, Y. (2024) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3691620.3695555 · Cited by 38
“The localness of source code is originally introduced by Tu et al. [50], where human-written programs are localized and have useful local regularities (e.g., endemic and specific n-grams) that can be captured and exploited.”
InfluentialAutomated variable renaming: are we there yet?
Mastropaolo, A., Aghajani, E., Pascarella, L., & Bavota, G. (2023) · Empirical Software Engineering · doi:10.1007/s10664-022-10274-8 · Cited by 19
“Tu et al. [57] introduced a cache component that exploits code locality in n -gram models to improve their support to code completion.”
BackgroundARist: An effective API argument recommendation approach
Nguyen, S., Tran, C., Tran, K. T., Nguyen, T. M., Nguyen, T.-T., Ngo, K.-T., & Vo, H. D. (2023) · Journal of Systems and Software · doi:10.1016/j.jss.2023.111786 · Cited by 18
A language model for statements of software code
Yang, Y., Jiang, Y., Gu, M., Sun, J., Gao, J., & Liu, H. (2017) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1109/ase.2017.8115678 · Cited by 19
“Recent years have witnessed a class of researches on building language models for source code [2] [13] [5] [8] [9] [4] [1] [10] [11] [6], which enables a large set of promising applications.”
Understanding the syntactic rule usage in java
Qiu, D., Li, B., Barr, E. T., & Su, Z. (2016) · Journal of Systems and Software · doi:10.1016/j.jss.2016.10.017 · Cited by 14
“further studied the localness that human-written programs were localized [43].”
BackgroundSelf-citationGholamian, S., & Ward, P. A. S. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2110.12489 · Cited by 43
“Prior work [249], [250] in software engineering has utilized natural language processing (NLP) for software tasks such as source code next token suggestion.”
MethodAging-Related Bugs Prediction Via Convolutional Neural Network
Liu, Q., Xiang, J., Xu, B., Zhao, D., Hu, W., & Wang, J. (2020) · International Conference on Dependable Systems and Their Applications (DSA) · doi:10.1109/dsa51864.2020.00020 · Cited by 13
An empirical assessment of machine learning approaches for triaging reports of static analysis tools
Yerramreddy, S., Mordahl, A., Koç, U., Wei, S., Foster, J. S., Carpuat, M. J., & Porter, A. (2023) · Empirical Software Engineering · doi:10.1007/s10664-022-10253-z · Cited by 17
“…clone detection (White et al. 2016), API mining (Gu et al. 2016; Fowkes and Sutton 2016), variable naming and renaming (Raychev et al. 2015; Allamanis et al. 2015), code suggestion and completion (Tu et al. 2014; Nguyen et al. 2013; Raychev et al. 2014), and bug detection (Allamanis et al. 2017).”
“More Than Deep Learning”: post-processing for API sequence recommendation
Chen, C., Peng, X., Chen, B., Sun, J., Xing, Z., Wang, X., & Zhao, W. (2021) · Empirical Software Engineering · doi:10.1007/s10664-021-10040-2 · Cited by 13
“Many methods (Hindle et al. 2012; Allamanis and Sutton 2013; Nguyen et al. 2013, 2015, 2018; Tu et al. 2014; Raychev et al. 2014; Liu et al. 2018; White et al. 2015; Dam et al. 2016; Yan et al. 2018; Svyatkovskiy et al. 2019; Li et al. 2018; Terada and Watanobe 2019; Yang et al. 2017, a, b, c; Chen…”
BackgroundMethodHierarchical learning of cross-language mappings through distributed vector representations for code
Bui, N. D. Q., & Jiang, L. (2018) · IEEE/ACM International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER) · doi:10.1145/3183399.3183427 · Cited by 12
“more large-scale evaluations by using Java2CSharp to see how our mappings can help reduce the compilation error rates when compared with StaMiner during actual migration of projects. As described in [20], source code is very localized. Since we treat a whole file as a corpus, which means we ignore the localness of the…”
Deep Learning to Detect Redundant Method CommentsPreprint
Louis, A. P., Dash, S. K., Barr, E. T., & Sutton, C. A. (2018) · arXiv (Cornell University) · doi:10.48550/arxiv.1806.04616 · Cited by 20
“ous tokens ofcontext aresufficient forpredictingeach word.Standard n-gram models do not perform as well as the deep language modelsthatwedescribenext,althoughforcode,theextensionofcache language models [22, 53] are considerably better, and competitive with deep models. Nevertheless, even these cache models are not easil…”
BackgroundAssessing and Analyzing the Correctness of GitHub Copilot's Code Suggestions
Mo, R., Wang, D., Zhan, W., Jiang, Y., Wang, Y., Zhao, Y., Li, Z., & Ma, Y. (2025) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3715108 · Cited by 11
Correctness assessment of code generated by Large Language Models using internal representations
Bui, T.-D., Vu, T. T., Nguyen, T.-T., Nguyen, S., & Vo, H. D. (2025) · Journal of Systems and Software · doi:10.1016/j.jss.2025.112570 · Cited by 48
Do Contexts Help in Phrase-Based, Statistical Source Code Migration?
Nguyen, A. T., Tu, Z., & Nguyen, T. N. (2016) · IEEE International Conference on Software Maintenance (ICSM) · doi:10.1109/icsme.2016.89 · Cited by 14
“ware engineering applications [15], [38], [52].”
MethodSelf-citationHeuristic and Neural Network Based Prediction of Project-Specific API Member Access
Jiang, L. C., Liu, H., Jiang, H., Zhang, L., & Hong, M. (2020) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2020.3017794 · Cited by 11
Towards better program obfuscation: optimization via language models
Liu, H. (2016) · ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) · doi:10.1145/2889160.2891040 · Cited by 11
“Since software is natural [14], people resort to NLP methods for software engineering tasks, such as code completion [14, 16, 22], API prediction [19] and name suggestion [2, 3, 18].”
MethodHellendoorn, V. J., Dévanbu, P., & Alipour, M. A. (2018) · ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) · doi:10.1145/3236024.3264832 · Cited by 10
“only within one file, package or project) [7, 15].”
BackgroundA Nano-Pattern Language for Java
Gil, Y., Marcovitch, O., & Orrù, M. (2019) · Journal of Computer Languages · doi:10.1016/j.cola.2019.100905 · Cited by 9
A hybrid code representation learning approach for predicting method names
Zhang, F., Chen, B., Li, R., & Peng, X. (2021) · Journal of Systems and Software · doi:10.1016/j.jss.2021.111011 · Cited by 13
New Initiative: The Naturalness of Software
Devanbu, P. (2015) · 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering · doi:10.1109/icse.2015.190 · Cited by 9
“We have developed an Eclipse plug-in that uses our localityenhanced cache-based language model [23] to provide suggestions.”
MethodReACC: A Retrieval-Augmented Code Completion Framework
Lu, S., Duan, N., Han, H., Guo, D., Hwang, S.-W., & Svyatkovskiy, A. (2022) · arXiv · doi:10.48550/arxiv.2203.07722 · Cited by 96
“With the growth of software engineering field, large-scale source code corpus gives a chance to train language models in code domain (Hindle et al., 2016; Tu et al., 2014).”
BackgroundMethodOn the Uniqueness of Code Redundancies
Lin, B., Ponzanelli, L., Mocci, A., Bavota, G., & Lanza, M. (2017) · IEEE International Conference on Program Comprehension (ICPC) · doi:10.1109/icpc.2017.36 · Cited by 13
“[9] enriched the language model with a cache exploiting a specific localness of software, i.”
BackgroundMethodHussain, Y., Huang, Z., & Zhou, Y. (2021) · IET Software · doi:10.1049/sfw2.12017 · Cited by 10
“Similarly, Franks et al. [10] have proposed an eclipse plugin (CACHECA) that combines the default suggestions with suggestions returned by a cache language model [4].”
BackgroundMethodNew Initiative: The Naturalness of Software
Dévanbu, P. (2015) · Cited by 9
Deep-AutoCoder: Learning to Complete Code Precisely with Induced Code Tokens
Hu, X., Men, R., Li, G., & Jin, Z. G. (2019) · IEEE Annual International Computer Software and Applications Conference (COMPSAC) · doi:10.1109/compsac.2019.00030 · Cited by 10
“Due to its simplicity and efficient learning, it is applied to code completion task [14, 15, 16, 23].”
Towards Full-line Code Completion with Neural Language ModelsPreprint
Wang, W., Shen, S., Li, G., & Jin, Z. G. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2009.08603 · Cited by 24
“(Tu, Su, and Devanbu 2014) pointed out that source code has a unique property of ”localness,” which could not be captured by the traditional N-gram model.”
Do bugs lead to unnaturalness of source code?
Jiang, Y., Liu, H., Zhang, Y., Ji, W., Zhong, H., & Zhang, L. (2022) · ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) · doi:10.1145/3540250.3549149 · Cited by 16
“Our empirical study depends on a single entropy model [42, 44].”
MethodInfluentialImproving Code Recommendations by Combining Neural and Classical Machine Learning Approaches
Schumacher, M., Le, K. T., & Andrzejak, A. (2020) · doi:10.1145/3387940.3391489 · Cited by 8
“Inspired by the localness of software hypothesis, which states that source code is locally repeated [14], Pointer Networks is proposed to reduce the problem of static output vocabularies by predicting tokens from the input sequence [7].”
MethodExploring Type Inference Techniques of Dynamically Typed Languages
Saifullah, C. M. K., Asaduzzaman, M., & Roy, C. K. (2020) · IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) · doi:10.1109/saner48275.2020.9054814 · Cited by 9
“First, the context contains locally specific code tokens which are inspired by the principle of naturalness [37] and localness [38] properties of the source code.”
BackgroundEntropy Guided Spectrum Based Bug Localization Using Statistical Language Model
Chakraborty, S., Li, Y., Irvine, M., Saha, R., & Ray, B. (2018) · arXiv · doi:10.48550/arxiv.1802.06947 · Cited by 7
Pre-implementation Method Name Prediction for Object-oriented Programming
Wang, S., Wen, M., Lin, B., Liu, Y., Bissyandé, T. F., & Mao, X. (2023) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3597203 · Cited by 11
“Allamanis et al. [12] introduced a language model for source code that can project code token into a vectorial space and then select the name whose resulted embedding is similar to that of the method body.”
InfluentialDeepCNN: A Dual Approach to Fault Localization and Repair in Convolutional Neural Networks
Wardat, M., & Al-Alaj, A. (2024) · IEEE Access · doi:10.1109/access.2024.3384981 · Cited by 11
Dependency-Aware Code Naturalness
Yang, C., Chen, J., Jiang, J., & Huang, Y. (2024) · Proceedings of the ACM on Programming Languages · doi:10.1145/3689794 · Cited by 11
“Tu et al. [Tu et al. 2014] incorporated a cache model to exploit localness of source code for measuring code naturalness more precisely.”
InfluentialOn the Naturalness and Localness of Software Logs
Gholamian, S., & Ward, P. A. S. (2021) · International Conference on Mining Software Repositories (MSR) · doi:10.1109/msr52588.2021.00028 · Cited by 14
“Authors in [41] and later in [64] showed that n-gram language models perform well in the source code’s modeling and leveraged this fact to propose a”
BackgroundMethodResultInfluentialYang, Y., Chen, X., & Sun, J. (2019) · International Journal of Software Engineering and Knowledge Engineering · doi:10.1142/s0218194019400229 · Cited by 6
Do Programmers Prefer Predictable Expressions in Code?
Casalnuovo, C., Lee, K., Wang, H., Dévanbu, P., & Morgan, E. (2020) · Cognitive Science · doi:10.1111/cogs.12921 · Cited by 18
“Cache language models also exploit this effect of local repetition; subsequent examples of patterns in the same file are easier to predict Tu et al. (2014); Hellendoorn and Devanbu (2017). were more likely to be accepted by team members.”
BackgroundMethodInfluentialTailored Mutants Fit Bugs BetterPreprint
Allamanis, M., Barr, E. T., Just, R., & Sutton, C. A. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1611.02516 · Cited by 17
“Later, others [25], [26], [27], [28] made improvements to the language models of code.”
BackgroundRepoformer: Selective Retrieval for Repository-Level Code Completion
Wu, D., Ahmad, W. U., Zhang, D., Ramanathan, M. K., & Ma, X. (2024) · arXiv · doi:10.48550/arxiv.2403.10059 · Cited by 7
“Early works propose application-specific training methods for n-gram LMs (Tu et al., 2014), RNNs (Hellendoorn & Devanbu, 2017; Wang et al., 2021), and Transformers (Svyatkovskiy et al., 2020) to leverage structured knowledge beyond current file’s context.”
BackgroundMethodFLAG: F inding L ine A nomalies (in RTL code) with G enerative AI
Ahmad, B., Ah-kiow, J., Tan, B., Karri, R., & Pearce, H. A. (2025) · ACM Transactions on Design Automation of Electronic Systems · doi:10.1145/3736411 · Cited by 10
Time-Efficient Code Completion Model for the R Programming Language
Popov, A., Orekhov, D., Litvinov, D., Korolev, N., & Morgachev, G. (2021) · doi:10.18653/v1/2021.nlp4prog-1.4 · Cited by 7
“The statistical language model is used to rank a set of possible completions extracted by the rule-based methods (Tu et al., 2014).”
MethodA graph sequence neural architecture for code completion with semantic structure features
Yang, K., Yu, H., Fan, G., Yang, X., & Huang, Z. (2021) · Journal of Software Evolution and Process · doi:10.1002/smr.2414 · Cited by 6
“Equations (3) and (4) are the update gates z and reset gates r, which σ is the sigmoid function σðxÞ1⁄41=ð1þe xÞ, and is element-wise multiplication in Equation (5).”
BackgroundPARC: Recommending API methods parameters
Asaduzzaman, M., Roy, C. K., & Schneider, K. A. (2015) · IEEE International Conference on Software Maintenance (ICSM) · doi:10.1109/icsm.2015.7332481 · Cited by 7
“This matches with the finding of Tu et al. [9].”
ResultCleaning StackOverflow for Machine Translation
Rahman, M., Rigby, P. C., Palani, D., & Nguyen, T. N. (2019) · International Conference on Mining Software Repositories (MSR) · doi:10.1109/msr.2019.00021 · Cited by 7
“Many works have shown that code is repetitive and predictable [12, 36], we show that the English discussions of code are also repetitive.”
BackgroundZhang, J., Liu, S., Luo, J., Liang, J., & Huang, Z. (2020) · IEEE Access · doi:10.1109/access.2020.3013694 · Cited by 7
Research and Application of Machine Learning in Automatic Program Generation
Zhang, X., & Jiang, Y. (2020) · Chinese Journal of Electronics · doi:10.1049/cje.2020.10.006 · Cited by 7
What Distributed Systems Say: A Study of Seven Spark Application Logs
Gholamian, S., & Ward, P. A. S. (2021) · IEEE Symposium on Reliable Distributed Systems (SRDS) · doi:10.1109/srds53918.2021.00030 · Cited by 12
Optimized Tokenization Process for Open-Vocabulary Code Completion: An Empirical Study
Hussain, Y., Huang, Z., Zhou, Y., Khan, I. A., Khan, N., & Abbas, M. Z. (2023) · International Conference on Evaluation and Assessment in Software Engineering (EASE) · doi:10.1145/3593434.3594236 · Cited by 8
Federated learning based multi‐task feature fusion framework for code expressive semantic extraction
Deng, F., Fu, C., Qian, Y., Yang, J., He, S., & Xu, H. (2022) · Software Practice and Experience · doi:10.1002/spe.3094 · Cited by 5
“Based on this study, Hellendoorn et al. 26 and Tu et al. 27 use statistical models, such as N-gram, to model the source code.”
MethodA Deep Learning Based Model for Defect Prediction in Intra-Project Software
Sekaran, K., & Annabel, L. S. P. (2023) · International Conference on Trends in Electronics and Informatics (ICOEI) · doi:10.1109/icoei56765.2023.10126014 · Cited by 6
Toward refactoring evaluation with code naturalness
Arima, R., Higo, Y., & Kusumoto, S. (2018) · IEEE International Conference on Program Comprehension (ICPC) · doi:10.1145/3196321.3196362 · Cited by 5
“In this research, we use the model proposed in literature [9].”
MethodCapturing Structural Locality in Non-parametric Language ModelsPreprint
Xu, F. F., He, J., Neubig, G., & Hellendoorn, V. J. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2110.02870 · Cited by 9
PERSONA: A personalized model for code recommendation
Nguyen, T. T., & Nguyen, T. T. (2021) · PLoS ONE · doi:10.1371/journal.pone.0259834 · Cited by 7
“[15] introduced C ACHE LM, a novel cache language model that consists of both an n -gram and an added “cache” component to exploit localness.”
MethodResultInfluentialTowards automatically identifying the co‐change of production and test code
Huang, Y., Tang, Z., Chen, X., & Zhou, X. (2024) · Software Testing Verification and Reliability · doi:10.1002/stvr.1870 · Cited by 4
“To capture the naturalness feature, we employ the code entropy to measure it by using the cache-based language model 5 proposed by Tu et al. [14].”
MethodCognification of Program Synthesis—A Systematic Feature-Oriented Analysis and Future Direction
Subahi, A. F. (2020) · Computers · doi:10.3390/computers9020027 · Cited by 4
CCMC: Code Completion with a Memory Mechanism and a Copy Mechanism
Yang, H., & Kuang, L. (2021) · International Conference on Evaluation and Assessment in Software Engineering (EASE) · doi:10.1145/3463274.3463332 · Cited by 5
“N-gram is one of the most widely used language models in code completion[12, 13, 25].”
MethodCombining Contexts from Multiple Sources for Documentation-Specific Code Example Generation
Khan, J. Y., & Uddin, G. (2023) · IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) · doi:10.1109/saner56733.2023.00071 · Cited by 11
“Primarily, some n-gram based models have been proposed for code suggestion or auto-completion [25], [39].”
BackgroundExploring and Improving Code Completion for Test Code
Zhu, T., Liu, Z., Xu, T., Tang, Z. J., Zhang, T., Pan, M., & Xia, X. (2024) · IEEE International Conference on Program Comprehension (ICPC) · doi:10.1145/3643916.3644421 · Cited by 11
Deep Representations for Software Engineering
White, M. (2015) · ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) · doi:10.1109/icse.2015.248 · Cited by 8
“[10]—good quality language models show great promise in SE applications.”
BackgroundRecommendation of Exception Handling Code in Mobile App DevelopmentPreprint
Nguyen, T. T., Vu, P. M., & Nguyen, T. T. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1908.06567 · Cited by 7
“Statistical language models have been successfully used to capture patterns in source code [36], [37], [38], [39], [40], [10].”
MethodLanguage Modelling for Source Code with Transformer-XLPreprint
Dowdell, T., & Zhang, H. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2007.15813 · Cited by 9
“en the previous tokens from x1 to xt−1, i.e. maxθP(xt |xt−1,xt−2,...,xt−1,θ), where θare the trainable model variables. Multiple language models for source code have already been introduced [15] [22] [28]. A classical language modeling method is the N-gram model. Recent research uses RNNbased models (including LSTM an…”
MethodZhou, Y., Tang, H., Zhu, L., Ding, H., & Qian, J. (2025) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3707456 · Cited by 3
“The second category employs natural language processing (NLP) techniques [22], wherein statistical language models, like n-gram, assess the “naturalness” or suspicion score of source code.”
InfluentialBoosting Redundancy-Based Automated Program Repair by Fine-Grained Pattern Mining
Jiang, J., Li, F., Zhao, Z., Ye, Z., Liu, M., Wang, B., Zhang, H., & Chen, J. (2025) · IEEE International Conference on Software Maintenance (ICSM) · doi:10.1109/icsme64153.2025.00018 · Cited by 5
“Specifically, the basic idea of our approach is that fine-grained code elements related to similar code semantics tend to co-appear nearby in the program , which has been well-studied by existing research [36]–[39].”
Khan, H. A., Jiang, Y., Umer, Q., Zhang, Y., Akram, W., & Liu, H. (2025) · Proceedings of the ACM on software engineering. · doi:10.1145/3715765 · Cited by 4
“The approach heavily depends on the naturalness of the source code, and measures the naturalness of source code with the equations proposed by Tu et al. [41] for code completion models.”
InfluentialNatural Language Processing Techniques for Code Generation
Sellik, H. (2019) · Research Repository (Delft University of Technology) · Cited by 4
AdaComplete: improve DL-based code completion method’s domain adaptability
Wang, Z., Liu, F., Hao, Y., & Jin, Z. G. (2023) · Automated Software Engineering · doi:10.1007/s10515-023-00376-y · Cited by 4
A Multiple-Path Learning Neural Network Model for Code Completion
Liu, Y., Liu, J., Zhang, X., & Hu, H. (2023) · IEEE International Conference on Web Services (ICWS) · doi:10.1109/icws60048.2023.00042 · Cited by 5
“Traditional code completion methods are more appropriate for statically-typed programming languages rather than for dynamically-typed programming languages since they mainly rely on type information generated at compile time to predict the next token [2], [3].”
BackgroundMethodExploring the Impact of Vocabulary Techniques on Code Completion: A Comparative Approach
Hussain, Y., Huang, Z., Zhou, Y., & Khan, I. A. (2023) · International Journal of Software Engineering and Knowledge Engineering · doi:10.1142/s0218194023500687 · Cited by 3
Towards Framework-Independent, Non-Intrusive Performance Characterization for Dataflow Computation
Tian, H., Weng, Q., & Wang, W. (2019) · ACM SIGOPS Asia-Pacific Workshop on Systems (APSys) · doi:10.1145/3343737.3343743 · Cited by 3
“Note that the models trained on certain programming languages can be reused by the other frameworks or languages, as language models have a transferable [11, 27] nature, and the program code statistically resembles natural language [25, 44].”
BackgroundImproving Fitness Function for Language Fuzzing with PCFG Model
Sun, X., Fu, Y. V., Dong, Y., Liu, Z., & Zhang, Y. (2018) · IEEE Annual International Computer Software and Applications Conference (COMPSAC) · doi:10.1109/compsac.2018.00098 · Cited by 4
“The Markov model can model interesting properties of program by assuming that current statement depends on previous K elements [26].”
BackgroundA Neural Language Model with a Modified Attention Mechanism for Software Code
Zhang, X., & Ben, K. (2018) · IEEE International Conference on Software Engineering and Service Science (ICSESS) · doi:10.1109/icsess.2018.8663962 · Cited by 4
“921 perplexity, with remarkable improvements than the scores of ngram [2], Cache LM [3] (an improved n-gram model), and DeepSoft [5] (a neural language model).”
BackgroundMethodInfluentialStatistical API Completion Based on Code Relevance Mining
Wang, C., Yang, Y., Liu, H., & Kang, L. (2019) · doi:10.1109/maint.2019.8666939 · Cited by 3
“Recent years has witnessed a huge progress on building language models for code prediction [2] [3] [4] [5].”
BackgroundMethodDeep representations for software engineering
White, M. (2015) · doi:10.5555/2819009.2819166 · Cited by 3
On the "Naturalness" of Buggy CodePreprint
Ray, B., Hellendoorn, V. J., Godhane, S., Tu, Z., Bacchelli, A., & Dévanbu, P. (2015) · arXiv (Cornell University) · doi:10.48550/arxiv.1506.01159 · Cited by 5
“’s cache-based language model ($gram) tool [53], as described in Section 2.”
BackgroundMethodInfluentialSelf-citationCombining Code Embedding with Static Analysis for Function-Call CompletionPreprint
Weyssow, M., Sahraoui, H. A., Frénay, B., & Vanderose, B. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2008.03731 · Cited by 7
Embedding Code Contexts for Cryptographic API Suggestion:New Methodologies and ComparisonsPreprint
Xiao, Y., Ahmed, S., Song, W., Ge, X., Viswanath, B., & Yao, D. D. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2103.08747 · Cited by 6
“Many studies validated the naturalness of code sequences [5, 24, 25, 39, 40, 46], which inspires a line of work to build language models for code completion/suggestion tasks [9, 10, 12, 42, 44, 47].”
BackgroundAn Empirical Study on the Relationship between Defects and Source Code’s Unnaturalness
Jiang, Y., Liu, H., Liu, J., Zhang, Y., Ji, W., Zhong, H., & Zhang, L. (2025) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3718083 · Cited by 3
Data-Driven Decisions and Actions in Today’s Software Development
Gall, H. C., Alexandru, C. V., Ciurumelea, A., Grano, G., Laaber, C., Panichella, S., Proksch, S., Schermann, G., Vassallo, C., & Zhao, J. (2018) · Springer eBooks · doi:10.1007/978-3-319-73897-0_9 · Cited by 2
“Tu et al. [120] analyze the limitation of previous models in capturing local regularities that are highly typical for human written programs and build a cache language model, that further improves the code suggestion accuracy of previous work.”
BackgroundRecommending Variable Names for Extract Local Variable Refactorings
Wang, T., Liu, H., Zhang, Y., & Jiang, Y. (2025) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3712191 · Cited by 3
Adaptive Code Completion with Meta-learning
Fang, L., Huang, Z., Zhou, Y., & Chen, T. (2020) · Asia-Pacific Symposium on Internetware · doi:10.1145/3457913.3457933 · Cited by 2
“In related work [5, 28], MRR is often used to evaluate code completion results.”
BackgroundMethodInfluentialEnhancing Code Completion with Implicit Feedback
Jin, H., Zhou, Y., & Hussain, Y. (2023) · IEEE International Conference on Software Quality, Reliability and Security (QRS) · doi:10.1109/qrs60937.2023.00030 · Cited by 2
“To overcome this limitation, researchers have proposed various modifications to the N-gram model, such as adding a cache mechanism [39] or considering unlimited vocabulary, nested scope, locality, and dynamism [35].”
BackgroundMethodYang, Y. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2003.08080 · Cited by 3
“Cacheca [11] confirms the localness of source code and proposes a cache model to improve the code suggestion performance.”
BackgroundHolistic Combination of Structural and Textual Code Information for Context based API RecommendationPreprint
Chen, C., Peng, X., Xing, Z., Sun, J., Wang, X., Zhao, Y., & Zhao, W. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2010.07514 · Cited by 2
“Tu et al. [4] enhance the n-gram model with a cache to capture the localized regularities in the source code to improve the accuracy.”
MethodBorrowing from Similar Code: A Deep Learning NLP-Based Approach for Log Statement AutomationPreprint
Gholamian, S., & Ward, P. A. S. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2112.01259 · Cited by 5
“Prior research [11, 32, 40, 69] has shown that software systems are even more predictable and repetitive than common English, and language models perform better on software engineering tasks than English text; tasks such as code completion [61] and suggestion [16].”
Method
Metadata
- Authors
- Tu, Z., Su, Z., & Devanbu, P.
- Affiliations
- University of California, Davis (US)
- University of California at Davis, USA
- Venue
- Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering
- Publisher
- ACM
- Published
- 2014-11-11
- Pages
- 269-280
- OpenAlex
- W2165747537
- Cited by
- 238
- References
- 52
- Citations by year
- 2026: 4 · 2025: 14 · 2024: 16 · 2023: 21 · 2022: 16 · 2021: 27 · 2020: 33 · 2019: 29 · 2018: 26 · 2017: 9 · 2016: 23 · 2015: 20
- FWCI
- 14.79
- 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
- National Science Foundation
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
- Keywords
- n-gram language models, source code, localness, code completion, lexicalization, cross-entropy
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.