A Transformer-Based Approach for Smart Invocation of Automatic Code Completion

Aral de Moor, Arie van Deursen, Maliheh Izadi
5/23/2024
cs.SEcs.AIcs.HC

No official code found. Best implementation: AISE-TUDelft/curating-code-completions (1 star, last commit 2024-06-19).

Abstract

Transformer-based language models are highly effective for code completion, with much research dedicated to enhancing the content of these completions. Despite their effectiveness, these models come with high operational costs and can be intrusive, especially when they suggest too often and interrupt developers who are concentrating on their work. Current research largely overlooks how these models interact with developers in practice and neglects to address when a developer should receive completion suggestions. To tackle this issue, we developed a machine learning model that can accurately predict when to invoke a code completion tool given the code context and available telemetry data. To do so, we collect a dataset of 200k developer interactions with our cross-IDE code completion plugin and train several invocation filtering models. Our results indicate that our small-scale transformer model significantly outperforms the baseline while maintaining low enough latency. We further explore the search space for integrating additional telemetry data into a pre-trained transformer directly and obtain promising results. To further demonstrate our approach's practical potential, we deployed the model in an online environment with 34 developers and provided real-world insights based on 74k actual invocations.

View on arXivView PDF

Code Implementations(1)

Replication Package for "A Transformer-Based Approach for Smart Invocation of Automatic Code Completion"

10Python, Jupyter NotebookApr 6, 20242 years ago

Similar Papers

Cite this paper

@article{moor2024transformerbased,
  title  = {A Transformer-Based Approach for Smart Invocation of Automatic Code Completion},
  author = {Aral de Moor and Arie van Deursen and Maliheh Izadi},
  year   = {2024},
  eprint = {2405.14753},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.14753v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.14753.svg)](https://codeofpaper.com/paper/2405.14753)

Discussion