SEAILGNov 10, 2021

Counterfactual Explanations for Models of Code

arXiv:2111.05711v157 citations
Originality Synthesis-oriented
AI Analysis

This addresses the need for interpretability in ML models used by software developers, though it is incremental as it applies existing counterfactual explanation methods to the domain of source code.

The paper tackles the problem of understanding opaque deep neural network predictions in software engineering by exploring counterfactual explanations for models of source code, which involve minimal changes to the code that alter the model's decision, and integrates this approach in a real-world setting with experiments on three BERT-like models.

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 on three different models, each based on a BERT-like architecture operating over source code.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes