Evaluating and Explaining Large Language Models for Code Using Syntactic Structures
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) for code are a family of high-parameter, transformer-based neural networks pre-trained on massive datasets of both natural and programming languages. These models are rapidly being employed in commercial AI-based developer tools, such as GitHub CoPilot. However, measuring and explaining their effectiveness on programming tasks is a challenging proposition, given their size and complexity. The methods for evaluating and explaining LLMs for code are inextricably linked. That is, in order to explain a model's predictions, they must be reliably mapped to fine-grained, understandable concepts. Once this mapping is achieved, new methods for detailed model evaluations are possible. However, most current explainability techniques and evaluation benchmarks focus on model robustness or individual task performance, as opposed to interpreting model predictions. To this end, this paper introduces ASTxplainer, an explainability method specific to LLMs for code that enables both new methods for LLM evaluation and visualizations of LLM predictions that aid end-users in understanding model predictions. At its core, ASTxplainer provides an automated method for aligning token predictions with AST nodes, by extracting and aggregating normalized model logits within AST structures. To demonstrate the practical benefit of ASTxplainer, we illustrate the insights that our framework can provide by performing an empirical evaluation on 12 popular LLMs for code using a curated dataset of the most popular GitHub projects. Additionally, we perform a user study examining the usefulness of an ASTxplainer-derived visualization of model predictions aimed at enabling model users to explain predictions. The results of these studies illustrate the potential for ASTxplainer to provide insights into LLM effectiveness, and aid end-users in understanding predictions.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 36 of its 57 references that are in the map. First posted on arXiv 7 Aug 2023.
Builds on
36 of 57 references.
References · 36
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023A Survey of Large Language Modelscited by 2,576
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2017Interpretability Beyond Feature Attribution: Quantitative Testing with Concept Activation Vectors (TCAV)cited by 1,319
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
24 more
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2021Unified Pre-training for Program Understanding and Generationcited by 366
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2017Learning to Represent Programs with Graphscited by 220
- 2015Visualizing and Understanding Recurrent Networkscited by 160
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 145
- 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 126
- 2020Interpretable Machine Learning -- A Brief History, State-of-the-Art and Challengescited by 120
- 2020Principles and Practice of Explainable Machine Learningcited by 99
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2020On Learning Meaningful Assert Statements for Unit Test Casescited by 42
- 2020A Systematic Literature Review on the Use of Deep Learning in Software Engineering Researchcited by 35
- 2022Probing Pretrained Models of Source Codecited by 26
- 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
- 2021DoWhy: Addressing Challenges in Expressing and Validating Causal Assumptionscited by 20
- 2022AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language modelscited by 16
- 2021Model Explainability in Deep Learning Based Natural Language Processingcited by 14
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 2019Maybe Deep Neural Networks are the Best Choice for Modeling Source Codecited by 5
Built on by
Citing papers per year: 2024: 4; 2025: 4; 2026: 1.
9 papers.
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
- 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicatescited by 14
- 2024Testing the Effect of Code Documentation on Large Language Model Code Understandingcited by 4
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
- 2025Deconstructing Obfuscation: A four-dimensional framework for evaluating Large Language Models assembly code deobfuscation capabilitiescited by 2
- 2024Knowledge-based Consistency Testing of Large Language Modelscited by 1
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Codecited by 1
- 2026Rethinking Token Prediction: Tree-Structured Diffusion Language Modelcited by 1
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?cited by 0
- 2026Rethinking Token Prediction: Tree-Structured Diffusion Language Model4 Apr 2026
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?17 Dec 2025
- 2025Deconstructing Obfuscation: A four-dimensional framework for evaluating Large Language Models assembly code deobfuscation capabilities26 May 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Code10 Feb 2025
- 2024Knowledge-based Consistency Testing of Large Language Models3 Jul 2024
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Review6 May 2024
- 2024Testing the Effect of Code Documentation on Large Language Model Code Understanding3 Apr 2024
- 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicates8 Feb 2024