An Empirical Study on the Usage of Transformer Models for Code Completion
Not on the map. Why?
Abstract (arXiv)
Code completion aims at speeding up code writing by predicting the next code token(s) the developer is likely to write. Works in this field focused on improving the accuracy of the generated predictions, with substantial leaps forward made possible by deep learning (DL) models. However, code completion techniques are mostly evaluated in the scenario of predicting the next token to type, with few exceptions pushing the boundaries to the prediction of an entire code statement. Thus, little is known about the performance of state-of-the-art code completion approaches in more challenging scenarios in which, for example, an entire code block must be generated. We present a large-scale study exploring the capabilities of state-of-the-art Transformer-based 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). We experimented with several variants of two recently proposed Transformer-based models, namely RoBERTa and the Text-To-Text Transfer Transformer (T5), for the task of code completion. The achieved results show that Transformer-based models, and in particular the T5, represent a viable solution for code completion, with perfect predictions ranging from ~29%, obtained when asking the model to guess entire blocks, up to ~69%, 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 3 Aug 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 1; 2023: 9; 2024: 6; 2025: 2; 2026: 3.
22 papers.
Sort:
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languagescited by 30
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Codecited by 14
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 13
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 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
- 2024Investigating the Performance of Language Models for Completing Code in Functional Programming Languages: a Haskell Case Studycited by 7
- 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generationcited by 3
- 2023DSHGT: Dual-Supervisors Heterogeneous Graph Transformer -- A pioneer study of using heterogeneous graph learning for detecting software vulnerabilitiescited by 2
10 more
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositoriescited by 2
- 2021FACOS: Finding API Relevant Contents on Stack Overflow with Semantic and Syntactic Analysiscited by 1
- 2023Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We?cited by 1
- 2024The Rise and Fall(?) of Software Engineeringcited by 1
- 2024Software Model Evolution with Large Language Models: Experiments on Simulated, Public, and Industrial Datasetscited by 1
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Codecited by 1
- 2023Towards Automatic Support of Software Model Evolution with Large Language~Modelscited by 0
- 2025Toward Explaining Large Language Models in Software Engineering Taskscited by 0
- 2026Towards Comprehensive Benchmarking Infrastructure for LLMs In Software Engineeringcited by 0
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Studycited by 0
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositories2 Jul 2026
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Study30 Jan 2026
- 2026Towards Comprehensive Benchmarking Infrastructure for LLMs In Software Engineering28 Jan 2026
- 2025Toward Explaining Large Language Models in Software Engineering Tasks23 Dec 2025
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Code10 Feb 2025
- 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Study25 Dec 2024
- 2024Software Model Evolution with Large Language Models: Experiments on Simulated, Public, and Industrial Datasets25 Jun 2024
- 2024The Rise and Fall(?) of Software Engineering14 Jun 2024
- 2024Investigating the Performance of Language Models for Completing Code in Functional Programming Languages: a Haskell Case Study22 Mar 2024
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generation29 Feb 2024
- 2024Language Models for Code Completion: A Practical Evaluation25 Feb 2024
- 2023Towards Automatic Support of Software Model Evolution with Large Language~Models19 Dec 2023
10 more
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Code23 Aug 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We?17 Aug 2023
- 2023DSHGT: Dual-Supervisors Heterogeneous Graph Transformer -- A pioneer study of using heterogeneous graph learning for detecting software vulnerabilities2 Jun 2023
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?2 Jun 2023
- 2023Enriching Source Code with Contextual Data for Code Completion Models: An Empirical Study24 Apr 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
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languages5 Apr 2022
- 2021FACOS: Finding API Relevant Contents on Stack Overflow with Semantic and Syntactic Analysis14 Nov 2021
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languagescited by 30
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Codecited by 14
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 13
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 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
- 2024Investigating the Performance of Language Models for Completing Code in Functional Programming Languages: a Haskell Case Studycited by 7
- 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generationcited by 3
- 2023DSHGT: Dual-Supervisors Heterogeneous Graph Transformer -- A pioneer study of using heterogeneous graph learning for detecting software vulnerabilitiescited by 2
12 most cited of 22 All 22 (JSON)
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositories2 Jul 2026
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Study30 Jan 2026
- 2026Towards Comprehensive Benchmarking Infrastructure for LLMs In Software Engineering28 Jan 2026
- 2025Toward Explaining Large Language Models in Software Engineering Tasks23 Dec 2025
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Code10 Feb 2025
- 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Study25 Dec 2024
- 2024Software Model Evolution with Large Language Models: Experiments on Simulated, Public, and Industrial Datasets25 Jun 2024
- 2024The Rise and Fall(?) of Software Engineering14 Jun 2024
- 2024Investigating the Performance of Language Models for Completing Code in Functional Programming Languages: a Haskell Case Study22 Mar 2024
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generation29 Feb 2024
- 2024Language Models for Code Completion: A Practical Evaluation25 Feb 2024
- 2023Towards Automatic Support of Software Model Evolution with Large Language~Models19 Dec 2023
12 newest of 22 All 22 (JSON)