Sequence Model Design for Code Completion in the Modern IDE
Not on the map. Why?
Abstract (arXiv)
Code completion plays a prominent role in modern integrated development environments (IDEs). Machine learning has become ubiquitous in analogous natural language writing and search software, surfacing more relevant autocompletions and search suggestions in fewer keystrokes. Prior research has reported training high-accuracy, deep neural networks for modeling source code, but little attention has been given to the practical constraints imposed by interactive developer tools. In particular, neural language models for source code modeling like the one described in Maybe Deep Neural Networks are the Best Choice for Modeling Source Code are framed around code completion, but only report accuracy of next-token prediction. However, in order for a language model (LM) to work well within real-world code completion systems, it must also always make suggestions that produce valid code that typechecks to support code completion's role in correctness-checking; return instantaneous results to help programmers code more efficiently in fewer keystrokes; and be small enough to fit comfortably on disk and in memory on developer workstations, since virtually all modern IDEs run locally and support offline usage. To meet these additional requirements, we propose a novel design for predicting top-k next tokens that combines static analysis' ability to enumerate all valid keywords and in-scope identifiers with the ability of a language model to place a probability distribution over them. Our model mixes character-level input representation with token output to represent out-of-vocabulary (OOV) tokens meaningfully and minimize prediction latency. OOV tokens can be predicted through detection of local repetition common in software. This design achieves state-of-art accuracy in source code modeling and fits the constraints imposed by real-world code completion implementations in modern IDEs.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). First posted on arXiv 10 Apr 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 3; 2022: 3; 2023: 1; 2024: 1.
8 papers.
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
- 2024Does Your Neural Code Completion Model Use My Code? A Membership Inference Approachcited by 9
- 2022All You Need Is Logs: Improving Code Completion by Learning from Anonymous IDE Usage Logscited by 8
- 2023LExecutor: Learning-Guided Executioncited by 7
- 2021Improving Code Autocompletion with Transfer Learningcited by 6
- 2021Toward Less Hidden Cost of Code Completion with Acceptance and Ranking Modelscited by 4
- 2024Does Your Neural Code Completion Model Use My Code? A Membership Inference Approach22 Apr 2024
- 2023LExecutor: Learning-Guided Execution5 Feb 2023
- 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Code2 Jun 2022
- 2022All You Need Is Logs: Improving Code Completion by Learning from Anonymous IDE Usage Logs21 May 2022
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequences14 Feb 2022
- 2021Toward Less Hidden Cost of Code Completion with Acceptance and Ranking Models26 Jun 2021
- 2021Improving Code Autocompletion with Transfer Learning12 May 2021
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphs17 Mar 2021