Using LLMs for Explaining Sets of Counterfactual Examples to Final Users

Arturo Fredes,Jordi Vitria
2024-08-27
Abstract:Causality is vital for understanding true cause-and-effect relationships between variables within predictive models, rather than relying on mere correlations, making it highly relevant in the field of Explainable AI. In an automated decision-making scenario, causal inference methods can analyze the underlying data-generation process, enabling explanations of a model's decision by manipulating features and creating counterfactual examples. These counterfactuals explore hypothetical scenarios where a minimal number of factors are altered, providing end-users with valuable information on how to change their situation. However, interpreting a set of multiple counterfactuals can be challenging for end-users who are not used to analyzing raw data records. In our work, we propose a novel multi-step pipeline that uses counterfactuals to generate natural language explanations of actions that will lead to a change in outcome in classifiers of tabular data using LLMs. This pipeline is designed to guide the LLM through smaller tasks that mimic human reasoning when explaining a decision based on counterfactual cases. We conducted various experiments using a public dataset and proposed a method of closed-loop evaluation to assess the coherence of the final explanation with the counterfactuals, as well as the quality of the content. Results are promising, although further experiments with other datasets and human evaluations should be carried out.
Machine Learning
What problem does this paper attempt to address?
The paper aims to address the issues of interpretability and transparency in the decision-making process of machine learning models. Specifically, it proposes a novel method that leverages large language models (LLMs) to generate natural language explanations to help end-users understand a set of counterfactual examples. These counterfactual examples demonstrate how the model's prediction can change with minimal alterations to certain features. However, as the number of counterfactual examples increases, it becomes challenging for non-data analysis professionals to draw conclusions from them. Therefore, the goal of this paper is to evaluate the effectiveness of using LLMs to automatically generate clear and simple natural language explanations, enabling users to understand how to change their situation to achieve the desired outcome without analyzing each case individually. The paper achieves this goal through the following steps: 1. **Counterfactual Generation**: Generate counterfactual examples that can flip the classifier's decision. 2. **Cause Extraction**: Identify the main causes from the counterfactual examples that lead to the change in results. 3. **Cause Evaluation and Selection**: Verify the correctness of the extracted causes and determine which causes are the most important. 4. **Explanation Generation**: Generate natural language explanations that are easy for users to understand based on the above information. Experimental results show that this method can generate effective explanations in most cases, and the effectiveness of the explanations increases with the number of counterfactual examples. Additionally, the study explores the impact of different prompting techniques (such as Zero-Shot, One-Shot, and Tree of Thought) on the quality of the explanations.