Counterfactual Concept Bottleneck Models

Gabriele Dominici, Pietro Barbiero, Francesco Giannini, Martin Gjoreski, Giuseppe Marra, Marc Langheinrich

TL;DR

CounterFactual Concept Bottleneck Models (CF-CBMs) are a new class of interpretable deep learning models designed to simultaneously predict outcomes, simulate interventions, and generate "Why not?" explanations. By training a counterfactual generator jointly with a Concept Bottleneck Model, the authors create a system that is not only highly accurate but also more robust, relying on a smaller, more causal set of human-understandable concepts.

What Problem Does This Paper Address?

Standard deep learning models are excellent at answering "What?" (e.g., "What is in this X-ray?"), but they struggle with "How?" (simulating changes) and "Why not?" (imagining alternative scenarios). Concept Bottleneck Models (CBMs) were designed to bridge this gap by predicting intermediate, human-understandable concepts (like "collapsed lung") before making a final classification.

However, standard CBMs have a major flaw: they aren't generative. They cannot easily tell you what would need to change for a different prediction to occur. Existing post-hoc counterfactual methods often operate at the pixel level, producing "noisy" images that are difficult for humans to interpret. As shown in Figure 1, identifying changes at the input (pixel) level requires significant effort, whereas concept-level changes provide immediate, actionable insights.

Concept vs Input Level Counterfactuals

Methods

The authors introduce CounterFactual Concept Bottleneck Models (CF-CBMs). Unlike previous approaches that bolt on an explanation module after a model is trained, CF-CBMs use a latent variable framework to integrate counterfactual generation directly into the training process.

The architecture consists of four main components:

  1. Encoder: Maps the input $x$ to a latent distribution $z$.
  2. Concept Predictor: Maps $z$ to human-understandable concepts $\hat{c}$.
  3. Task Predictor: Uses these concepts to predict the final class $\hat{y}$.
  4. Counterfactual Encoder: This is the core innovation. It takes the current state and a desired alternative label $y'$ to produce a new latent distribution $z'$, which then generates the counterfactual concepts $\hat{c}'$.

The key to this approach is joint training. By optimizing the classification task and the counterfactual generation task simultaneously, the model is forced to learn a concept space where small, meaningful changes in concepts lead to predictable changes in the final output. This workflow is illustrated in Figure 2.

CF-CBM Workflow

Datasets

The researchers evaluated CF-CBMs across five diverse datasets to test their versatility:

  • dSprites: A synthetic dataset of 2D shapes used to test how models handle basic visual concepts.
  • MNIST addition: Predicting the sum of two handwritten digits.
  • CUB: A challenging fine-grained bird classification dataset with 200 species and 118 bird attributes.
  • CIFAR10: General object classification, with concepts automatically extracted via CLIP.
  • SIIM Pneumothorax: A medical dataset of chest X-rays where the model identifies the presence of a collapsed lung based on clinical concepts.

Key Insights and Results

  • Joint Training as a Regularizer: One of the most surprising findings is that training the model to be "explainable" actually changes how it thinks. Joint training forces the task predictor to rely on a smaller, more relevant subset of concepts. This leads to sparsity, making the model's logic easier for a human to follow.
  • Ignoring Confounders: Standard CBMs often fall into the trap of "shortcuts"—relying on correlations rather than actual causes. Because CF-CBMs must be able to generate valid counterfactuals, they learn to ignore these confounding factors and focus on the concepts that truly drive the classification.
  • Real-time Explanations: Because the counterfactual generator is part of the model, it can produce "Why not?" explanations instantly at test time, without needing the expensive post-hoc searches required by other methods.
  • Predictive Performance: CF-CBMs achieve classification accuracy comparable to "black-box" models and standard CBMs, proving that you don't have to sacrifice performance for interpretability.
  • Counterfactual Validity: In tests across all five datasets, CF-CBMs consistently outperformed post-hoc baselines (like BayCon and VCNet) in generating "valid" counterfactuals—meaning the suggested concept changes actually resulted in the desired alternative classification.
  • Causal Impact: Using the Causal Concept Effect (CaCE) metric, the authors showed that interventions on CF-CBM concepts have a significantly higher impact on the final prediction compared to standard models, making them more responsive to expert input.

Limitations and Future Work

While CF-CBMs represent a significant step forward, they still face some common hurdles in the field of interpretability:

  • Concept Dependency: The model assumes access to a set of meaningful concepts. If the initial concept annotations are poor or "impure," the resulting explanations will be less useful.
  • Generative Approximation: While efficient, the latent variable approach is an approximation. It may not always find the mathematically absolute minimal change required for a counterfactual, though it is much faster than exact methods.

Future directions include exploring how these models could be used in "human-in-the-loop" systems, where experts can interactively correct a model's concepts to improve its final diagnosis in real-time.

Summary updated

BibTeX
@inproceedings{dominici2025counterfactual,
  author = {Gabriele Dominici and Pietro Barbiero and Francesco Giannini and Martin Gjoreski and Giuseppe Marra and Marc Langheinrich},
  title = {{Counterfactual Concept Bottleneck Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=w7pMjyjsKN},
}
Figure