Counterfactual Explanations for Models of Code
J\"urgen Cito, Isil Dillig, Vijayaraghavan Murali, Satish Chandra

TL;DR
This paper investigates counterfactual explanations for machine learning models of source code, aiming to improve interpretability by identifying minimal code changes that alter model predictions, tested on BERT-like architectures.
Contribution
It introduces a method for generating counterfactual explanations for code models, addressing realism and usefulness in real-world settings.
Findings
Effective generation of plausible counterfactuals for code models
Demonstrated approach on three BERT-like models
Insights into factors affecting explanation quality
Abstract
Machine learning (ML) models play an increasingly prevalent role in many software engineering tasks. However, because most models are now powered by opaque deep neural networks, it can be difficult for developers to understand why the model came to a certain conclusion and how to act upon the model's prediction. Motivated by this problem, this paper explores counterfactual explanations for models of source code. Such counterfactual explanations constitute minimal changes to the source code under which the model "changes its mind". We integrate counterfactual explanation generation to models of source code in a real-world setting. We describe considerations that impact both the ability to find realistic and plausible counterfactual explanations, as well as the usefulness of such explanation to the user of the model. In a series of experiments we investigate the efficacy of our approach…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Explainable Artificial Intelligence (XAI) · Scientific Computing and Data Management
