An Empirical Study on the Usage of BERT Models for Code Completion
Code completion is one of the main features of modern Integrated Development Environments (IDE). 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.
Tue 18 MayDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
10:00 - 10:50 | ML and Deep LearningTechnical Papers / Data Showcase / Registered Reports at MSR Room 2 Chair(s): Hongyu Zhang The University of Newcastle | ||
10:01 4mTalk | Fast and Memory-Efficient Neural Code Completion Technical Papers Alexey Svyatkovskiy Microsoft, Sebastian Lee University of Oxford, Anna Hadjitofi Alan Turing Institute, Maik Riechert Microsoft Research, Juliana Franco Microsoft Research, Miltiadis Allamanis Microsoft Research, UK Pre-print Media Attached | ||
10:05 4mResearch paper | Comparative Study of Feature Reduction Techniques in Software Change Prediction Technical Papers Ruchika Malhotra Delhi Technological University, Ritvik Kapoor Delhi Technological University, Deepti Aggarwal Delhi Technological University, Priya Garg Delhi Technological University Pre-print | ||
10:09 4mTalk | An Empirical Study on the Usage of BERT Models for Code Completion Technical Papers Matteo Ciniselli Università della Svizzera Italiana, Nathan Cooper William & Mary, Luca Pascarella Delft University of Technology, Denys Poshyvanyk College of William & Mary, Massimiliano Di Penta University of Sannio, Italy, Gabriele Bavota Software Institute, USI Università della Svizzera italiana Pre-print | ||
10:13 3mTalk | ManyTypes4Py: A benchmark Python dataset for machine learning-based type inference Data Showcase Amir Mir Delft University of Technology, Evaldas Latoskinas Delft University of Technology, Georgios Gousios Facebook & Delft University of Technology Pre-print | ||
10:16 3mTalk | KGTorrent: A Dataset of Python Jupyter Notebooks from Kaggle Data Showcase Luigi Quaranta University of Bari, Italy, Fabio Calefato University of Bari, Filippo Lanubile University of Bari | ||
10:19 3mTalk | Exploring the relationship between performance metrics and cost saving potential of defect prediction models Registered Reports Steffen Herbold University of Göttingen Pre-print | ||
10:22 28mLive Q&A | Discussions and Q&A Technical Papers |
Go directly to this room on Clowdr