Provably Robust Bayesian Counterfactual Explanations under Model Changes

Jamie Duell, Xiuyi Fan · 2026

Read Provably Robust Bayesian Counterfactual Explanations under Model Changes by Jamie Duell, Xiuyi Fan (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-16659.txt.

Introduction

Jamie Duell and Xiuyi Fan work on plain-language reasons for machine calls. A counterfactual reason tells what change would flip a call. A loan tool, say, might cite a higher wage. But models get fresh training all the time. Old reasons can break with each fresh train. Their 2026 preprint seeks reasons that hold up.

Their method gives reasons with two firm traits. First, the new case must earn a firm, sure call. Next, small model shifts must not shake that call much. The authors call such reasons safe in chance terms. Banks and clinics need reasons they can trust over time. This work points to ways of proof for such trust.

Catalog record

CREATORJamie Duell, Xiuyi Fan
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE72 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-16659

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Provably Robust Bayesian Counterfactual Explanations under Model Changes Jamie Duell, Xiuyi Fan Abstract Counterfactual explanations (CEs) offer interpretable insights into machine learning predictions by answering “what if?" questions. However, in real-world settings where models are frequently updated, existing counterfactual explanations can quickly become invalid or unreliable. In this paper, we introduce Probabilistically Safe CEs (PSCE), a method for generating counterfactual explanations that are δ \delta -safe, to ensure high predictive confidence, and ϵ \epsilon -robust to ensure low predictive variance. Based on Bayesian principles, PSCE provides formal probabilistic guarantees for CEs under model changes which are adhered to in what we refer to as the ⟨ δ , ϵ ⟩ \langle\delta,\epsilon\rangle -set. Uncertainty-aware constraints are integrated into our optimization framework and we validate our method empirically across diverse datasets. We compare our approach against state-of-the-art Bayesian CE methods, where PSCE produces counterfactual explanations that are not only more plausible and discriminative, but also provably robust under model change. 1 Introduction Counterfactual Explanations (CEs) have gained traction as a way to answer "what-if?" questions in machine learning (ML) ( 21 ) . A CE typically seeks a minimal alteration to an input that changes the model’s prediction to a desired class. To be reliable, CEs should satisfy core desiderata such as proximity , validity , discriminativeness , robustness and plausibility ( 15 ) . However, a critical challenge often overlooked is the robustness of CEs in dynamic environments. When an underlying ML model is updated, which is a common scenario in real-world applications such as online and continual learning ( 6 ; 19 ) explanations, the generated for the original model may become invalid. Small shifts in model parameters can move decision boundaries, rendering previous CEs useless. While some recent work has proposed post-hoc methods to update CEs after a model changes ( 5 ; 16 ) , a more principled approach is to generate explanations that are inherently robust to such perturbations from the outset. This requires integrating model uncertainty directly into the CE generation process. By considering a distribution over model parameters, as is natural in Bayesian frameworks like Bayesian Neural Networks (BNNs) ( 17 ) or Monte Carlo Dropout (MC Dropout) ( 4 ) , we can search for CEs that are not just valid for a single point estimate of the model, but remain valid across a whole family of plausible models. The core intuition is that a robust CE should be classified with both 1) high predictive certainty (a high mean probability for the target class) and 2) low predictive variance across the model posterior. A CE with these properties resides deep within the target class’s decision region, creating a "safety buffer" that makes it resilient to minor shifts in the decision boundary caused by model changes. Figure 1: Counterfactual examples for a PneumoniaMNIST ( 22 ; 23 ) image, transitioning from ‘pneumonia’(on the left) to ‘normal’. The output from our proposed method, PSCE, is shown alongside other Bayesian approaches discussed in this work. To formalize this, we introduce Probabilistically Safe Counterfactual Explanations (PSCE), a Bayesian-inspired method that generates CEs with formal guarantees on their robustness. PSCE optimizes for counterfactuals that are not only robust but also plausible by encouraging them to lie on the data manifold. This results in coherent and interpretable outputs, as illustrated in the medical imaging example in Figure 1 . Beyond generating plausible explanations, PSCE’s primary guarantee is robustness to model changes. We illustrate this core property with a simple example: Example 1 . Suppose a counterfactual is generated for a model trained on 70% of the available data. The model is then updated by training on an additional 5% of the data, causing its posterior distribution to shift. As shown in Figure 2 , the predictive probability for the PSCE-generated counterfactual remains well above the required threshold, demonstrating its robustness to the model change. Our theoretical bound, introduced later, formally guarantees this outcome. Figure 2: Predictive distribution for a CE before (p1) and after (p2) a 5% data increment. The PSCE-generated CE remains confidently classified, and the new prediction is well-described by our theoretical lower bound. In this work, we compare PSCE against other Bayesian, model-specific CE methods: BayesCF ( 2 ) and Schut et al. ( 14 ) . Our central contributions are threefold: 1. We introduce PSCE, a method for generating probabilistically safe counterfactuals that explicitly optimizes for high confidence and low variance. 2. We derive a theoretical bound that formally guarantees the validity of a counterfactual under a given magnitude of model change. 3. We empirically validate the robustness of PSCE against existing Bayesian CE methods, demonstrating its superior performance across key metrics from counterfactual literature. 2 Counterfactual Desiderata In this section, we informally discuss counterfactual desiderata as per recent literature ( 15 ) , ensuring that our approach is principled. Thus, we have the following: • Validity: Ensures the counterfactual instance falls into a desired counterfactual class. • Robustness: Ensures that sufficiently small model changes do not invalidate counterfactual instances from being classified under the desired counterfactual class. • Plausibility: Ensures that counterfactual instance is on the data manifold and thus is plausible as per the data. • Discriminativeness: Ensures that the counterfactual is distinguishable, thus looks like it belongs to the counterfactual class. • Proximity: Ensures that minimal changes are needed across all features to obtain a desired counterfactual instance. 3 Robust and Probabilistically Safe Counterfactuals To begin with the building blocks that constitute the central objective function, we consider a Bayesian lens for classification, in which the model parameters \omega are treated as random variables with a posterior distribution given the data \mathcal{D} . This takes the form: \displaystyle p(\omega|\mathcal{D})=\frac{p(\mathcal{D}|\omega)p(\omega)}{p(\mathcal{D})}, where p(\omega|\mathcal{D}) is the posterior distribution of the model parameters given the training data \mathcal{D} . In this work, we use both BNNs ( 17 ) and MC Dropout ( 4 ) to approximate p(\omega|\mathcal{D}) . From a Bayesian perspective, we begin by defining a classifier: Definition 1 (Bayesian Classifier) . A classifier with parameters \omega maps an input \mathbf{x}\in\mathbf{X} to logits: \displaystyle\mathbf{l}(\mathbf{x};\omega)=\langle l_{1}(\mathbf{x};\omega),\ldots,l_{C}(\mathbf{x};\omega)\rangle\in\mathbb{R}^{C}, the class probabilities are obtained via the softmax transformation: \displaystyle f_{c}(\mathbf{x};\omega)=\frac{\exp(l_{c}(\mathbf{x};\omega))}{\sum_{i=1}^{C}\exp(l_{i}(\mathbf{x};\omega))},\quad c=1,\ldots,C. Under the Bayesian formulation, the posterior predictive distribution is given by: \displaystyle p(y=c|\mathbf{x},\mathcal{D})=\mathbb{E}_{\omega\sim p(\omega|\mathcal{D})}\bigg[f_{c}(\mathbf{x};\omega)\bigg], the predicted label is: \displaystyle y=\underset{c\in\{1,\ldots,C\}}{\arg\max}\ p(y=c|\mathbf{x},\mathcal{D}). Given a classifier, we can then define a counterfactual instance from a Bayesian perspective to be given: Definition 2 (Counterfactual Instance) . Let \mathbf{x}\in\mathbb{R}^{J} be an instance, \mathcal{G}_{CF}:\mathbb{R}^{J}\to\mathbb{R}^{J} a counterfactual generator, and y the predicted class of \mathbf{x} under the Bayesian classifier. A counterfactual instance \mathbf{x}^{\prime} produced by a counterfactual generator \mathcal{G}_{CF} satisfies: \displaystyle\mathbf{x}^{\prime}:\underset{c\in\{1,\ldots,C\}}{\operatorname{arg\,max}}\ p(y^{\prime}=c|\mathbf{x}^{\prime},\mathcal{D})\neq y \displaystyle\text{where, }\mathbf{x}^{\prime}=\mathcal{G}_{CF}(\mathbf{x}). where, y^{\prime} is the counterfactual class. A posterior predictive distribution for a counterfactual \mathbf{x}^{\prime} belonging to a counterfactual class y^{\prime} is given as: \displaystyle p(y^{\prime}|\mathbf{x}^{\prime},\mathcal{D}) \displaystyle=\int p(y^{\prime}|\mathbf{x}^{\prime},\omega)p(\omega|\mathcal{D})d\omega=\mathbb{E}_{\omega\sim p(\omega|\mathcal{D})}\bigg[p(y^{\prime}|\mathbf{x}^{\prime},\omega)\bigg]. To ensure counterfactuals remain valid, we additionally require that they lie in high-likelihood regions of the data distribution, which we model via a generative density p_{\theta}(\mathbf{x}) in the model. The likelihood of a candidate counterfactual instance \mathbf{x}^{\prime} being valid can be assessed through the learned likelihood p_{\theta}(\mathbf{x}) . Parameters \theta are optimised for the dataset \mathbf{X} according to: \displaystyle\theta^{*} \displaystyle:=\underset{\theta}{\arg\max}\ \frac{1}{|\mathbf{X}|}\sum_{\mathbf{x}\in\mathbf{X}}\log p_{\theta}(\mathbf{x})=\underset{\theta}{\arg\max}\ \frac{1}{|\mathbf{X}|}\sum_{\mathbf{x}\in\mathbf{X}}\log\int p_{\theta}(\mathbf{x}|\mathbf{z})p(\mathbf{z})d\mathbf{z}. This corresponds to maximising the marginal log-likelihood

Read the complete text