Explainable AI for Pre-Trained Code Models: What Do They Learn? When They Do Not Work?
Not on the map. Why?
Abstract (arXiv)
In recent years, there has been a wide interest in designing deep neural network-based models that automate downstream software engineering tasks on source code, such as code document generation, code search, and program repair. Although the main objective of these studies is to improve the effectiveness of the downstream task, many studies only attempt to employ the next best neural network model, without a proper in-depth analysis of why a particular solution works or does not, on particular tasks or scenarios. In this paper, using an example eXplainable AI (XAI) method (attention mechanism), we study two recent large language models (LLMs) for code (CodeBERT and GraphCodeBERT) on a set of software engineering downstream tasks: code document generation (CDG), code refinement (CR), and code translation (CT). Through quantitative and qualitative studies, we identify what CodeBERT and GraphCodeBERT learn (put the highest attention on, in terms of source code token types), on these tasks. We also show some of the common patterns when the model does not work as expected (performs poorly even on easy problems) and suggest recommendations that may alleviate the observed challenges.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). First posted on arXiv 23 Nov 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 4; 2025: 4.
8 papers.
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanationscited by 10
- 2024Looking into Black Box Code Language Modelscited by 5
- 2024Understanding Defects in Generated Codes by Language Modelscited by 4
- 2025How Programming Concepts and Neurons Are Shared in Code Language Modelscited by 4
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?cited by 3
- 2024The Mysterious Case of Neuron 1512: Injectable Realignment Architectures Reveal Internal Characteristics of Meta's Llama 2 Modelcited by 0
- 2025Mapping the Trust Terrain: LLMs in Software Engineering -- Insights and Perspectivescited by 0
- 2025Decoding the Multimodal Maze: A Systematic Review on the Adoption of Explainability in Multimodal Attention-based Modelscited by 0
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?23 Dec 2025
- 2025Decoding the Multimodal Maze: A Systematic Review on the Adoption of Explainability in Multimodal Attention-based Models6 Aug 2025
- 2025How Programming Concepts and Neurons Are Shared in Code Language Models1 Jun 2025
- 2025Mapping the Trust Terrain: LLMs in Software Engineering -- Insights and Perspectives18 Mar 2025
- 2024Understanding Defects in Generated Codes by Language Models23 Aug 2024
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanations12 Jul 2024
- 2024Looking into Black Box Code Language Models5 Jul 2024
- 2024The Mysterious Case of Neuron 1512: Injectable Realignment Architectures Reveal Internal Characteristics of Meta's Llama 2 Model4 Jul 2024