Toward Less Hidden Cost of Code Completion with Acceptance and Ranking Models
Not on the map. Why?
Abstract (arXiv)
Code completion is widely used by software developers to provide coding suggestions given a partially written code snippet. Apart from the traditional code completion methods, which only support single token completion at minimal positions, recent studies show the ability to provide longer code completion at more flexible positions. However, such frequently triggered and longer completion results reduce the overall precision as they generate more invalid results. Moreover, different studies are mostly incompatible with each other. Thus, it is vital to develop an ensemble framework that can combine results from multiple models to draw merits and offset defects of each model. This paper conducts a coding simulation to collect data from code context and different code completion models and then apply the data in two tasks. First, we introduce an acceptance model which can dynamically control whether to display completion results to the developer. It uses simulation features to predict whether correct results exist in the output of these models. Our best model reduces the percentage of false-positive completion from 55.09% to 17.44%. Second, we design a fusion ranking scheme that can automatically identify the priority of the completion results and reorder the candidates from multiple code completion models. This scheme is flexible in dealing with various models, regardless of the type or the length of their completion results. We integrate this ranking scheme with two frequency models and a GPT-2 styled language model, along with the acceptance model to yield 27.80% and 37.64% increase in TOP1 and TOP5 accuracy, respectively. In addition, we propose a new code completion evaluation metric, Benefit-Cost Ratio(BCR), taking into account the benefit of keystrokes saving and hidden cost of completion list browsing, which is closer to real coder experience scenario.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 19 of its 41 references that are in the map. First posted on arXiv 26 Jun 2021.
Builds on
19 of 41 references.
References · 19
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,471
- 2020AutoGluon-Tabular: Robust and Accurate AutoML for Structured Datacited by 368
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2020IntelliCode Compose: Code Generation Using Transformercited by 225
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 90
- 2018Generative Code Modeling with Graphscited by 59
- 2019Pythia: AI-assisted Code Completion Systemcited by 54
7 more
- 2017Code Completion with Neural Attention and Pointer Networkscited by 49
- 2016Deep API Learningcited by 41
- 2020Fast and Memory-Efficient Neural Code Completioncited by 38
- 2018A General Path-Based Representation for Predicting Program Propertiescited by 28
- 2019A Self-Attentional Neural Architecture for Code Completion with Multi-Task Learningcited by 18
- 2020Sequence Model Design for Code Completion in the Modern IDEcited by 8
- 2015Parameter-Free Probabilistic API Mining across GitHubcited by 2
Built on by
Citing papers per year: 2023: 1; 2024: 1; 2025: 2.
4 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
- 2025Towards Mitigating API Hallucination in Code Generated by LLMs with Hierarchical Dependency Awarecited by 6
- 2025TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions in IDEscited by 0
- 2025TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions in IDEs4 Aug 2025
- 2025Towards Mitigating API Hallucination in Code Generated by LLMs with Hierarchical Dependency Aware8 May 2025
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generation13 May 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023