A Static Evaluation of Code Completion by Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models trained on code have shown great potential to increase productivity of software developers. Several execution-based benchmarks have been proposed to evaluate functional correctness of model-generated code on simple programming problems. Nevertheless, it is expensive to perform the same evaluation on complex real-world projects considering the execution cost. On the contrary, static analysis tools such as linters, which can detect errors without running the program, haven't been well explored for evaluating code generation models. In this work, we propose a static evaluation framework to quantify static errors in Python code completions, by leveraging Abstract Syntax Trees. Compared with execution-based evaluation, our method is not only more efficient, but also applicable to code in the wild. For experiments, we collect code context from open source repos to generate one million function bodies using public models. Our static analysis reveals that Undefined Name and Unused Variable are the most common errors among others made by language models. Through extensive studies, we also show the impact of sampling temperature, model size, and context on static errors in code completions.
Key facts. Cited by 14 papers in the map (data through 14 Oct 2026). Builds on 16 of its 30 references that are in the map. First posted on arXiv 5 Jun 2023.
Builds on
16 of 30 references.
References · 16
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 452
- 2021Unified Pre-training for Program Understanding and Generationcited by 366
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 159
4 more
- 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 108
- 2022Productivity Assessment of Neural Code Completioncited by 98
- 2019Pythia: AI-assisted Code Completion Systemcited by 55
- 2021The Prevalence of Code Smells in Machine Learning projectscited by 16
Built on by
Citing papers per year: 2023: 3; 2024: 9; 2025: 1; 2026: 1.
14 papers.
Sort:
By area:
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2024Fewer Truncations Improve Language Modelingcited by 35
- 2024On Mitigating Code LLM Hallucinations with API Documentationcited by 21
- 2024The Fusion of Large Language Models and Formal Methods for Trustworthy AI Agents: A Roadmapcited by 20
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluationcited by 20
- 2024What can Large Language Models Capture about Code Functional Equivalence?cited by 14
- 2024Exploring the Interplay Between Video Generation and World Models in Autonomous Driving: A Surveycited by 14
- 2024LLMs with Industrial Lens: Deciphering the Challenges and Prospects -- A Surveycited by 12
- 2023Recursive Visual Programmingcited by 6
- 2024No Size Fits All: The Perils and Pitfalls of Leveraging LLMs Vary with Company Sizecited by 3
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completioncited by 3
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinations9 Apr 2026
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completion22 Aug 2025
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluation16 Dec 2024
- 2024The Fusion of Large Language Models and Formal Methods for Trustworthy AI Agents: A Roadmap9 Dec 2024
- 2024Exploring the Interplay Between Video Generation and World Models in Autonomous Driving: A Survey5 Nov 2024
- 2024What can Large Language Models Capture about Code Functional Equivalence?20 Aug 2024
- 2024No Size Fits All: The Perils and Pitfalls of Leveraging LLMs Vary with Company Size21 Jul 2024
- 2024On Mitigating Code LLM Hallucinations with API Documentation13 Jul 2024
- 2024Towards Large Language Model Aided Program Refinement26 Jun 2024
- 2024Fewer Truncations Improve Language Modeling16 Apr 2024
- 2024LLMs with Industrial Lens: Deciphering the Challenges and Prospects -- A Survey22 Feb 2024
- 2023Recursive Visual Programming4 Dec 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2024Fewer Truncations Improve Language Modelingcited by 35
- 2024On Mitigating Code LLM Hallucinations with API Documentationcited by 21
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluationcited by 20
- 2024What can Large Language Models Capture about Code Functional Equivalence?cited by 14
- 2024LLMs with Industrial Lens: Deciphering the Challenges and Prospects -- A Surveycited by 12
- 2023Recursive Visual Programmingcited by 6
- 2024No Size Fits All: The Perils and Pitfalls of Leveraging LLMs Vary with Company Sizecited by 3
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completioncited by 3
- 2024Towards Large Language Model Aided Program Refinementcited by 2
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinationscited by 0
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinations9 Apr 2026
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completion22 Aug 2025
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluation16 Dec 2024
- 2024What can Large Language Models Capture about Code Functional Equivalence?20 Aug 2024
- 2024No Size Fits All: The Perils and Pitfalls of Leveraging LLMs Vary with Company Size21 Jul 2024
- 2024On Mitigating Code LLM Hallucinations with API Documentation13 Jul 2024
- 2024Towards Large Language Model Aided Program Refinement26 Jun 2024
- 2024Fewer Truncations Improve Language Modeling16 Apr 2024
- 2024LLMs with Industrial Lens: Deciphering the Challenges and Prospects -- A Survey22 Feb 2024
- 2023Recursive Visual Programming4 Dec 2023
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly4 Dec 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023