Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanations
Not on the map. Why?
Abstract (arXiv)
Trustworthiness and interpretability are inextricably linked concepts for LLMs. The more interpretable an LLM is, the more trustworthy it becomes. However, current techniques for interpreting LLMs when applied to code-related tasks largely focus on accuracy measurements, measures of how models react to change, or individual task performance instead of the fine-grained explanations needed at prediction time for greater interpretability, and hence trust. To improve upon this status quo, this paper introduces ASTrust, an interpretability method for LLMs of code that generates explanations grounded in the relationship between model confidence and syntactic structures of programming languages. ASTrust explains generated code in the context of syntax categories based on Abstract Syntax Trees and aids practitioners in understanding model predictions at both local (individual code snippets) and global (larger datasets of code) levels. By distributing and assigning model confidence scores to well-known syntactic structures that exist within ASTs, our approach moves beyond prior techniques that perform token-level confidence mapping by offering a view of model confidence that directly aligns with programming language concepts with which developers are familiar. To put ASTrust into practice, we developed an automated visualization that illustrates the aggregated model confidence scores superimposed on sequence, heat-map, and graph-based visuals of syntactic structures from ASTs. We examine both the practical benefit that ASTrust can provide through a data science study on 12 popular LLMs on a curated set of GitHub repos and the usefulness of ASTrust through a human study.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 84 of its 175 references that are in the map. First posted on arXiv 12 Jul 2024.
Builds on
84 of 175 references.
References · 84
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2017A Unified Approach to Interpreting Model Predictionscited by 6,488
- 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,040
- 2017Axiomatic Attribution for Deep Networkscited by 3,350
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,400
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2017Interpretability Beyond Feature Attribution: Quantitative Testing with Concept Activation Vectors (TCAV)cited by 1,309
- 2017Explanation in Artificial Intelligence: Insights from the Social Sciencescited by 1,201
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
38 more
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2023DecodingTrust: A Comprehensive Assessment of Trustworthiness in GPT Modelscited by 505
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2023Trustworthy LLMs: a Survey and Guideline for Evaluating Large Language Models' Alignmentcited by 394
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2021AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model Promptscited by 265
- 2023The Impact of AI on Developer Productivity: Evidence from GitHub Copilotcited by 264
- 2020Questioning the AI: Informing Design Practices for Explainable AI User Experiencescited by 251
- 2021Adversarial GLUE: A Multi-Task Benchmark for Robustness Evaluation of Language Modelscited by 227
- 2023PromptRobust: Towards Evaluating the Robustness of Large Language Models on Adversarial Promptscited by 218
- 2021Trustworthy AI: From Principles to Practicescited by 206
- 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
- 2015Visualizing and Understanding Recurrent Networkscited by 158
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
- 2020Interpretable Machine Learning -- A Brief History, State-of-the-Art and Challengescited by 120
- 2021What Do We Want From Explainable Artificial Intelligence (XAI)? -- A Stakeholder Perspective on XAI and a Conceptual Model Guiding Interdisciplinary XAI Researchcited by 119
- 2023AI Transparency in the Age of LLMs: A Human-Centered Research Roadmapcited by 119
- 2019Artificial Intelligence: the global landscape of ethics guidelinescited by 107
- 2023Don't Trust ChatGPT when Your Question is not in English: A Study of Multilingual Abilities and Types of LLMscited by 103
- 2021Trustworthy AI: A Computational Perspectivecited by 93
- 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 87
- 2018Beyond Word Importance: Contextual Decomposition to Extract Interactions from LSTMscited by 67
- 2024"I'm Not Sure, But...": Examining the Impact of Large Language Models' Uncertainty Expression on User Reliance and Trustcited by 67
- 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 53
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2022Designing for Responsible Trust in AI Systems: A Communication Perspectivecited by 48
- 2020Towards Transparent and Explainable Attention Modelscited by 47
- 2018Deep Learning for Electromyographic Hand Gesture Signal Classification Using Transfer Learningcited by 46
- 2020On Learning Meaningful Assert Statements for Unit Test Casescited by 42
- 2021Perfection Not Required? Human-AI Partnerships in Code Translationcited by 42
- 2020A Systematic Literature Review on the Use of Deep Learning in Software Engineering Researchcited by 35
- 2021Do Humans Trust Advice More if it Comes from AI? An Analysis of Human-AI Interactionscited by 35
- 2023Investigating and Designing for Trust in AI-powered Code Generation Toolscited by 34
- 2023Navigating the Complexity of Generative AI Adoption in Software Engineeringcited by 32
50 most cited of 84 All 84 (JSON)
Built on by
Citing papers per year: 2024: 1; 2025: 4; 2026: 5.
10 papers.
- 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
- 2026AgentReputation: A Decentralized Agentic AI Reputation Frameworkcited by 4
- 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generationcited by 1
- 2025Analyzing Latent Concepts in Code Language Modelscited by 1
- 2026Detecting and Correcting Hallucinations in LLM-Generated Code via Deterministic AST Analysiscited by 1
- 2026Rethinking Code Review in the Age of AI: A Vision for Agentic Code Reviewcited by 1
- 2025Toward Neurosymbolic Program Comprehensioncited by 0
- 2025What Do You Mean? Exploring How Humans and AI Interact with Symbols and Meanings in Their Interactionscited by 0
- 2026Reasoning Beyond Prediction: From Data-Driven to Causal Software Engineeringcited by 0
- 2026From Adoption to Deployment: A Qualitative Study on AI Integration in Software Development Practicecited by 0
- 2026From Adoption to Deployment: A Qualitative Study on AI Integration in Software Development Practice18 Jul 2026
- 2026Reasoning Beyond Prediction: From Data-Driven to Causal Software Engineering26 Jun 2026
- 2026Rethinking Code Review in the Age of AI: A Vision for Agentic Code Review17 May 2026
- 2026AgentReputation: A Decentralized Agentic AI Reputation Framework30 Apr 2026
- 2026Detecting and Correcting Hallucinations in LLM-Generated Code via Deterministic AST Analysis27 Jan 2026
- 2025What Do You Mean? Exploring How Humans and AI Interact with Symbols and Meanings in Their Interactions6 Oct 2025
- 2025Analyzing Latent Concepts in Code Language Models1 Oct 2025
- 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generation21 Mar 2025
- 2025Toward Neurosymbolic Program Comprehension3 Feb 2025
- 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Study25 Dec 2024