Table of Contents
Fetching ...

Counterfactual Generation with Answer Set Programming

Sopam Dasgupta, Farhad Shakerin, Joaquín Arias, Elmer Salazar, Gopal Gupta

TL;DR

The paper tackles the problem of explainability for consequential decisions by focusing on counterfactual explanations that offer actionable recourse. It introduces Counterfactual Generation with s(CASP) (CFGS), a framework that converts RBML rules into counterfactuals using answer set programming and the goal-directed s(CASP) system, while incorporating causal dependencies and mutability/cost constraints to ensure realism. The approach provides a model-agnostic path to compute interventions that flip undesired outcomes to desired ones, with justification via proof trees and a cost model for interventions. Empirical demonstrations show CFGS can generate original-counterfactual pairs across multiple RBML algorithms and datasets, illustrating practical applicability for algorithmic recourse and transparency in high-stakes decisions.

Abstract

Machine learning models that automate decision-making are increasingly being used in consequential areas such as loan approvals, pretrial bail approval, hiring, and many more. Unfortunately, most of these models are black-boxes, i.e., they are unable to reveal how they reach these prediction decisions. A need for transparency demands justification for such predictions. An affected individual might also desire explanations to understand why a decision was made. Ethical and legal considerations may further require informing the individual of changes in the input attribute that could be made to produce a desirable outcome. This paper focuses on the latter problem of automatically generating counterfactual explanations. We propose a framework Counterfactual Generation with s(CASP) (CFGS) that utilizes answer set programming (ASP) and the s(CASP) goal-directed ASP system to automatically generate counterfactual explanations from rules generated by rule-based machine learning (RBML) algorithms. In our framework, we show how counterfactual explanations are computed and justified by imagining worlds where some or all factual assumptions are altered/changed. More importantly, we show how we can navigate between these worlds, namely, go from our original world/scenario where we obtain an undesired outcome to the imagined world/scenario where we obtain a desired/favourable outcome.

Counterfactual Generation with Answer Set Programming

TL;DR

The paper tackles the problem of explainability for consequential decisions by focusing on counterfactual explanations that offer actionable recourse. It introduces Counterfactual Generation with s(CASP) (CFGS), a framework that converts RBML rules into counterfactuals using answer set programming and the goal-directed s(CASP) system, while incorporating causal dependencies and mutability/cost constraints to ensure realism. The approach provides a model-agnostic path to compute interventions that flip undesired outcomes to desired ones, with justification via proof trees and a cost model for interventions. Empirical demonstrations show CFGS can generate original-counterfactual pairs across multiple RBML algorithms and datasets, illustrating practical applicability for algorithmic recourse and transparency in high-stakes decisions.

Abstract

Machine learning models that automate decision-making are increasingly being used in consequential areas such as loan approvals, pretrial bail approval, hiring, and many more. Unfortunately, most of these models are black-boxes, i.e., they are unable to reveal how they reach these prediction decisions. A need for transparency demands justification for such predictions. An affected individual might also desire explanations to understand why a decision was made. Ethical and legal considerations may further require informing the individual of changes in the input attribute that could be made to produce a desirable outcome. This paper focuses on the latter problem of automatically generating counterfactual explanations. We propose a framework Counterfactual Generation with s(CASP) (CFGS) that utilizes answer set programming (ASP) and the s(CASP) goal-directed ASP system to automatically generate counterfactual explanations from rules generated by rule-based machine learning (RBML) algorithms. In our framework, we show how counterfactual explanations are computed and justified by imagining worlds where some or all factual assumptions are altered/changed. More importantly, we show how we can navigate between these worlds, namely, go from our original world/scenario where we obtain an undesired outcome to the imagined world/scenario where we obtain a desired/favourable outcome.
Paper Structure (30 sections, 3 figures, 1 table)

This paper contains 30 sections, 3 figures, 1 table.

Figures (3)

  • Figure 1: Left: Transition from Pre-Intervention World to the Post-Intervention World. Right: Intervention takes the original instance to the other side of the decision boundary. With feature independence, the new counterfactual is closer to the original instance. With causal dependencies, the new counterfactual is further away as more changes are made to the original instance.
  • Figure 2: Methodology of the Counterfactual Generation with s(CASP) (CFGS)
  • Figure 3: Query Results (adult): Left: We run the query with unassigned variables to obtain a list of instances that will be classified with the undesired result by the decision making rules. Middle: We run the counterfactual query with unassigned variables to obtain a list of counterfactual solutions for the given decision rules. Right: We first run the query to achieve the original-counterfactual pairs with unassigned variables to get all possible Original Instance- Counterfactual pairs with the cost highlighted. Secondly, we run the same query for a particular individual with an undesired outcome and obtain counterfactual solutions indicating what features need to be changed (here it was suggested to increase the value of B from 777)