Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generation
Not on the map. Why?
Abstract (arXiv)
As Large Language Models for Code (LM4Code) become integral to software engineering, establishing trust in their output becomes critical. However, standard accuracy metrics obscure the underlying reasoning of generative models, offering little insight into how decisions are made. Although post-hoc interpretability methods attempt to fill this gap, they often restrict explanations to local, token-level insights, which fail to provide a developer-understandable global analysis. Our work highlights the urgent need for global, code-based explanations that reveal how models reason across code. To support this vision, we introduce textitcode rationales (CodeQ), a framework that enables global interpretability by mapping token-level rationales to high-level programming categories. Aggregating thousands of these token-level explanations allows us to perform statistical analyses that expose systemic reasoning behaviors. We validate this aggregation by showing it distills a clear signal from noisy token data, reducing explanation uncertainty (Shannon entropy) by over 50%. Additionally, we find that a code generation model (textitcodeparrot-small) consistently favors shallow syntactic cues (e.g., indentation) over deeper semantic logic. Furthermore, in a user study with 37 participants, we find its reasoning is significantly misaligned with that of human developers. These findings, hidden from traditional metrics, demonstrate the importance of global interpretability techniques to foster trust in LM4Code.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 27 of its 58 references that are in the map. First posted on arXiv 21 Mar 2025.
Builds on
27 of 58 references.
References · 27
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,050
- 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,488
- 2017Learning Important Features Through Propagating Activation Differencescited by 1,458
- 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,416
- 2020Beyond Accuracy: Behavioral Testing of NLP models with CheckListcited by 1,006
- 2019Attention is not Explanationcited by 929
- 2016The Mythos of Model Interpretabilitycited by 721
- 2020Towards Faithfully Interpretable NLP Systems: How should we define and evaluate faithfulness?cited by 599
15 more
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2019Is Attention Interpretable?cited by 389
- 2018Learning to Explain: An Information-Theoretic Perspective on Model Interpretationcited by 248
- 2020The elephant in the interpretability room: Why use attention as explanation when we have saliency methods?cited by 122
- 2019On Identifiability in Transformerscited by 116
- 2020Towards Transparent and Explainable Attention Modelscited by 47
- 2021Counterfactual Explanations for Models of Codecited by 25
- 2020Sampling in Software Engineering Research: A Critical Review and Guidelinescited by 23
- 2021Long-Range Modeling of Source Code Files with eWASH: Extended Window Access by Syntax Hierarchycited by 14
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Codecited by 14
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanationscited by 11
- 2022Methods2Test: A dataset of focal methods mapped to test casescited by 10
- 2024An Empirical Exploration of Trust Dynamics in LLM Supply Chainscited by 5
- 2022Cognition in Software Engineering: A Taxonomy and Survey of a Half-Century of Researchcited by 2
Built on by
Citing papers per year: 2025: 1.
1 paper.
- 2025Analyzing Latent Concepts in Code Language Modelscited by 2
- 2025Analyzing Latent Concepts in Code Language Models1 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2026TokenScope: Token-Level Explainability and Interpretability for Code-Oriented Tasks in Large Language Models
- 2024From Critique to Clarity: A Pathway to Faithful and Personalized Code Explanations with Large Language Models
- 2026Evaluating Language Models on Cross-Language Code Functional Equivalence
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysis
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings
- 2025textttReMind: Understanding Deductive Code Reasoning in LLMs
- 2026ExplainBench: Evaluating Code Explanations from Agents
- 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation