跳到主要导航 跳到搜索 跳到主要内容

Non-Autoregressive Line-Level Code Completion

  • Fang Liu
  • , Zhiyi Fu
  • , Ge Li
  • , Zhi Jin
  • , Hui Liu
  • , Yiyang Hao
  • , Li Zhang*
  • *此作品的通讯作者
  • Beihang University
  • Peking University
  • Silicon Heart Tech Co.

科研成果: 期刊稿件 › 文章 › 同行评审

摘要

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 9× 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.

源语言英语
期刊论文编号120
期刊ACM Transactions on Software Engineering and Methodology
卷33
期5
DOI
出版状态已出版 - 3 6月 2024

学术指纹

探究 'Non-Autoregressive Line-Level Code Completion' 的科研主题。它们共同构成独一无二的学术指纹。

引用此