arrow
Return

Non-Autoregressive Line-Level Code Completion

delete2024-06-03
delete3
delete
OA
AI
F
Fang Liu
Z
Zhiyi Fu
G
Ge Li
Z
Zhi Jin
刘辉 cover
刘辉 (Hui Liu)
Y
Yiyang Hao
L
Li Zhang *
DOI:10.1145/3649594delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Software developers frequently use code completion tools to accelerate software development by suggesting the following code elements. Researchers usually employ AutoRegressive (AR) decoders to complete code sequences in a left-to-right, token-by-token fashion. To improve the accuracy and efficiency of code completion, we argue that tokens within a code statement have the potential to be predicted concurrently. In this article, we first conduct an empirical study to analyze the dependency among the target tokens in line-level code completion. The results suggest that it is potentially practical to generate all statement tokens in parallel. To this end, we introduce SANAR, a simple and effective syntax-aware non-autoregressive model for line-level code completion. To further improve the quality of the generated code, we propose an adaptive and syntax-aware sampling strategy to boost the model's performance. The experimental results obtained from two widely used datasets indicate that our model outperforms state-of-the-art code completion approaches of similar model size by a considerable margin, and is faster than these models with up to 9x speed-up. Moreover, the extensive results additionally demonstrate that the enhancements achieved by SANAR become even more pronounced with larger model sizes, highlighting their significance.
Keywords:
Code completion
neural networks
non-autoregressive generation

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

B
Beihang University
Scholars:
5.1W
Papers: 4.1W
Citations: 37
B
beijing institute of technology
Scholars:
5.4W
Papers: 3.9W
Citations: 63
P
peking university
Scholars:
11.7W
Papers: 8.7W
Citations: 146
researcher View more organizations