Papers › Counterfactual Concept Bottleneck Models

Counterfactual Concept Bottleneck Models

2 Feb 2024arXiv:2402.01408archive 2025-07-28

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

Current deep learning models are not designed to simultaneously address three fundamental questions: predict class labels to solve a given classification task (the "What?"), simulate changes in the situation to evaluate how this impacts class predictions (the "How?"), and imagine how the scenario should change to result in different class predictions (the "Why not?"). The inability to answer these questions represents a crucial gap in deploying reliable AI agents, calibrating human trust, and improving human-machine interaction. To bridge this gap, we introduce CounterFactual Concept Bottleneck Models (CF-CBMs), a class of models designed to efficiently address the above queries all at once without the need to run post-hoc searches. Our experimental results demonstrate that CF-CBMs: achieve classification accuracy comparable to black-box models and existing CBMs ("What?"), rely on fewer important concepts leading to simpler explanations ("How?"), and produce interpretable, concept-based counterfactuals ("Why not?"). Additionally, we show that training the counterfactual generator jointly with the CBM leads to two key improvements: (i) it alters the model's decision-making process, making the model rely on fewer important concepts (leading to simpler explanations), and (ii) it significantly increases the causal effect of concept interventions on class predictions, making the model more responsive to these changes.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.01408")

Code

Syntology Ran 12 of 16 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 12 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

gabriele-dominici/counterfactual-cbm officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 12 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

12ran
4unverified

Licence: 16 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from gabriele-dominici/counterfactual-cbm. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

EI gabriele-dominici/counterfactual-cbm/baycon/baycon/acquisition_functions.py official repository ran no licence file found · pointer only · b6a6628cdfc08742 · report
PI gabriele-dominici/counterfactual-cbm/baycon/baycon/acquisition_functions.py official repository ran fingerprinted no licence file found · pointer only · c0dd3d59e18c2e97 · report
UCB gabriele-dominici/counterfactual-cbm/baycon/baycon/acquisition_functions.py official repository ran no licence file found · pointer only · 12aa7a459caa41dc · report
extract_concepts gabriele-dominici/counterfactual-cbm/ccbm/utils.py official repository ran no licence file found · pointer only · e5a8875083f3d66c · report
filter_outliers gabriele-dominici/counterfactual-cbm/baycon/baycon/bayesian_generator.py official repository ran no licence file found · pointer only · e21532e86b163c25 · report
hinge_loss gabriele-dominici/counterfactual-cbm/ccbm/models.py official repository ran fingerprinted no licence file found · pointer only · 5ca94368a93ee4e7 · report
intersection_over_union gabriele-dominici/counterfactual-cbm/ccbm/metrics.py official repository ran fingerprinted no licence file found · pointer only · b7d0860747dbad15 · report
randomize_class gabriele-dominici/counterfactual-cbm/ccbm/utils.py official repository ran fingerprinted no licence file found · pointer only · c0863e960752f7f5 · report
scale gabriele-dominici/counterfactual-cbm/baycon/common/DataAnalyzer.py official repository ran fingerprinted no licence file found · pointer only · 2b68d4e9b71800ad · report
score_y_away_from_target gabriele-dominici/counterfactual-cbm/baycon/common/ScoreCalculator.py official repository ran no licence file found · pointer only · 6d9ff45b5f74b1d7 · report
score_y_reaching_target gabriele-dominici/counterfactual-cbm/baycon/common/ScoreCalculator.py official repository ran no licence file found · pointer only · 12a80c0bb92deeca · report
variability gabriele-dominici/counterfactual-cbm/ccbm/metrics.py official repository ran fingerprinted no licence file found · pointer only · db27655f907743ca · report
cf_in_distribution gabriele-dominici/counterfactual-cbm/ccbm/metrics.py official repository unverified no licence file found · pointer only · a1c54e25ee630b04 · report
encode gabriele-dominici/counterfactual-cbm/baycon/common/DataAnalyzer.py official repository unverified no licence file found · pointer only · 3c06307d039c83ce · report
load_data gabriele-dominici/counterfactual-cbm/ccbm/utils.py official repository unverified no licence file found · pointer only · 5a99191dfe200ab1 · report
sample_different_label gabriele-dominici/counterfactual-cbm/ccbm/baycon.py official repository unverified no licence file found · pointer only · b5cb8a79e23ce469 · report

Tasks

Decision Making

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Counterfactuals

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections