On Explaining (Large) Language Models for Code Using Global Code-Based Explanations

Published in Major Revision, 2025

This paper introduces Code Rationales (Code ⭕), a technique with rigorous mathematical underpinning to identify subsets of tokens that can explain individual code predictions. We conducted a thorough Exploratory Analysis to demonstrate the method’s applicability and a User Study to understand the usability of code-based explanations. Our evaluation demonstrates that Code ⭕ is a powerful interpretability method to explain how (less) meaningful input concepts (i.e., natural language particle ‘at’) highly impact output generation (i.e., code conditionals). Moreover, participants of this study highlighted Code ⭕’s ability to show a causal relationship between the input and output of the model with readable and informative explanations on code completion and test generation tasks.

Status: Major Revision

Links:

Recommended citation: @article{khati2024explaining, title={On Explaining (Large) Language Models for Code Using Global Code-Based Explanations}, author={Dipin Khati and Daniel Rodriguez-Cardenas and David N. Palacio and Alejandro Velasco and Denys Poshyvanyk}, journal={To be announced}, year={2025} }