Explainable AI for Pre-Trained Code Models: What Do They Learn? When They Do Not Work?
Ahmad Haji Mohammadkhani, Chakkrit Tantithamthavorn, Hadi Hemmati

TL;DR
This paper investigates what large language models for code learn and why they sometimes fail, using explainable AI methods to analyze their focus and limitations across various software engineering tasks.
Contribution
It provides an in-depth analysis of CodeBERT and GraphCodeBERT's learned representations and failure patterns using attention-based explainability techniques.
Findings
Models focus on specific source code token types.
Identified common patterns in model failures.
Recommendations for improving model robustness.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Software System Performance and Reliability
