Syntax-Aware On-the-Fly Code Completion
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
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2018Multi-Task Learning as Multi-Objective Optimizationcited by 809
- 2017An Overview of Multi-Task Learning in Deep Neural Networkscited by 791
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2016Deep Reinforcement Learning for Dialogue Generationcited by 286
13 more
- 2017Challenges in Data-to-Document Generationcited by 226
- 2020IntelliCode Compose: Code Generation Using Transformercited by 225
- 2018Sentence Encoders on STILTs: Supplementary Training on Intermediate Labeled-data Taskscited by 214
- 2020Code Prediction by Feeding Trees to Transformerscited by 70
- 2018Generative Code Modeling with Graphscited by 59
- 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
- 2019Pythia: AI-assisted Code Completion Systemcited by 54
- 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 53
- 2017Code Completion with Neural Attention and Pointer Networkscited by 49
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
- 2019A Self-Attentional Neural Architecture for Code Completion with Multi-Task Learningcited by 18
- 2020Towards Full-line Code Completion with Neural Language Modelscited by 6
Built on by
Citing papers per year: 2023: 1; 2024: 6; 2025: 3.
10 papers.
- 2024Human-In-the-Loop Software Development Agentscited by 42
- 2023Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Reviewcited by 32
- 2024M2rc-Eval: Massively Multilingual Repository-level Code Completion Evaluationcited by 21
- 2024Constrained Decoding for Fill-in-the-Middle Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive Grammarscited by 8
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semanticscited by 7
- 2024Is Next Token Prediction Sufficient for GPT? Exploration on Code Logic Comprehensioncited by 6
- 2025Code Readability in the Age of Large Language Models: An Industrial Case Study from Atlassiancited by 4
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
- 2024Approximately Aligned Decodingcited by 3
- 2025Structure-Aware Corpus Construction and User-Perception-Aligned Metrics for Large-Language-Model Code Completioncited by 0
- 2025Structure-Aware Corpus Construction and User-Perception-Aligned Metrics for Large-Language-Model Code Completion19 May 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025Code Readability in the Age of Large Language Models: An Industrial Case Study from Atlassian20 Jan 2025
- 2024Human-In-the-Loop Software Development Agents19 Nov 2024
- 2024M2rc-Eval: Massively Multilingual Repository-level Code Completion Evaluation28 Oct 2024
- 2024Approximately Aligned Decoding1 Oct 2024
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semantics4 Jul 2024
- 2024Is Next Token Prediction Sufficient for GPT? Exploration on Code Logic Comprehension13 Apr 2024
- 2024Constrained Decoding for Fill-in-the-Middle Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive Grammars28 Feb 2024
- 2023Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Review4 Jul 2023