Which Syntactic Capabilities Are Statistically Learned by Masked Language Models for Code?
Authors:
- Alejandro VelascoAVAlejandro Velasco
- David N. PalacioDPDavid N. Palacio
- Daniel Rodriguez-CardenasDRDaniel Rodriguez-Cardenas
- Denys PoshyvanykDPDenys Poshyvanyk
Preprint
Abstract
This paper discusses the limitations of evaluating Masked Language Models (MLMs) in code completion tasks. We highlight that relying on accuracy-based measurements may lead to an overestimation of models' capabilities by neglecting the syntax rules of programming languages. To address these issues, we introduce a technique called SyntaxEval in which Syntactic Capabilities are used to enhance the evaluation of MLMs. SyntaxEval automates the process of masking elements in the model input based on their Abstract Syntax Trees (ASTs). We conducted a case study on two popular MLMs using data from GitHub repositories. Our results showed negative causal effects between the node types and MLMs' accuracy. We conclude that MLMs under study fail to predict some syntactic capabilities.Keywords
All Related Versions
This publication has 27 references indexed in Scilit:
- Benchmarking Causal Study to Interpret Large Language Models for Source Code2023
- An Empirical Study on the Usage of Transformer Models for Code CompletionIEEE Transactions on Software Engineering, 2021
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks2021
- SEQUENCER: Sequence-to-Sequence Learning for End-to-End Program RepairIEEE Transactions on Software Engineering, 2019
- Sorting and Transforming Program Repair Ingredients via Deep Learning Code Similarities2019
- Toward Deep Learning Software Repositories2015
- On the naturalness of software2012
- Code completion of multiple keywords from abbreviated inputAutomated Software Engineering, 2011
- Code Completion from Abbreviated Input2009
- A Textbook on Automata Theory2007