mlsanityData to 7 Oct 2026

Syntax-Aware On-the-Fly Code Completion

arXiv 2211.04673 ↗First posted 9 Nov 2022cs.SE cs.AIcited by 10

Not on the map. Why?

Abstract (arXiv)

Code completion aims to help improve developers' productivity by suggesting the next code tokens from a given context. Various approaches have been proposed to incorporate abstract syntax tree (AST) information for model training, ensuring that code completion is aware of the syntax of the programming languages. However, existing syntax-aware code completion approaches are not on-the-fly, as we found that for every two-thirds of characters that developers type, AST fails to be extracted because it requires the syntactically correct source code, limiting its practicality in real-world scenarios. On the other hand, existing on-the-fly code completion does not consider syntactic information yet. In this paper, we propose PyCoder to leverage token types, a kind of lightweight syntactic information, which is readily available and aligns with the natural order of source code. Our PyCoder is trained in a multi-task training manner so that by learning the supporting task of predicting token types during the training phase, the models achieve better performance on predicting tokens and lines of code without the need for token types in the inference phase. Comprehensive experiments show that PyCoder achieves the first rank on the CodeXGLUE leaderboard with an accuracy of 77.12% for the token-level predictions, which is 0.43%-24.25% more accurate than baselines. In addition, PyCoder achieves an exact match of 43.37% for the line-level predictions, which is 3.63%-84.73% more accurate than baselines. These results lead us to conclude that token type information (an alternative to syntactic information) that is rarely used in the past can greatly improve the performance of code completion approaches, without requiring the syntactically correct source code like AST-based approaches do. Our PyCoder is publicly available on HuggingFace and GitHub.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 25 of its 55 references that are in the map. First posted on arXiv 9 Nov 2022.

Builds on

25 of 55 references.

References · 25

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  6. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  7. 2018Multi-Task Learning as Multi-Objective Optimizationcited by 809
  8. 2017An Overview of Multi-Task Learning in Deep Neural Networkscited by 791
  9. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  10. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  11. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  12. 2016Deep Reinforcement Learning for Dialogue Generationcited by 286
13 more
  1. 2017Challenges in Data-to-Document Generationcited by 226
  2. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  3. 2018Sentence Encoders on STILTs: Supplementary Training on Intermediate Labeled-data Taskscited by 214
  4. 2020Code Prediction by Feeding Trees to Transformerscited by 70
  5. 2018Generative Code Modeling with Graphscited by 59
  6. 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
  7. 2019Pythia: AI-assisted Code Completion Systemcited by 54
  8. 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 53
  9. 2017Code Completion with Neural Attention and Pointer Networkscited by 49
  10. 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
  11. 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
  12. 2019A Self-Attentional Neural Architecture for Code Completion with Multi-Task Learningcited by 18
  13. 2020Towards Full-line Code Completion with Neural Language Modelscited by 6

Built on by

Cited by year

Citing papers per year: 2023: 1; 2024: 6; 2025: 3.

10 papers.