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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: de Moor, Aral, van Deursen, Arie, Izadi, Maliheh
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917673714057216
author de Moor, Aral
van Deursen, Arie
Izadi, Maliheh
author_facet de Moor, Aral
van Deursen, Arie
Izadi, Maliheh
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_14753
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle A Transformer-Based Approach for Smart Invocation of Automatic Code Completion
de Moor, Aral
van Deursen, Arie
Izadi, Maliheh
Software Engineering
Artificial Intelligence
Human-Computer Interaction
Machine Learning
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.
title A Transformer-Based Approach for Smart Invocation of Automatic Code Completion
topic Software Engineering
Artificial Intelligence
Human-Computer Interaction
Machine Learning
url https://arxiv.org/abs/2405.14753