Enhancing Code Completion with Implicit Feedback

Haonan Jin, Yu Zhou, Yasir Hussain · 2023

Code completion has become an important feature of today’s integrated development environments (IDEs). This task involves predicting the next code token(s) based on its contextual information within the code. However, most existing code completion approaches do not consider users’ feedback during the completion process. In this paper, we propose a framework, EHOPE (Enhance Code Completion with Implicit Feedback)), which exploits LSTM(Long Short-Term Memory) and pre-trained model BERT(Bidirectional Encoder Representation from Transformers) to enhance the performance of token-level code completion. By leveraging users’ feedback information, we train an LSTM model to supplement the recommendation list. In addition, we re-rank the list of recommendations using the pre-trained model BERT, which is fine-tuned with feedback information. Existing token-level code completion tools can be plugged into EHOPE. We choose two representative code completion approaches from different categories: one based on statistical methods and the other based on deep learning. These approaches serve as baselines to showcase the performance improvements of EHOPE, evaluated using Hit@k (Top-k) and MRR(Mean Reciprocal Rank) metrics. Empirical experiments show that the recommendation performance steadily and substantially improves as the feedback data increases compared with the baselines.

Read the paper · More papers on PaperTik