A methodology for refined evaluation of neural code completion approaches

Author:

Le Kim TuyenORCID,Rashidi Gabriel,Andrzejak ArturORCID

Abstract

AbstractCode completion has become an indispensable feature of modern Integrated Development Environments. In recent years, many approaches have been proposed to tackle this task. However, it is hard to compare between the models without explicitly re-evaluating them due to the differences of used benchmarks (e.g. datasets and evaluation metrics). Besides, almost all of these works report the accuracy of the code completion models as aggregated metrics averaged over all types of code tokens. Such evaluations make it difficult to assess the potential improvements for particularly relevant types of tokens (i.e. method or variable names), and blur the differences between the performance of the methods. In this paper, we propose a methodology called Code Token Type Taxonomy (CT3) to address the issue of using aggregated metrics. We identify multiple dimensions relevant for code prediction (e.g. syntax type, context, length), partition the tokens into meaningful types along each dimension, and compute individual accuracies by type. We illustrate the utility of this methodology by comparing the code completion accuracy of a Transformer-based model in two variants: with closed, and with open vocabulary. Our results show that the refined evaluation provides a more detailed view of the differences and indicates where further work is needed. We also survey the state-of-the-art of Machine Learning-based code completion models to illustrate that there is a demand for a set of standardized benchmarks for code completion approaches. Furthermore, we find that the open vocabulary model is significantly more accurate for relevant code token types such as usage of (defined) variables and literals.

Funder

Ruprecht-Karls-Universität Heidelberg

Publisher

Springer Science and Business Media LLC

Subject

Computer Networks and Communications,Computer Science Applications,Information Systems

Reference25 articles.

1. Ahmad WU, Chakraborty S, Ray B, Chang K-W (2021) Unified pre-training for program understanding and generation. arXiv preprint arXiv:2103.06333

2. Alon U, Sadaka R, Levy O, Yahav E (2020) Structural language models of code. In: International conference on machine learning. tex.organization: PMLR, pp 245–256

3. Bielik P, Raychev V, Vechev M (2016) PHOG: probabilistic model for code. In: International conference on machine learning, pp 2933–2942

4. Chen M, Tworek J, Jun H, Yuan Q, Pinto HPdO, Kaplan J et al (2021) Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374

5. Chirkova N, Troshin S (2020) A simple approach for handling out-of-vocabulary identifiers in deep learning for source code. arXiv preprint arXiv:2010.12663

Cited by 3 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Large language models for code completion: A systematic literature review;Computer Standards & Interfaces;2025-03

2. Rethinking AI code generation: a one-shot correction approach based on user feedback;Automated Software Engineering;2024-07-12

3. LLM for Test Script Generation and Migration: Challenges, Capabilities, and Opportunities;2023 IEEE 23rd International Conference on Software Quality, Reliability, and Security (QRS);2023-10-22

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3