Counterfactual Explanations: The What-Ifs of AI Decision Making

04-04-2024
Counterfactuals: Demystifying AI decision-making for greater clarity.

Counterfactual explanations are essential in bridging the gap between AI decision-making and human understanding, offering clear insights into how small changes in inputs could lead to different outcomes. This approach increases transparency, builds trust, and supports ethical AI practices.

When AI Says "No" - The Role of Counterfactuals in Understanding “Why”

Imagine applying for a loan and getting a straight “no” from an artificial intelligence (AI) system. Disappointing, right? In an era dominated by AI-driven decision-making, understanding the "why" behind those decisions is critical for trust and clarity. Counterfactual explanations (CEs) are one way to ground these AI-driven predictions, and it serves as an important bridge that turns AI decisions into understandable narratives. 

Counterfactuals: Decoding AI's "What-If" Scenarios

The concept of counterfactual reasoning has its origins in philosophical debates about causality and the nature of truth. Philosophers such as David Lewis have discussed counterfactuals in the context of modal logic and the analysis of causal statements. CEs are now used in a variety of fields including philosophy, psychology and more recently in explainable AI (XAI).

A counterfactual explanation involves describing a situation or outcome by considering alternative scenarios or events that did not happen but could have happened. Given the context of an AI model for decision-making, a counterfactual explanation can illustrate how a change in particular input variables can lead to a different decision. Referring to the scenario of a declined loan application, a counterfactual explanation might suggest: “If the income had been a little higher, the application would have been approved”. 

How Counterfactuals Work

Designing such scenarios is both an art and a science. It involves understanding the decision boundaries of an AI-model and changing the input variables just enough to affect the decision. Hence, research in counterfactual explanations has focused on the problem of finding CEs that guarantee some desired qualities such as credibility, minimality, similarity, plausibility, discriminative power, actionability, causality and diversity. (Mothilal, 2020). They can be categorized into three main clusters:

  1. Balancing act: the goal is to find the smallest change that makes the biggest difference. It is about precision - changing the inputs just enough to change the outcome without suggesting unrealistic or impractical changes. 
  2. Realism and causality: it's not just about finding any change; it's about finding a plausible one. The suggestions must make sense in the real world. For example, advising someone to get a decade younger is not a useful counterfactual.
  3. Tools at play: various algorithms and tools are employed to craft such explanations. From optimization techniques to causal inference models, the tools aim to strike a balance between simplicity and thoroughness. 

What This Means for Businesses and Tech Experts

For businesses, CEs are more than just a technical feature. They're a tool for building trust and transparency with customers and regulators. For professionals such as data scientists working with AI and machine learning, counterfactual explanations are particularly valuable because they allow them to interpret complex models. This is especially true when dealing with real-world, unstructured data where the relationships between inputs and outputs are not straightforward. Counterfactuals help to identify which aspects of the input data are most influential in the model's decisions, aiding in model debugging, fairness analysis and improving model performance.  

The Legal and Ethical Fabric of Counterfactual Explanations

In the FS sector, counterfactual explanations are not merely tools for clarity; they are pillars of trusted AI practice. These explanations fulfil several important functions, including:

  1. Enhancing consumer understanding: e.g., if a health insurance claim is denied, counterfactuals might point out missing documentation or unmet policy conditions, providing clear guidance for future claims.
  2. Facilitating regulatory compliance: CEs help financial institutions comply with various regulations. In the EU, for instance, the General Data Protection Regulation (GDPR) and AI Act mandate transparency in automated decision-making. CEs enable compliance by providing the necessary transparency in decisions made by AI systems, particularly in scenarios where customer data is used to determine eligibility for services or products.

The Future of Explainable AI

As artificial intelligence continues to make important decisions in our lives, the demand for explainable and defensible AI systems will only increase. Counterfactual explanations are one of the keys to unlocking the “black box” of AI, turning unexplainable algorithms into easy-to-understand narratives.  ore accurate and meaningful counterfactual explanations, especially in complex systems where multiple variables interact in a non-linear manner. In conclusion, it's important to remember that AI is, at its best, a tool to complement human decision-making, rather than replacing it. As we enter the age of AI, let's make sure our technologies don’t just make decisions, they explain them.

Bobby Zarkov

Partner, Financial Services

KPMG Switzerland

Blog author Alena Moiseeva
Alena Moiseeva

Expert, Digital Innovation

KPMG Switzerland