Benchmarking Language Models for Code Syntax Understanding
Not on the map. Why?
Abstract (arXiv)
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 understanding of code syntax. In fact, these pre-trained programming language models fail to match the performance of simple baselines based on positional offsets and keywords. We also present a natural language benchmark to highlight the differences between natural languages and programming languages in terms of syntactic structure understanding. Our findings point out key limitations of existing pre-training methods for programming languages, and suggest the importance of modeling code syntactic structures.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 26 of its 48 references that are in the map. First posted on arXiv 26 Oct 2022.
Builds on
26 of 48 references.
References · 26
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 856
- 2019Are Sixteen Heads Really Better than One?cited by 816
14 more
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2018Universal Transformerscited by 647
- 2019How multilingual is Multilingual BERT?cited by 645
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2020Unsupervised Translation of Programming Languagescited by 263
- 2018Context-Aware Neural Machine Translation Learns Anaphora Resolutioncited by 97
- 2020Language Models are Open Knowledge Graphscited by 95
- 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
- 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
- 2022DeepStruct: Pretraining of Language Models for Structure Predictioncited by 45
- 2021What do pre-trained code models know about code?cited by 36
- 2021Zero-Shot Information Extraction as a Unified Text-to-Triple Translationcited by 22
- 2022Joint Language Semantic and Structure Embedding for Knowledge Graph Completioncited by 15
- 2020Empirical Study of Transformers for Source Codecited by 13
Built on by
Citing papers per year: 2022: 1; 2023: 3; 2024: 3; 2025: 1.
8 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectivescited by 48
- 2024Measuring Vision-Language STEM Skills of Neural Modelscited by 14
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
- 2024Mutation-based Consistency Testing for Evaluating the Code Understanding Capability of LLMscited by 6
- 2024Efficacy of Various Large Language Models in Generating Smart Contractscited by 4
- 2025Analyzing Latent Concepts in Code Language Modelscited by 2
- 2023Redundancy and Concept Analysis for Code-trained Language Modelscited by 1
- 2025Analyzing Latent Concepts in Code Language Models1 Oct 2025
- 2024Efficacy of Various Large Language Models in Generating Smart Contracts28 Jun 2024
- 2024Measuring Vision-Language STEM Skills of Neural Models27 Feb 2024
- 2024Mutation-based Consistency Testing for Evaluating the Code Understanding Capability of LLMs11 Jan 2024
- 2023Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectives2 Oct 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023Redundancy and Concept Analysis for Code-trained Language Models1 May 2023
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacities20 Dec 2022