Which Syntactic Capabilities Are Statistically Learned by Masked Language Models for Code?

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Velasco, Alejandro, Palacio, David N., Rodriguez-Cardenas, Daniel, Poshyvanyk, Denys
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913238300491776
author Velasco, Alejandro
Palacio, David N.
Rodriguez-Cardenas, Daniel
Poshyvanyk, Denys
author_facet Velasco, Alejandro
Palacio, David N.
Rodriguez-Cardenas, Daniel
Poshyvanyk, Denys
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2401_01512
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Which Syntactic Capabilities Are Statistically Learned by Masked Language Models for Code?
Velasco, Alejandro
Palacio, David N.
Rodriguez-Cardenas, Daniel
Poshyvanyk, Denys
Software Engineering
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.
title Which Syntactic Capabilities Are Statistically Learned by Masked Language Models for Code?
topic Software Engineering
url https://arxiv.org/abs/2401.01512