mlsanityData to 14 Oct 2026

Enriching Source Code with Contextual Data for Code Completion Models: An Empirical Study

arXiv 2304.12269 ↗First posted 24 Apr 2023cs.CLcited by 8

Not on the map. Why?

Abstract (arXiv)

Transformer-based pre-trained models have recently achieved great results in solving many software engineering tasks including automatic code completion which is a staple in a developer's toolkit. While many have striven to improve the code-understanding abilities of such models, the opposite -- making the code easier to understand -- has not been properly investigated. In this study, we aim to answer whether making code easier to understand through using contextual data improves the performance of pre-trained code language models for the task of code completion. We consider type annotations and comments as two common forms of additional contextual information that often help developers understand code better. For the experiments, we study code completion in two granularity levels; token and line completion and take three recent and large-scale language models for source code: UniXcoder, CodeGPT, and InCoder with five evaluation metrics. Finally, we perform the Wilcoxon Signed Rank test to gauge significance and measure the effect size. Contrary to our expectations, all models perform better if type annotations are removed (albeit the effect sizes are small). For comments, we find that the models perform better in the presence of multi-line comments (again with small effect sizes). Based on our observations, we recommend making proper design choices when training, fine-tuning, or simply selecting such models given the intended data and application. Better evaluations and multi-modal techniques can also be further investigated to improve the practicality and accuracy of auto-completions.

Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 32 of its 51 references that are in the map. First posted on arXiv 24 Apr 2023.

Builds on

32 of 51 references.

References · 32

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  5. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  6. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  7. 2018A Call for Clarity in Reporting BLEU Scorescited by 1,799
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  10. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  11. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  12. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
20 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  2. 2020IntelliCode Compose: Code Generation Using Transformercited by 227
  3. 2022CM3: A Causal Masked Multimodal Model of the Internetcited by 142
  4. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 126
  5. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 77
  6. 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 50
  7. 2020LambdaNet: Probabilistic Type Inference using Graph Neural Networkscited by 44
  8. 2019Cloze-driven Pretraining of Self-attention Networkscited by 41
  9. 2023Extending Source Code Pre-Trained Language Models to Summarise Decompiled Binariescited by 26
  10. 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
  11. 2021An Empirical Study on the Usage of Transformer Models for Code Completioncited by 22
  12. 2020Topic Recommendation for Software Repositories using Multi-label Classification Algorithmscited by 20
  13. 2020Empirical Study of Transformers for Source Codecited by 13
  14. 2020Predicting the Objective and Priority of Issue Reports in Software Repositoriescited by 11
  15. 2019Combining Program Analysis and Statistical Language Model for Code Statement Completioncited by 5
  16. 2021An Empirical Study on Code Comment Completioncited by 5
  17. 2022On the Evaluation of NLP-based Models for Software Engineeringcited by 5
  18. 2022CatIss: An Intelligent Tool for Categorizing Issues Reports using Transformerscited by 5
  19. 2023STACC: Code Comment Classification using SentenceTransformerscited by 5
  20. 2022An Empirical Study on Data Leakage and Generalizability of Link Prediction Models for Issues and Commitscited by 1

Built on by

Cited by year (2026 to 14 Oct)

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

8 papers.