Benchmarking Language Models for Code Syntax Understanding
Da Shen, Xinyun Chen, Chenguang Wang, Koushik Sen, Dawn Song

TL;DR
This paper benchmarks pre-trained language models on their ability to understand code syntax, revealing significant gaps and limitations in current models' understanding of programming language structures.
Contribution
It introduces CodeSyntax, a large-scale dataset for evaluating code syntax understanding, and provides a comprehensive benchmark highlighting the deficiencies of existing models.
Findings
Pre-trained models perform poorly on code syntax tasks.
Simple baselines outperform complex pre-trained models in syntax understanding.
Existing pre-training methods lack effective modeling of code structures.
Abstract
Pre-trained language models have demonstrated impressive performance in both natural language processing and program understanding, which represent the input as a token sequence without explicitly modeling its structure. Some prior works show that pre-trained language models can capture the syntactic rules of natural languages without finetuning on syntax understanding tasks. However, there is limited understanding of how well pre-trained models understand the code structure so far. In this work, we perform the first thorough benchmarking of the state-of-the-art pre-trained models for identifying the syntactic structures of programs. Specifically, we introduce CodeSyntax, a large-scale dataset of programs annotated with the syntactic relationships in their corresponding abstract syntax trees. Our key observation is that existing language models pretrained on code still lack the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Malware Detection Techniques · Software System Performance and Reliability
Methodsfail
