mlsanityData to 14 Oct 2026

Benchmarking Language Models for Code Syntax Understanding

arXiv 2210.14473 ↗First posted 26 Oct 2022cs.CLcited by 8

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
  6. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
  7. 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  9. 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
  10. 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
  11. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 856
  12. 2019Are Sixteen Heads Really Better than One?cited by 816
14 more
  1. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  2. 2018Universal Transformerscited by 647
  3. 2019How multilingual is Multilingual BERT?cited by 645
  4. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  5. 2020Unsupervised Translation of Programming Languagescited by 263
  6. 2018Context-Aware Neural Machine Translation Learns Anaphora Resolutioncited by 97
  7. 2020Language Models are Open Knowledge Graphscited by 95
  8. 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
  9. 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
  10. 2022DeepStruct: Pretraining of Language Models for Structure Predictioncited by 45
  11. 2021What do pre-trained code models know about code?cited by 36
  12. 2021Zero-Shot Information Extraction as a Unified Text-to-Triple Translationcited by 22
  13. 2022Joint Language Semantic and Structure Embedding for Knowledge Graph Completioncited by 15
  14. 2020Empirical Study of Transformers for Source Codecited by 13

Built on by

Cited by year

Citing papers per year: 2022: 1; 2023: 3; 2024: 3; 2025: 1.

8 papers.