An Empirical Study on the Usage of BERT Models for Code Completion
Not on the map. Why?
Abstract (arXiv)
Code completion is one of the main features of modern Integrated Development Environments (IDEs). Its objective is to speed up code writing by predicting the next code token(s) the developer is likely to write. Research in this area has substantially bolstered the predictive performance of these techniques. However, the support to developers is still limited to the prediction of the next few tokens to type. In this work, we take a step further in this direction by presenting a large-scale empirical study aimed at exploring the capabilities of state-of-the-art deep learning (DL) models in supporting code completion at different granularity levels, including single tokens, one or multiple entire statements, up to entire code blocks (e.g., the iterated block of a for loop). To this aim, we train and test several adapted variants of the recently proposed RoBERTa model, and evaluate its predictions from several perspectives, including: (i) metrics usually adopted when assessing DL generative models (i.e., BLEU score and Levenshtein distance); (ii) the percentage of perfect predictions (i.e., the predicted code snippets that match those written by developers); and (iii) the "semantic" equivalence of the generated code as compared to the one written by developers. The achieved results show that BERT models represent a viable solution for code completion, with perfect predictions ranging from ~7%, obtained when asking the model to guess entire blocks, up to ~58%, reached in the simpler scenario of few tokens masked from the same code statement.
Key facts. Cited by 22 papers in the map (data through 7 Oct 2026). First posted on arXiv 12 Mar 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 3; 2023: 9; 2024: 6; 2025: 3.
22 papers.
Sort:
By area:
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2023From Copilot to Pilot: Towards AI Supported Software Developmentcited by 14
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Codecited by 14
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 2021Energy-Based Models for Code Generation under Compilability Constraintscited by 10
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanationscited by 10
- 2023Evaluating and Explaining Large Language Models for Code Using Syntactic Structurescited by 9
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generationcited by 9
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-trainingcited by 8
- 2023Enriching Source Code with Contextual Data for Code Completion Models: An Empirical Studycited by 7
- 2023On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Codecited by 7
- 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6
10 more
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generationcited by 4
- 2022NeuDep: Neural Binary Memory Dependence Analysiscited by 3
- 2023Transformer-based approaches to Sentiment Detectioncited by 3
- 2024PhishLang: A Real-Time, Fully Client-Side Phishing Detection Framework Using MobileBERTcited by 3
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applicationscited by 2
- 2023Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We?cited by 1
- 2025LLM-driven Effective Knowledge Tracing by Integrating Dual-channel Difficultycited by 1
- 2025Imitation Game: Reproducing Deep Learning Bugs Leveraging an Intelligent Agentcited by 1
- 2024Follow-Up Questions Improve Documents Generated by Large Language Modelscited by 0
- 2025Mapping the Trust Terrain: LLMs in Software Engineering -- Insights and Perspectivescited by 0
- 2025Imitation Game: Reproducing Deep Learning Bugs Leveraging an Intelligent Agent17 Dec 2025
- 2025Mapping the Trust Terrain: LLMs in Software Engineering -- Insights and Perspectives18 Mar 2025
- 2025LLM-driven Effective Knowledge Tracing by Integrating Dual-channel Difficulty27 Feb 2025
- 2024PhishLang: A Real-Time, Fully Client-Side Phishing Detection Framework Using MobileBERT11 Aug 2024
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanations12 Jul 2024
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generation7 Jul 2024
- 2024Follow-Up Questions Improve Documents Generated by Large Language Models27 Jun 2024
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation3 May 2024
- 2024Language Models for Code Completion: A Practical Evaluation25 Feb 2024
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Code23 Aug 2023
- 2023Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We?17 Aug 2023
- 2023Evaluating and Explaining Large Language Models for Code Using Syntactic Structures7 Aug 2023
10 more
- 2023On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Code6 May 2023
- 2023Enriching Source Code with Contextual Data for Code Completion Models: An Empirical Study24 Apr 2023
- 2023Transformer-based approaches to Sentiment Detection13 Mar 2023
- 2023From Copilot to Pilot: Towards AI Supported Software Development7 Mar 2023
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-training8 Feb 2023
- 2023Toward a Theory of Causation for Interpreting Neural Code Models7 Feb 2023
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applications18 Dec 2022
- 2022NeuDep: Neural Binary Memory Dependence Analysis4 Oct 2022
- 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detection25 Feb 2022
- 2021Energy-Based Models for Code Generation under Compilability Constraints9 Jun 2021
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2023From Copilot to Pilot: Towards AI Supported Software Developmentcited by 14
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Codecited by 14
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 2021Energy-Based Models for Code Generation under Compilability Constraintscited by 10
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanationscited by 10
- 2023Evaluating and Explaining Large Language Models for Code Using Syntactic Structurescited by 9
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generationcited by 9
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-trainingcited by 8
- 2023Enriching Source Code with Contextual Data for Code Completion Models: An Empirical Studycited by 7
- 2023On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Codecited by 7
- 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6
12 most cited of 20 All 20 (JSON)
- 2025Mapping the Trust Terrain: LLMs in Software Engineering -- Insights and Perspectives18 Mar 2025
- 2025LLM-driven Effective Knowledge Tracing by Integrating Dual-channel Difficulty27 Feb 2025
- 2024PhishLang: A Real-Time, Fully Client-Side Phishing Detection Framework Using MobileBERT11 Aug 2024
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanations12 Jul 2024
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generation7 Jul 2024
- 2024Follow-Up Questions Improve Documents Generated by Large Language Models27 Jun 2024
- 2024Language Models for Code Completion: A Practical Evaluation25 Feb 2024
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Code23 Aug 2023
- 2023Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We?17 Aug 2023
- 2023Evaluating and Explaining Large Language Models for Code Using Syntactic Structures7 Aug 2023
- 2023On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Code6 May 2023
- 2023Enriching Source Code with Contextual Data for Code Completion Models: An Empirical Study24 Apr 2023
12 newest of 20 All 20 (JSON)