Code Prediction by Feeding Trees to Transformers
Not on the map. Why?
Abstract (arXiv)
We advance the state-of-the-art in the accuracy of code prediction (next token prediction) used in autocomplete systems. First, we report that using the recently proposed Transformer architecture even out-of-the-box outperforms previous neural and non-neural systems for code prediction. We then show that by making the Transformer architecture aware of the syntactic structure of code, we further increase the margin by which a Transformer-based system outperforms previous systems. With this, it outperforms the accuracy of an RNN-based system (similar to Hellendoorn et al. 2018) by 18.3%, the Deep3 system (Raychev et al 2016) by 14.1%, and an adaptation of Code2Seq (Alon et al., 2018) for code prediction by 14.4%. We present in the paper several ways of communicating the code structure to the Transformer, which is fundamentally built for processing sequence data. We provide a comprehensive experimental evaluation of our proposal, along with alternative design choices, on a standard Python dataset, as well as on a Facebook internal Python corpus. Our code and data preparation pipeline will be available in open source.
Key facts. Cited by 70 papers in the map (data through 7 Oct 2026). First posted on arXiv 30 Mar 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 12; 2022: 18; 2023: 17; 2024: 14; 2025: 9.
70 papers.
Sort:
By area:
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
- 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
- 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 55
- 2023Using Large Language Models to Generate JUnit Tests: An Empirical Studycited by 53
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2022Investigating Explainability of Generative AI for Code through Scenario-based Designcited by 47
- 2022Compilable Neural Code Generation with Compiler Feedbackcited by 46
38 more
- 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
- 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
- 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2023SALLM: Security Assessment of Generated Codecited by 35
- 2022StructCoder: Structure-Aware Transformer for Code Generationcited by 33
- 2023Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Reviewcited by 32
- 2024AST-T5: Structure-Aware Pretraining for Code Generation and Understandingcited by 32
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 32
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
- 2023Large Language Models of Code Fail at Completing Code with Potential Bugscited by 28
- 2021How could Neural Networks understand Programs?cited by 26
- 2021On Multi-Modal Learning of Editing Source Codecited by 25
- 2022FedAdapter: Efficient Federated Learning for Modern NLPcited by 24
- 2021Learning to Complete Code with Sketchescited by 23
- 2022Transformers over Directed Acyclic Graphscited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023AI-assisted Code Authoring at Scale: Fine-tuning, deploying, and mixed methods evaluationcited by 20
- 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Trainingcited by 15
- 2022Federated Few-Shot Learning for Mobile NLPcited by 15
- 2023Better Context Makes Better Code Language Models: A Case Study on Function Call Argument Completioncited by 14
- 2023FRANC: A Lightweight Framework for High-Quality Code Generationcited by 14
- 2021Enquire One's Parent and Child Before Decision: Fully Exploit Hierarchical Structure for Self-Supervised Taxonomy Expansioncited by 13
- 2022Cross-Language Binary-Source Code Matching with Intermediate Representationscited by 13
- 2024Multi-line AI-assisted Code Authoringcited by 13
- 2024A Large-Scale Exploit Instrumentation Study of AI/ML Supply Chain Attacks in Hugging Face Modelscited by 12
- 2021Multimodal Representation for Neural Code Searchcited by 11
- 2021AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarizationcited by 11
- 2022Syntax-Aware On-the-Fly Code Completioncited by 10
- 2023Exploiting Code Symmetries for Learning Program Semanticscited by 9
- 2024FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completioncited by 9
- 2024The Fault in our Stars: Quality Assessment of Code Generation Benchmarkscited by 9
- 2024Does Your Neural Code Completion Model Use My Code? A Membership Inference Approachcited by 9
- 2024Constrained Decoding for Fill-in-the-Middle Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive Grammarscited by 8
- 2023LExecutor: Learning-Guided Executioncited by 7
- 2021Improving Code Autocompletion with Transfer Learningcited by 6
- 2022MetaTPTrans: A Meta Learning Approach for Multilingual Code Representation Learningcited by 6
- 2022Towards Practical Few-shot Federated NLPcited by 5
50 most cited of 70 All 70 (JSON)
- 2025Assessing the Software Security Comprehension of Large Language Models24 Dec 2025
- 2025LLM Agents for Automated Dependency Upgrades3 Oct 2025
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completion22 Aug 2025
- 2025TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions in IDEs4 Aug 2025
- 2025The Impact of LLM-Assistants on Software Developer Productivity: A Systematic Review and Mapping Study3 Jul 2025
- 2025MigGPT: Harnessing Large Language Models for Automated Migration of Out-of-Tree Linux Kernel Patches Across Versions13 Apr 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025LLM-Aided Customizable Profiling of Code Data Based On Programming Language Concepts19 Mar 2025
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generation14 Jan 2025
- 2024Perspective of Software Engineering Researchers on Machine Learning Practices Regarding Research, Review, and Education28 Nov 2024
- 2024A Large-Scale Exploit Instrumentation Study of AI/ML Supply Chain Attacks in Hugging Face Models6 Oct 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
38 more
- 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completion30 May 2024
- 2024Does Your Neural Code Completion Model Use My Code? A Membership Inference Approach22 Apr 2024
- 2024The Fault in our Stars: Quality Assessment of Code Generation Benchmarks15 Apr 2024
- 2024FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion2 Apr 2024
- 2024Constrained Decoding for Fill-in-the-Middle Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive Grammars28 Feb 2024
- 2024Language Models for Code Completion: A Practical Evaluation25 Feb 2024
- 2024Multi-line AI-assisted Code Authoring6 Feb 2024
- 2024Calibration and Correctness of Language Models for Code3 Feb 2024
- 2024Structured Code Representations Enable Data-Efficient Adaptation of Code Language Models19 Jan 2024
- 2024Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Study12 Jan 2024
- 2024AST-T5: Structure-Aware Pretraining for Code Generation and Understanding5 Jan 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023A Case Study on Test Case Construction with Large Language Models: Unveiling Practical Insights and Challenges19 Dec 2023
- 2023Towards Trustworthy AI Software Development Assistance14 Dec 2023
- 2023SALLM: Security Assessment of Generated Code1 Nov 2023
- 2023Exploiting Code Symmetries for Learning Program Semantics7 Aug 2023
- 2023FRANC: A Lightweight Framework for High-Quality Code Generation17 Jul 2023
- 2023Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Review4 Jul 2023
- 2023Large Language Models of Code Fail at Completing Code with Potential Bugs6 Jun 2023
- 2023Better Context Makes Better Code Language Models: A Case Study on Function Call Argument Completion1 Jun 2023
- 2023AI-assisted Code Authoring at Scale: Fine-tuning, deploying, and mixed methods evaluation20 May 2023
- 2023Towards Code Generation from BDD Test Case Specifications: A Vision19 May 2023
- 2023Using Large Language Models to Generate JUnit Tests: An Empirical Study30 Apr 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generation13 Feb 2023
- 2023LExecutor: Learning-Guided Execution5 Feb 2023
- 2023Execution-based Code Generation using Deep Reinforcement Learning31 Jan 2023
- 2023What are the Machine Learning best practices reported by practitioners on Stack Exchange?25 Jan 2023
- 2022Neural Transition-based Parsing of Library Deprecations23 Dec 2022
- 2022Federated Few-Shot Learning for Mobile NLP12 Dec 2022
- 2022Towards Practical Few-shot Federated NLP1 Dec 2022
- 2022Syntax-Aware On-the-Fly Code Completion9 Nov 2022
- 2022Transformers over Directed Acyclic Graphs24 Oct 2022
- 2022A Library for Representing Python Programs as Graphs for Machine Learning15 Aug 2022
- 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligence24 Jul 2022
- 2022MetaTPTrans: A Meta Learning Approach for Multilingual Code Representation Learning13 Jun 2022
- 2022StructCoder: Structure-Aware Transformer for Code Generation10 Jun 2022
- 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Code2 Jun 2022
50 newest of 70 All 70 (JSON)
- 2025LLM Agents for Automated Dependency Upgradescited by 1
- 2025LLM Agents for Automated Dependency Upgrades3 Oct 2025
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
- 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
- 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 55
- 2023Using Large Language Models to Generate JUnit Tests: An Empirical Studycited by 53
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2022Investigating Explainability of Generative AI for Code through Scenario-based Designcited by 47
- 2022Compilable Neural Code Generation with Compiler Feedbackcited by 46
- 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
12 most cited of 65 All 65 (JSON)
- 2025Assessing the Software Security Comprehension of Large Language Models24 Dec 2025
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completion22 Aug 2025
- 2025TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions in IDEs4 Aug 2025
- 2025The Impact of LLM-Assistants on Software Developer Productivity: A Systematic Review and Mapping Study3 Jul 2025
- 2025MigGPT: Harnessing Large Language Models for Automated Migration of Out-of-Tree Linux Kernel Patches Across Versions13 Apr 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025LLM-Aided Customizable Profiling of Code Data Based On Programming Language Concepts19 Mar 2025
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generation14 Jan 2025
- 2024Perspective of Software Engineering Researchers on Machine Learning Practices Regarding Research, Review, and Education28 Nov 2024
- 2024A Large-Scale Exploit Instrumentation Study of AI/ML Supply Chain Attacks in Hugging Face Models6 Oct 2024
- 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completion30 May 2024
- 2024The Fault in our Stars: Quality Assessment of Code Generation Benchmarks15 Apr 2024
12 newest of 65 All 65 (JSON)