DiCoFlex: Model-Agnostic Diverse Counterfactuals with Flexible Control
Authors: Oleksii Furman
Ulvi Movsum-zada
Patryk Marszałek
Maciej Zieba
Marek Śmieja
Venue: NeurIPS 2025 poster ()
Keywords: Explainable AI
Counterfactual Explanations
Tabular Data
Normalizing Flows
Primary area: social_and_economic_aspects_of_machine_learning
TL;DR: DiCoFlex generates diverse, customizable counterfactual explanations in a single forward pass without requiring model access, enabling real-time constraint adjustments

Abstract: Counterfactual explanations play a pivotal role in explainable artificial intelligence (XAI) by offering intuitive, human-understandable alternatives that elucidate machine learning model decisions. Despite their significance, existing methods for generating counterfactuals often require constant access to the predictive model, involve computationally intensive optimization for each instance, and lack the flexibility to adapt to new user-defined constraints without retraining. In this paper, we propose DiCoFlex, a novel model-agnostic, conditional generative framework that produces multiple diverse counterfactuals in a single forward pass. Leveraging conditional normalizing flows trained solely on labeled data, DiCoFlex addresses key limitations by enabling real-time, user-driven customization of constraints such as sparsity and actionability at inference time. Extensive experiments on standard benchmark datasets show that DiCoFlex outperforms existing methods in terms of validity, diversity, proximity, and constraint adherence, making it a practical and scalable solution for counterfactual generation in sensitive decision-making domains.

DiCoFlex: Model-agnostic diverse counterfactuals with flexible control
Oleksii Furman'
Ulvi Movsum-zada Patryk Marszalek
Maciej Zięba 1.4
Marek Smieja?
WWroclaw University of Science and Technology
Faculty of Mathematics and Computer Science, Jagiellonian University, Kraków, Poland Doctoral School of Exact and Natural Sciences, Jagiellonian University, Kraków, Poland *Tooploxx Sp. o.o.
wwt.ssiii.uummaauurrrr. edu. edu.pl, ulvi movsumzaded@gaiil............ com,
patryk attrrkk..arszalleddootoraaal uj edu. pl, maciej wiieiizpr.eeeddiiie.. marek. smieja edu.pt pl
Abstract
Counterfactual explanations play pivotal role in explainable artificial intelligence (XAI) by offering intuitive, human-undeersanddbbl alternatives that elucidate ma- chine learning model decisions. Despite their significance, existing methods for generating counterfactuals often require constant access to the predictive model, involve computationally intensive optimization for each instance and lack the flex- ibility to adapt to new user-defined constraints without retraining. In this paper, we propose DiCoFlex, novel model-agnostic, conditional generative framework that produces multiple diverse counterfactuals in a single forward pass. Leveraging conditional normalizing flows trained solely labeled data, DiCoFlex addresses key limitations by enabling real-time user-driven customization constraints such sparsity and actionability inference time. Extensive experiments standard benchmark datasets show that DiCoFlex outperforms existing methods in terms of validity, diversity, proximity, and constraint adherence, making it practical and scalable solution for counterfactual generation in sensitive decision-makingg domains.
Introduction
Counterfactual explanations (CFs) have become an integral part of explainable artificial intelligence (XAI) by providing human-interprettable insights into complex machine learning models [13. CFs answer critical "what-if" questions by suggesting minimal and meaningful changes to input data that could alter the outcome of predictive model [44). Such explanations have valuable applications across sensitive domains, including finance, healthcare, and legal decisions, where understanding the predictions of the model and potential alternative outcomes paramount 48
According to Guidotti [3], an ideal counterfactual explanation should satisfy several key properties. First, it must demonstrate validity by successfully changing the model's prediction. Second, it should maintain proximity by remaining as close as possible to the original input, minimizing the amount of change. Third, should exhibit sparsity by modifying only the smallest possible set of
Equal contribution.
39th Conference on Neural Information Processing Systems (NcurIPS 2025).

---

1.0
03
0.7
0.7
0.7
0.5
0.5
Dectson Brundary
Original Class
0.4
0.1
0.4
Tarpet Cass
Factual Paina
Counisrfocial Paiits
0.0
0.1
07
0.3
0.1 Foaturs
25
66
0.7
0.8
0.0
0.5
0.2
0.3
04
55
06
0.7
0.8
0.0
03
02
0.3
6.6
Featuns
(a) Unconstrained
(b) Sparsity constraints
(c) Actionability constraints
Figure I: Visualization of diverse counterfactual explanations generated by DiCoFlex for a single instance using artificial two-class moon-shaped dataset. Each subfigure demonstrates different constraint scenarios: (a) no constraints applied, showing natural diversity: (b) sparsity constraints enforced through the p-norm parameter, resulting in minimal feature modifications; and (c) action- ability constraints applied via feature masks, restricting which features can be modified.
features. Fourth, it must ensure plausibility by remaining within the realm of realistic, observed data. Finally, it should guarantee actionability by suggesting changes that are feasible for the stakeholder implement.
In practice, however, these criteria often conflict. For instance, the smallest possible change may result in samples outside the realistic data distribution. To address this, Mothilal et al. [22] and Laugel et al. [20) argue that, rather than producing a single "best" counterfactual explanation, a diverse set of CFs should be generated. Presenting multiple realistic alternatives allows users to achieve the desired outcome, explore trade-offs between minimal change and realism, and gain deeper insight into the model's decision boundaries. This diversity, in turn, empowers stakeholders to make more informed, feasible decisions.
different ways
Current approaches to diverse counterfactual generation face significant limitations. Optimization- based methods like DiCE [22] and multi-objective frameworks (7] incorporate diversity directly into their cost functions but require solving complex, separate optimizations for each explanation. This results in high computational costs and latency, making them impractical for real-time applications. Meanwhile, generative approaches such those by Pawelezyk al. (28 and Panagiotou et al. [25] offer efficiency improvements but frequently produce redundant explanations, require access to model gradients, and lack flexibility for adapting user-defined constraints without extensive retraining.
To address these limitations, we introduce DiCoFlex, novel conditional generative framework capable of generating multiple diverse CFs in single forward pass. DiCoFlex is model-agnostic and does not require constant access to the underlying predictive model at any stage, relying solely on a dataset labeled by classification model. Our approach leverages conditional normalizing flows to learn the distribution of counterfactual explanations that inherently satisfy user-specified constraints.
In contrast to existing methods, DiCoFlex incorporates customizable constraints such as sparsity and actionability directly at inference time, eliminating the need for retraining when constraints change. During inference, DiCoFlex achieves computational efficiency by generating multiple diverse CFs through single forward pass, thus avoiding the computational burden inherent in methods that require separate optimization procedures for each counterfactual. As illustrated in Figure [ our method can operate under different constraints. DiCoFlex generates diverse and plausible counterfactual explanations without any restrictions imposed on sparsity or actionability (as shown in Figure Lap. Sparsity, controlled by the user-defined exponent in L, norm, ensures minimal modifications in input features (as demonstrated in Figure lb), while actionability constraints allow users to specify immutable features through a mask, guiding the generation towards practically feasible explanations (shown in Figure Ic). These parameters can be dynamically adjusted at inference time, providing unprecedented flexibility in generating counterfactual explanations that satisfy domain-specttn constraints while maintaining balance between diversity and validity without requiring explicit diversity penalties.
The main contributions of our work are summarized as follows:

---

We propose DiCoFlex, a classifier aggnosiie-agnoosiic conditional generative framework that generates multiple counterfactuals efficiently a single forward pass, without the need for model retraining or optimization per query instance.
Our method enables real-time customization of constraints including sparsity and actionabil- ity, providing practical, user-centric control over counterfactual generation.
We extensively evaluate DiCoFlex on benchmark datasets, demonstrating superior perfor- mance in terms of validity, proximity, diversity, and constraint compliance compared to existing state-of-the-art approaches.
2
Related Work
Counterfactual explanations (CFs) have become integral to explainable AI by providing intuitive alternatives that elucidate model decisions [4]. Optimization-baset methods formulate CF generation as minimizing distance between instances while ensuring prediction changes, using implementations including pradient-based approaches 44), integer programming 41, genetic algorithms [7]. and satisfiability problems [18]. Instance- based methods like FACE [29] select examples yielding desired predictions from existing data, while CBCE [19] merges features from paired contrasting instances. Model-specific approaches such as decision tree methods 14 38 leverage model structure by traversing alternative paths.
Diverse Counterfactual Explanations Generating multiple diverse counterfactuals offers sig- nificant advantages over single explanations by providing alternative paths for recourse and better illustrating decision boundaries [20] [2]. DiCE [2 directly incorporates diversity into its loss func- tion but requires separate optimization for each explanation, increasing computational costs. Other approaches achieve diversity through various strategies: DiVE [33] employs determinantal point processes, while methods like (39 35 5 partition the feature space. Multi-objective approaches like MOC 7 generate solutions representing different trade-offs between properties such as proximity and sparsity, while CARE [30 and OrdCE [17] incorporate preferences into the generation process.
Generative Models for Counterfactuals Generative models have gained popularity for counter-
factual generation due to their ability to produce more plausible explanations that remain on the data
manifold. VAE-based approaches include ReViSH [6]. C-CHVAE (28), CLUE (2. and CRUDS [00
which learn latent representations of the data distribution. GAN-based methods such as GeCo [36
and SCGAN (48) use adversarial training to balance validity and realism. Recent transformer-basee
approaches like TABCF [25) specifically target tabular data with mixed types. Normalizing flows have also been explored for counterfactual generation [2], where they model the class-conditional distribution for plausibility assessment during gradient- based optimization. However, many of these approaches still require access to model gradients, produce redundant explanations, or lack flexibility in handling user-defined constraints.
Handling Constraints in Counterfactual Generation Practical counterfactual explanations must satisfy various constraints including sparsity (minimizing modified features) and actionability (en- suring feasible changes). CERTIFAI (37] employs genetic algorithms to enforce constraints, while conditions on immutable features. Methods focused on actionable recourse, such as
MCCE B1
account for downstream effects of feature modifications, while Russell [34] and Verma et al. [43 generate explanations representing different modification strategies. However, most exist- ing approaches require retraining reoptimization when constraints change, limiting their flexibility in real-world applications.
CSCF 23
Limitations of Current Approaches Current counterfactual methods face substantial limitations for tabular data: optimization based approaches require high computational costs for diverse explana- tions (22), and generative models often produce redundant explanations, require model gradients, or lack constraint flexibility (28). Our proposed approach, DiCoFlex, addresses these limitations through conditional generative framework that efficiently produces diverse counterfactuals in single forward pass, enables real-time constraint customization, operates without requiring model access, and naturally handles mixed feature types.
3

---

3 DiCoFlex Method
Given classification model h and an initial input example X within a d-dimensional real space R.d one seeks to determine counterfactual instance x' E IR A counterfactual x' represents sample, which (i) is classified to desired class y' by the model h (i.e. h(x') = y²). (ii) lies close enough to xo according to some distance measure, d(xo, x'), and (iii) is plausible (in-distribution sample).
This problem formulation focuses on the deterministic extraction of counterfactuals, where, for given example Xo and desired class y', the model returns a single counterfactual x'. In practice, generating more plausible candidates provides wider spectrum of possible explanations satisfying validity, plausibility, and proximity constraints. Therefore, we postulate an approximate conditional distribution for counterfactuals for given example X₂ and the target class p(x' Xx: 3/).
In this section, we first introduce a general objective function for a model generating counterfactual explanations. Next, we parametrize our model with normalizing flow and explain our strategy for scoring counterfactual candidates in a training phase. Finally, we introduce sparsity and actionability constraints and summarize the training algorithm.
3.1 The model objective
We consider the parameterized model (x [x,, v²) for the distribution approximation. Direct optimization of pe [x 3²) is challenging, because we do not have access to the training ground- truth pairs composed of initial examples Xn and the corresponding counterfactuals x' for class y'. Therefore, we introduce conditional distribution q(x' [xo; 3/) and we utilize the expected value of Kullback-Lein Leibler divergence (KLD) between po [xo. yz) and qx'xx(xxxx (xx as training objective:
C Ex- w ((h()))
[DK [x. 1/) po(x'ix v')I
log q(x') |x, 1/) pe (x' xx,
Exx,y Exl x.y")
(2)
Exirglx x,y") [log q(xxxx(xx)xx |x, v') log (xopxpox///// (x,
where x is an example from the data distribution Pdam (training example) and y/ is sampled from categorical distribution representing the prior over classes, excluding the current class of x. predicted by h(.). The component q(x') x. y²) does not depend on parameters 0, therefore the final objective is:
Q
- Ex,y Ex (xx'' [log (x |x, v')l
We further elaborate on how po (x'{ |x, 3/) is modeled and how sample from q(x' [x. s
3.2 Modeling predictive conditional distribution
Our approach aims at directly optimizing the conditional negative bog-liielihood given by 4 with the data sampled from the distribution gxx'| x, s/). As consequence, requires access to the parametrized density function. Several techniques, such as Kernel Density Estimation (KDE) and Gaussian Mixture Models (GMM), can be used to model the conditional density function po (x | y/ In this work, we propose using a conditional normalizing flow model [32] for this purpose. Unlike KDE or GMM, normalizing flows do not rely on a predefined parametric form of the density function and are well-suited for modeling nighddimensional data. Furthermore, in contrast to other generative models, such as diffusion models or GANs, normalizing flows allow for exact density evaluation via the change of variables formula and can be efficiently trained by minimizing the negative log- likelihood. The general formula that represents normalizing flows can be expressed as:
(x (x, v/) = xx, |det Jf. (x':,,)))1
(5)
where fo(x'; x, y/) is an invertible transformation conditioned on x and y/: Pzppo x, v/)) the base distribution, typically Gaussian and J (x'; y²) ) is Jacobian of the transformation. The biggest

---

challenge in normalizing flows is the choice of the invertible function for which the determinant of Jacobian easy calculate. Several solutions have been proposed in the literature address this issue with notable approaches, including NICE 8 RealNVP [ and MAF [26]. Based on superior performance on benchmark dataset, we selected MAF as our normalizing flow model (see Appendix D).
3.3 Selecting training counterfactual explanations
The distribution qxx'>x x. 3/) is essential to sample data to train the flow model. Since we do not have direct access to this distribution, we introduce the straightforward technique of querying training counterfactual examples x', which are similar to the input data and satisfy h(x') = y/- For this purpose,
typical KNN (K-nearest neighbors) heuristic, in which we sample K data points
labeled as yf by the classifier that are closest to the input x. Since we are sampling training examples from class y' the validity and plausibility constraints hold, while the proximity is satisfied by using the KNN approach.
Concluding, the approximation for the probability distribution q(-) is as follows:
k if E N V ddd.d/ddd.. K),
((x'1x,
(6)
otherwise,
where N(x, v/ d) is set of K closest neighbors of in class y', considering distance measure d(
One could ask whether direct use of the distribution q(x' x,y', d) be alternative for gener- ating counterfactual explanations, instead of learning a parametrized flow-based model (x x, y'). Observe that the use of ② inherently limited by the number of available training examples and lacks the ability to generalize to unseen instances. Additionally, the diversity of generated examples is constrained by the number of selected neighbors. Modeling generative model provides smooth changes over input examples and allows for extrapolating counterfactual generation outside training data. Importantly, our sampling strategy provides theoretical guarantees by construction: sampled counterfactuals are guaranteed to be valid, proximal, and plausible. We formalize these properties in (Appendix
Propositions A.3 A.4 and A.5
3.4 Sparsity on continuous features
In many practical use cases, counterfactuals need to satisfy additional constraints, such as sparsity, This means that, addition to minimizing the Euclidean distance, a counterfactual has to minimize the number of modified attributes. While sparsity is often implicitly achieved for categorical variables due to the applied optimization scheme, enforcing sparsity on continuous features remains challenging. We show that the sparsification of continuous attributes can be controlled in the inference phase by an auxiliary conditioning factor in a flow model.
Instead of querying neighbor examples to according to Euclidean distance in KNN search, we use Ip distance function given by:
1/p
D Σ lay 11
xx(x,,x)= = ||x x11p
=
We can observe that the level of modificd attributes can be controlled through an appropriate choice of the value of p. For instance, if p 0.01, neighbors with fewer modified attributes are favored, thereby enforcing sparsity. Making use of p = gives a standard Euclidean proximity measure. Since categorical attributes are commonly encoded by one-hot vectors, the 4, distance exhibits discrete jump property: the distance equals 0 if categories match and a fixed value otherwise, regardless of This discrete structure naturally limits categorical changes. Therefore, the above scheme affects mostly continuous features.
In practice, the sparsity level can be effectively controlled in the inference time by incorporating the parameter p into the flow model po(x' x,) through additional conditioning. During training, values of are sampled and explicitly included in the conditioning of the model, allowing it to learn
5

---

the relationship between p and the desired sparsity in the generated outputs. As result, during the inference stage, users can adjust the sparsity level of the modified attributes simply by selecting an appropriate value of p. This mechanism provides flexible and interpretable way to regulate the extent of changes applied to the input x, depending on specific needs or constraints. Note, however, that the applied I, norm does not freeze the continuous attributes but only encourages small changes on their portion, which can be seen as a type of soft constraint. From a theoretical perspective, using small p values (e.g., 0.01) restricts the neighborhood N (z, y',d,, K) to more concentrated region of the feature space, which typically corresponds to higher-density areas of the data manifold. This explains why DiCoFlex achieves improved plausibility scores empirically, as formalized in Proposition A.5
3.5 Actionability constraints
One of the crucial aspects of counterfactual explanations is enforcing the manipulation of some particular attributes. In order to accomplish that, our approach, we introduce further modification in distance function while calculating the nearest neighbors:
D
ppmm (x, x') = =|X- x pp = a Σ mslay - 22Il + Ea - x3Il;,
(8)
j=1
where {0, 1)P0 is binary vector, for which ma 1 indicates the attributes that should not be modified. The value of hyperparameter a should be large enough to prevent attributes ma = from modification.
During training the masking vectors m are sampled from some set of possible mask patterns M and the mask is also delivered as conditioning factor to the flow-based model, which represents po(x') x, y' p, m). Once trained with a set of masks M, DiCoFlex can dynamically change the mask during inference resulting in imposing different user expectations. Similar to enforcing sparsity, here we do not prevent from modifying masked attributes completely but only encourage the model to prioritize changing unmasked features first.
3.6 Training
Concluding, the training procedure for estimating is follows. For each training iteration, is selected from data examples and the target class y' is sampled for counterfactual explanation. Value that represents the sparsity level is also sampled from some predefined set P, as well as the masking vector m from M. Next, the set N(x. V/ dp.m. K') of K nearest neighbors is calculated considering distance measure dy.m given by (8) The counterfactual x' is sampled from q(x' |x. y' dp.m) given by (6). Finally, 0 is updated in gradient-based procedure by optimizing (4), considering conditioning both on p and m. Appendix F contains the details of the training algorithm.
The training procedure inherits several desirable theoretical properties from the K nearest neighbors sampling mechanism. First, all training samples are guarantced be valid counterfactuals by construction (Proposition A.3). Second, proximity is controlled through an implicit upper bound determined by the K-th nearest neighbor (Proposition A.4). Third, plausibility is ensured all samples originate from the training distribution (Proposition A.5). Finally, the normalizing flow learns preserve diversity with a formal guarantee that expected diversity remains close to the empirical diversity, with deviation bounded by the training error (Theorem A.2). These theoretical foundations provide principled justification for the empirical performance demonstrated in Section
4 Experiments
In this section, we conduct series of experiments that evaluate the quality of counterfactual explanations generated by various methods 2 Our main objective is to understand how effectively these counterfactuals flip the predictions of model while maintaining realism, requiring minimal changes to the input, and offering diversity among the generated alternatives.
Cooe available https:: / http:p////g.habb......tttttt///p com/oofurma///iCoFle..

---

4.1 Experimental Setup
Datasets We evaluate all methods on five well-established benchmark datasets commonly used in counterfactual explanation research: Adult [3] (income prediction), Bank Marketing [21] (customer response classification), Default 47 (credit card default risk prediction), Give Me Some Credit (GMC) (8 (financial insolvency prediction), and Lending Club [I5] (loan creditworthiness classifi- cation), see Appendix [ for details. These datasets are selected for their diversity in dimensionality, feature types (mixed categorical and continuous variables), and real-world applicability. allowing us to evaluate the robustness and generalizability of our approach across different domains.
Parameterization of DiCoFlex For our experimental evaluation, we compare two variants of our method: DiCoFlex with default Euclidean distance (p=2.0) and DiCoFlex (p=0.01), which uses the hp norm with p=0.01. This latter version encourages higher sparsity for continuous features, leading to explanations that alter fewer continuous attributes while maintaining validity, see Section 3.5 Importantly, these configurations are not separate methods but represent different inference- time settings of the same trained model. This design demonstrates DiCoFlex's 's ability to dynamically adjust sparsity and proximity constraints without any retraining, enabling continuous user control over counterfactual behavior.
We compare our approach against several state-of tate-offthhearr counterfactual expla- nation methods. First of all, we consider methods, which generate multiple explanations for single data point. CCHVAE [28] employs a conditional variational autoencoder to generate counterfactuals consistent with the data distribution. DiCE [2 uses gradient-basee optimization to produce diverse counterfactuals in a model-agnostic framework. For all these methods, we generate up to 100 coun- terfactual explanations for each factual instance whenever feasible and randomly select 10 samples based solely on the validity criterion to provide an equal number of counterfactuals for every method.
Baseline Methods
Additionally, we compare with methods focused on returning single explanation. ReViSE [16] introduces a probabilistic framework designed to separate sensitive and non-sensitive features with a focus on interpretability. The approach by Wachter et al. [44] represents pioneering optimization- based method that minimizes a loss function balancing proximity to the input with the goal of changing the prediction. TABCF [25] specifically targets tabular data with transformer-bie based VAE approach. This class of methods is expected to perform better because they are optimized for producing single best explanation while the first class of methods takes diversity criterion priority.
We evaluate counterfactual quality using metrics aligned with key desirable properties. For test instances originally classified as class O, we generate corresponding counter- factuals targeting class I and vice versa. Validity measures the percentage of counterfactuals that successfully change model predictions to the target class. Hypervolume 24 is used to measure diversity quantify the spread and coverage of counterfactuals in the objective space. Plausibility is assessed through Local Outlier Factor (LOF) [4] that measure local density deviation of data point compared to its neighbors. Sparsity quantifies feature modifications, calculated as the proportion of changed features in each category. For continuous features, we use e-sparsity, which counts features modified beyond relative threshold of 5% of the original feature value. Proximity measures distance between original instances and the counterfactuals using the Manhattan distance only for continuous features. Observe that for categorical features proximity coincides with the sparsity. Probability measures model confidence in the target prediction. For the sparsity, proximity and plausibility metrics, lower values indicate better performance (4), while for the validity, probability and diversity metrics, higher values are preferable (f). We provide a detailed description of the metrics in Appendix
Evaluation Metrics
4.2 Evaluating multiple explanations
The comparison with baselines for diverse counterfactual explanations (DiCE, CCHVAE) presented in Table confirms that DiCoFlex returns more diverse explanations than competitive methods, achieving superior hypervolume scores. In terms of plausibility evaluation, both versions of Di- CoFlex consistently outperform other baseline methods as indicated by the LOF measure (except the GMC dataset). Furthermore, the results reveal that the proposed method capable of producing counterfactual explanations with low proximity score continuous attributes.
7

---

Table Comparison counterfactual generation methods across datasets. The best method, which generates multiple counterfactual candidates for each metric is highlighted in bold (DiCoFlex, CCHVAE, DiCE). If there is a method that generates a single counterfactual (ReViSE, TABCE, Wachter) that is better than the bold result, it is underlined.
Classif. prob. T
Preximity cont.
Sparsity cal. &
e-sparsity cont.
LOF log scale
Hypervol. log scale
Dataset
Model
Validity.
Lending
DiCoFlex (p=2.0)
1.000
0.999
0.668
0.412
0,840
0.476
13.118
Club
DiCoFlex (p=0.01)
1.000
0.997
0.704
0.635
0.737
0.453
11.373
CCHVAE
1.000
0,682
0.769
0.137
0.895
0.519
7.448
DICE
1.000
0.978
3.444
0.146
0.840
0.567
8.252
ReVISE
0.910
0.721
0.588
0.077
0.639
0.040
TABCF
1.000
0.557
0.635
0.047
Wachter
0.950
0.530
1.268
0,000
0.696
0.943
Adult
DiCoFlex (p=2.0)
1.000
0,998
0.581
0.515
0.498
2.156
2.036
DiCoFlex (p=0.01)
1.000
1,000
0.373
0,568
0.350
1.812
0.379
CCHVAE
1.000
0.894
0.616
0.302
0.582
2.176
1.571
DICE
1.000
1.000
5.096
0.557
0.582
3.815
0.681
ReViSE
0,860
0.879
1.004
0,206
0.576
2.637
TARCF
1.000
0
3.129
0.263
0.348
3.746
Wachter
0.970
0.578
1.046
0.000
0.830
2.893
Bank
DiCoFlex (p=2.0)
1.000
0.971
0.717
0,499
0.786
0.276
3,808
DiCoFlex (p=0.01)
1.000
0.894
0,584
0,480
0.673
0.247
3.006
CCHVAE
0.989
0.357
0.778
DICE
1.000
0.994
7.117
0.106
0.787
0.839
0.323
ReViSE
0.230
0.823
1.119
0.285
0.615
0.320
TABCF
1.000
0.850
3.747
0,210
0.441
0,360
Wachter
0.830
3.826
0.887
Default
DiCoFlex (p=2.0)
1.000
0.986
0.459
0.419
0.831
0.038
62.427
DiCoFlex (p=0.01)
1.000
0,988
0.489
0.514
0.787
0.034
61.593
CCHVAE
1.000
0.963
0.679
0,463
0.832
0,047
53.706
DICE
1.000
0.914
1.039
0.263
0.692
0.373
51.184
ReViSE
0.170
0.784
0.595
0.033
TABCF
1.000
0.884
0.516
0,510
0,412
0.057
Wachter
0,930
0.557
4.494
0.000
0.976
0.658
GMC
DiCoFlee (p=2.0)
1.000
0.969
0.690
0.755
0.765
0.861
15.667
DiCoFlex (p=0.01)
1.000
0.968
0.781
0.764
0.763
0.899
15.810
CCHVAE
1.000
0.932
0,389
0.756
0.762
0.564
9.761
DICE
1.000
3.478
0.753
0.399
ReViSE TABCF
0,780
0.909
8.525
0.180
0.877
0.702
0.130
0.630
0.521
0.359
0.835
0.303
Wachter
0.950
0.584
8,588
0.000
0.987
2,436
However, impressive diversity, plausibility, and proximity come at the price of slightly worse sparsity. Although DiCoFlex (p=0.01) obtained the lowest e-sparsity continuous features in three out of five cases, the categorical sparsity higher than the one returned by DiCE and CCHAVE. is apparent that these methods switch categorical variables less often than continuous ones, which is usually caused by the applied optimization scheme and can be seen as their drawback. Observe that the use of DiCoFlex (p=0.01) allows us balance the level of sparsity between categorical and continuous features.
Our analysis confirms that typical measures for evaluating counterfactual explanations are in conflict and that there does not exist a method that optimizes all these criteria simultancously. However, the proposed method compares favorably with other approaches beating them in diversity, plausibility, and proximity on continuous features.
4.3 DiCoFlex (p=2.0) vs. DiCoFlex (p=0.01)
As mentioned, lowering the value of p in the Lp norm for DiCoFlex directly results in lowering the sparsity measure for continuous attributes. As a side effect, allows for larger changes values of categorical variables to produce valid counterfactuals. An interesting consequence is that DiCoFlex (p=0.01) generates more plausible samples than DiCoFlex (p=2.0) (see the LOF score), which may be attributed to the way model the distribution used for scoring counterfactual candidates; see

---

For low p 0.01, we restrict the support of q to small region of data space, where only small number of coordinates are likely to be modified. Increasing this value leads to neighbors located in a larger and more diverse region since we allow for modifying all coordinates without extra penalty. Consequently, DiCoFlex with p = can sample out-of-distributio counterfactuals more often than DiCoFlex (p=0.01) with 0.01. In practice, dynamic change of p in inference allows users to examine multiple counterfactual candidates and select the one that suits their expectations best.
Section 3.3
4.4 Comparison with single counterfactual methods
To present a broader view on the performance of DiCoFlex, we include an additional comparison with commonly used methods that generate single explanation (ReViSE, TABCF, Wachter) (see Table D. We note that DiCoFlex and DiCoFlex (p=0.01) still demonstrate impressive performance in terms of LOF score in this comparison. They both achieve the lowest LOF on Adult and Bank datasets and are comparable to the best-performing ReViSE method on the Default dataset. Moreover, they obtained the best continuous proximity measure in 3 out of cases. This means that even though DiCoFlex produces multiple diverse counterfactuals for each instance, most of them satisfy the highest requirements used in counterfactual analysis.
Among competitive methods, Re and TabCF represent strong baselines that achieve a satisfactory level of plausibility and sparsity. Nevertheless, these models often fail to generate valid counterfactuals (see TABCF on GMC or ReViSE on Bank and Default), which partially limits their usefulness. Generating multiple diverse counterfactuals (as in our method) allows the user select suitable candidates that meet the expected criteria. It is interesting that TABCF and Re obtain more than 10 times lower LOF on the Lending Club dataset than other approaches. It might follow from the fact that it is impossible to generate multiple good counterfactuals for this dataset, and only a few nearby candidates represent indiitributtin samples. We also note that the classical Wachter method does not change categorical variables at all and generally gives suboptimal results, except for the validity score.
4.5 Runtime of counterfactuals generation
A key advantage of our approach is that once trained, Di- CoFlex can be used to generate multiple counterfactual explanations in single forward pass. To illustrate this gain, we measure the time every method needs to generate single counterfactual for 100 data points. Figure 2 con- firms that both variants of DiCoFlex achieve generation times of 0.12 + 0.05 seconds, outperforming other base- line methods by orders of magnitude. Optimization-based methods demonstrate substantially higher computational costs, with DICE, ViSE,, and TABCF all requiring over 1000 seconds on average. This efficiency enables real- time exploration of diverse counterfactual explanations with dynamic constraint adjustment, addressing critical limitation of existing approaches.
Parrage (wrondd
0.20A/10
Dofffc BCffer
CONC
:KZ
1007
Wetter
Mcchod
Figure Average runtime (log scale).
4.6 Actionability Control
DiCoFlex is capable of imposing additional constraints when generating counterfactuals without retraining the model. As demonstrated in Section 4.3 and Table [ the use of the Lp norm with small p allows to minimize the modifications of the continuous features and improve plausibility. In this experiment, we show the effect of introducing actionability constraints, which prevents severe modification of dser-defined features.
For illustration, we train DiCoFlex on the Adult dataset with four mask configurations, which cover one or two features, as shown Table For instance, the use of "mask 1" should block changes of "Capital Gain" and "Capital Loss" attributes. As can be observed in the result, the application of every individual mask indeed decreases the sparsity level compared to the unconstrained version when no mask is used. In consequence, this flexible control enables users to dynamically adjust both sparsity

---

Table Comparison of the unconstrained version of DiCoFlex with its masked variant, evaluated on features selected by the given mask. We report e-spariity for numerical variables and standard sparsity for categorical ones (lower score means less attributes affected).
mask I
mask 2
mask
mask 4
Method
Capital Gain
Capital Loss
Age
Race
Sex
Native Country
Masked-DiCoFlox
0.023
0.037
0.069
0.052
0.045
0.030
Standard DiCoFlex
0.148
0.097
0.833
0.170
0.200
0.116
and actionabilityy generating counterfactuals satisfying different Nomain-specitfe requirements without requiring model retraining. Appendix Popeediixeconaaiiee contains additional evaluation of these models.
4.7 Sensitivity Analysis of Sparsity Parameter P
We further analyze the sensitivity of DiCoFlex to the sparsity control parameter p that governs the Ipp norm used during neighbor selection (Section 3.4). This parameter determines the strength of sparsity constraints applied to continuous features and thus influences the trade-off between proximity, sparsity, and diversity.
Table 3 reports the performance of DiCoFlex across several p values on the Adult dataset. Lower values (e.g.. p 0.01) favor sparse modifications, yielding counterfactuals that stay closer to the original instances, while larger values (e.g., = 1 or 2) permit more flexible changes that improve diversity the cost of proximity.
Table 3: Effect sparsity parameter p on DiCoFlex performance on the Adult dataset. Lower proximity and LOF, higher validity and hypervolume indicate better performance.
Classif. prob.
Proximity cont. J
Sparsity cat. 4
e-sparsity cont.
LOF log 4
Hypervol. log
Model
DiCoFlex (p=0.01)
1.000
0.373
0.568
0.441
1.9119
0.9023
DiCoFlex (p=0.08)
0.996
0.501
0.553
0.454
1.9680
1.0801
DiCoFlex (p=0.25)
0.995
0.551
0,541
0.501
2.2380
1,3780
DiCoFlex (p=1.0)
0.996
0.577
0.537
0.589
2.6349
1.9491
DiCoFlex (p=2.0)
0.998
0.581
0.515
0.601
2.6614
1.8862
Across all p values, DiCoFlex maintains perfect validity, confirming robustness of the learned condi- tional flow. As increases, proximity gradually worsens while diversity (hypervolume) improves, reflecting smooth proximity-sparsit trade-off. The consistent trend in LOF indicates stable plausibility across regimes.
These findings demonstrate that single DiCoFlex model, trained with conditioning on p. can smoothly adapt its behavior to user preferences at inference time rereennggggggg from highly sparse to diverse counterfactuals without retraining or model modification.
5 Conclusion
We presented DiCoFlex, a model-agnostic conditional generative framework for counterfactual explanations that addresses key limitations existing approaches. By leveraging normalizing flows, our method enables counterfactual generation without constant access to the classification model, provides inference-time control over constraints, and efficiently produces multiple diverse explanations in single forward pass, Our approach is grounded in rigorous theoretical foundations: we prove formal guarantees for validity, proximity bounds, in-distribution plausibility, and diversity preservation (Appendix A)). Empirical evaluations on five benchmark datasets demonstrate that DiCoFlex outperforms the state-of-thie -ftt---rttt--tt methods diversity and validity while achieving superior plausibility and computational efficiency. Although optimization-base methods may achieve better sparsity in some cases, our approach offers a more balanced trade-off between competing explanation criteria.
10

---

Acknowledgments and Disclosure of Funding
Oleksii Furman and Maciej Zieha's work was supported by the National Science Centre (Poland) Grant No. 202445/BB/ST//01100 The research of U. Movsum-zada and P. Marszatek was supported by the National Science Centre (Poland), grant no. 2023/50/E/ST6/000199 The work of M. Smieja was supported by the National Science Centre (Poland), grant no. 2022/45/B/ST60011 117. Some experiments were performed on servers purchased with funds from the flagship project entitled "Artificial Intelligence Computing Center Core Facility" from the DigiWorld Priority Research Area within the Excellence Initiative Research University program at Jagiellonian University in Krakow.
References
[1] Ulrich Aïvodji, Alexandre Bolot, and Sébastien Gambs. Model extraction from counterfactual explanations. arXiv preprint arXiv:2009.01885 018844 2020.
[2] Javier Antorán, Umang Bhatt, Tameem Adel, Adrian Weller, and José Miguel HemándezzLobatt Getting clue: A method for explaining uncertainty estimates, arXiv preprint (cXiv:2006.06848 2020.
[3] Barry Beeker and Ronny Kohavi. Adult. UCI Machine Learning Repository, 1996. DOI: http://dbi..rg/110244//////
[4] Markus M Breunig, Hans-Peter Kriegel, Raymond T Ng. and Jörg Sander. Lof: identifying density-based local outliers. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pages 93-104, 2000.
[5] Miguel Á oblique decision trees: Exact, efficient algorithms. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pages 6903-6911. 2021.
and Suryabhan Singh Hada. Counterfactual explanations for
[6] Imre Csiszár and János Körner. Information Theory- Coding Theorems for Discrete Memoryless Systems, Second Edition. Cambridge University Press, 2011. ISBN 978-0-51192188- 9. doi: 10. 10.1017/CB0978051 1921 1899 https org/ 10. 1017 00117/880988111921888888
[7] Susanne Dandl, Christoph Molnar, Martin Binder, and Bernd Bischl. Multi-objective coun- terfactual explanations. In International conference on parallel problem solving from nature. pages 448-469, Springer, 2020.
[8] Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: non-linear independent components estimation. In 3rd International Conference Learning Representations, ICI.R 2015, San Diego, CA, USA, May 7-9, 2015, Workshop Track Proceedings, 2015.
[9] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In 5th International Conference Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. 2017.
[10] Michael Downs, Jonathan L. Chu, Yaniv Yacoby, Finale Velez, and Weiwei Pan. Cruds: Counterfactual recourse using disentangled subspaces. ICML WHI, 2020:1-23, 2020.
[11] Alessandro Fontanella. Grant Mair, Joanna Wardlaw, Emanuele Trucco, and Amos Storkey. Diffusion models for counterfactual generation and anomaly detection in brain images. IEEE Transactions on Medical Imaging. 2024.
[12] Oleksii Furman, Patryk Wielopolski, Lukasz Lenkiewicz, Jerzy Stefanowski. and Maciej Zişba. Unifying perspectives: Plausible counterfactual explanations on global, group-wise, and local levels. arXiv preprint arXiv:2405. 17642, 2024.
[13] Riccardo Guidotti. Counterfactual explanations and how to find them: literature review and benchmarking. Data Mining and Knowledge Discovery, 38(5):277--2824 2024.
[14] Riccardo Guidotti, Anna Monreale, Fosca Giannotti, Dino Pedreschi, Salvatore Ruggieri, and Franco Turini. Factual and counterfactual explanations for black box decision making. IEEE Intelligent Systems, 34(6):14-23 2019.

---

[15] Julapa Jagtiani and Catharine Lemieux. The roles of alternative data and machine learning in fintech lending: evidence from the lendingelub consumer platform. Financial Management, 48 (4):1009-1029, 2019.
[16] Shalmali Joshi, Oluwasanmi Koyejo, Warut Vijitbenjaronk, Been Kim, and Joydeep Ghosh. Towards realistic individual recourse and actionable explanations in black-box decision making systems. arXiv preprint arXiv:1907. 09600, 2019.
[17] Kentaro Kanamori, Takuya Takagi, Ken Kobayashi, Yuichi Ike, Kento Uemura, and Hiroki Arimura. Ordered counterfactual explanation by mixed-integer linear optimization. In Pro- ceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11544-11574 2021.
[18] Amir-Hossein Karimi, Gilles Barthe, Borja Balle, and Isabel Valera. Model-agnostic coun- terfactual explanations for consequential decisions. In International conference on artificial intelligence and statistics, pages 895-905. PMLR, 2020.
[19] Mark T Keane and Barry Smyth. Good counterfactuals and where to find them: A case-based technique for generating counterfactuals for explainable (xai). In Case- Based Reasoning Research and Development: 28th International Conference, ICCBR 2020, Salamanca, Spain, June 8-12, 2020, Proceedings 28, pages 163-178. Springer, 2020.
[20] Thibault Laugel, Adulam Jeyasothy, Marie-Jeanne Lesot, Christophe Marsala, and Marcin Detyniecki. Achieving diversity in counterfactual explanations: a review and discussion. In Proceedings of the 2023 ACM Conference on Fairness, Accountability, and Transparency, pages 1859-1869, 2023.
[21] Sérgio Moro, Paulo Cortez, and Paulo Rita. data-driven approach to predict the success of bank telemarketing. Decision Support Systems, 62:22-33 31, 2014.
[22] Ramaravind K Mothilal, Amit Sharma, and Chenhao Tan. Explaining machine learning classifiers through diverse counterfactual explanations. In Proceedings of the 2020 conference on fairness, accountabillity and transparency, pages 607-617, 2020.
[23] Philip Naumann and Eirini Ntoutsi. Consequence-awaree sequential counterfactual generation. In Machine Learning and Knowledge Discovery in Databases. Research Track: European Conference, ECML PKDD 2021, Bilbao, Spain, September 13-17, 2021, Proceedings, Part II 21, pages 682-698. Springer, 2021.
[24] Krzysztof Nowak, Marcus Märtens, and Dario Izzo. Empirical performance of the approximation of the least hypervolume contributor. In Parallel Problem Solving from Nature- PPSN XIII: 13th International Conference, Ljubljana, Slovenia, September 13-17, 2014. Proceedings 13, pages 662-671. Springer, 2014.
[25] Emmanouil Panagiotou, Manuel Heurich, Tim Landgraf, and Eirini Ntoutsi. Tabef: Counterfac- tual explanations for tabular data using a transformer-based vae. In Proceedings of the 5th ACM International Conference on Al in Finance, pages 282, 2024.
[26] George Papamakarios, lain Murray, and Theo Pavlakou. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 2338-2347, 2017.
[27] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary VeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high--erformance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019.
[28] Martin Pawelczyk, Klaus Broelemann, and Gjergji Kasneci. Learning model-agnostic coun- terfactual explanations for tabular data. In Proceedings of the web conference 2020, pages 3 1126-3132, 2020.
12

---

[29] Rafael Poyiadzi. Kacper Sokol, Raul Santos Lantos-Rodriguez, Tijl De Bie, and Peter Flach. Face: fea- sible and actionable counterfactual explanations. In Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society, pages 344-350, 2020.
[30] Peyman Rasouli and Ingrid Chich Yu. Care: Coherent actionable recourse based on sound counterfactual explanations. International Journal of Data Science and Analytics, 17(1):13-38, 2024.
[31] Annabelle Redelmeier, Martin Jullum, Kjersti Aas, and Anders Løland. Mcce: Monte carlo sampling of valid and realistic counterfactual explanations for tabular data. Data Mining and Knowledge Discovery, 38(4):1830-188 186000181111111 2024.
[32] Danilo Rezende and Shakir Mohamed. International Conference on Machine Learning, pages 1530-1538. PMLR, 2015.
Variational inference with normalizing flows. In
[33] Pau Rodriguez, Massimo Caccia, Alexandre Lacoste, Lee Zamparo, Issam Laradji, Laurent Charlin, and David Vazquez. Beyond trivial counterfactual explanations with diverse valuable explanations. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1056-1065, 2021.
[34] Chris Russell. Efficient search for diverse coherent explanations. Proceedings of the conference on fairness, accountability, and transparency, pages 20-28, 2019.
[35] Robert-Florian Samoilescu, Arnad Van Looveren, and Janis Klaise. Model-agnostic and scal- able counterfactual explanations via reinforcement learning. arXiv preprint urXiv:2106.022: 2021.
[36] Maximilian Schleich, Zixuan Geng, Yihong Zhang, and Dan Suciu. Geco: quality counterfactual explanations in real time. Proc. VLDB Endow., 149)) May 2021. ISSN 2150-809 doi: 44444777/83461555446655555 URL https: : //op::://ddd..o /doi 10.//.. 14778/346111 34615555
[37] Shubham Sharma, Jette Henderson, and Joydeep Ghosh. Certifai: A common framework to provide explanations and analyse the fairness and robustness of black-box models. In Proceedings of the AAAI/ACM Conference AI, Ethics, and Society, pages 166-172, 2020.
[38] Gabriele Tolomei, Fabrizio Silvestri, Andrew Haines, and Mounia Lalmas. Interpretable predictions of tree-based ensembles via actionable feature tweaking. In Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining, pages 465 474, 2017.
[39] Stratis Tsirtsis and Manuel Gomez Rodriguez. Decisions, counterfactual explanations and strategic behavior. Advances Neural Information Processing Systems, 33:16749-16760, 2020.
[40] Alexandre B. Tsybakov. Introduction to Nomparametric Estimation. Springer series in statistics. Springer. 2009. ISBN 978-0-337-79005100, doi: 10.1007//B1794, URL httpp://do/ org/ 10. 1001/9///13794
[41] Berk Ustun, Alexander Spangher, and Yang Liu. Actionable recourse in linear classification. In Proceedings of the conference on fairness, accountability, and transparency, pages 10-19, 2019.
[42] Guido Van Rossum and Fred L Drake Jr. Python reference manual. Centrum voor Wiskunde en Informatica Amsterdam, 1995.
[43] Sahil Verma, Keegan Hines, and John P Dickerson. Amortized generation of sequential counterfactual explanations for black-box models. CoRR, 2021.
[44] Sandra Wachter, Brent Mittelstadt, and Chris Russell. Counterfactual explanations without opening the black box: Automated decisions and the gdpr. Harv. JL. & Tech., 31:841, 2017.
[45] Yongjie Wang, Hangwei Qian, and Chunyan Miao. Dualef: Efficient model extraction attack from counterfactual explanations. In Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, pages 1318-1329, 2022.
13

---

[46] Patryk Wielopolski, Oleksii Furman, Jerzy Stefanowski, and Maciej Zięba. Probabilistically plausible counterfactual explanations with normalizing flows. In ECAI 2024. IOS Press, 2024.
[47] I-Cheng Yeh. Default of Credit Card Clients. UCI Machine Learning Repository, 2009, DOI: https//ddb.org11022444//533333
[48] Siqiong Zhou, Upala Islam, Nicholaus Pfeiffer, Imon Banerjee, Bhavika K Patel, and Ashif lquebal. Segan: Sparse countergan for counterfactual explanations in breast cancer prediction. IEEE Transactions Automation Science and Engineering, 21(3):2264-222 2023.
14

---

NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: The abstract and introduction outline key contributions of generating diverse counterfactuals in a single forward pass with flexible constraints, which are fully supported by the detailed methodology and experimental results.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
is fine to include aspirational goals as motivation as long as is clear that these goals not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification: Authors discuss limitations Appendix
Guidelines:
The answer NA means that the paper has limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create a separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (c.g.. independence assumptions, noiseless settings, model sellsspeciiiationn asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low or images are taken in low lighting. Or speech-to-tex, system might not be used reliably to provide closed captions for online lectures because it fails handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and faimesss.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't 't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community, Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory assumptions and proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
15

---

Answer: [Yes]
Justification:
The paper adequately presents and justifies theoretical components of the
method in Section S
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated or referenced in the statement of any theorems.
The proof' can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide short proof sketch to provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should properly referenced.
4. Experimental result reproducibility
Does the paper fully disclose all the information needed to reproduce the main ex- perimental results the paper to the extent that affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?
Question:
Answer: [Yes]
The paper provides comprehensive information for reproducing the experi- ments, including detailed descriptions of the datasets Jae Appendix baseline methods with citations, evaluation metrics (Section 4.1 and Appendix C and the complete methodology (Section
Justification:
Guidelines:
The answer NA means that the paper does not include experiments. If the paper includes experiments, No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is novel architecture, describing the architecture fully might suffice, or if the contribution is specific model and empirical evaluation, it may be necessary to either make possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g.. in the case of large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurlPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily new algorithm, the paper should make it clear how to reproduce that algorithm.
(b) If the contribution primarily new model architecture, the paper should describe the architecture clearly and fully.
(c) If the contribution a new model (e.g.. a large language model), then there should either be way access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (c.g., to registered users), but it should be possible for other researchers to have some path to reproducing verifying the results.
16

---

5. Open access to data and code
Does the paper provide open access to the data and code, with sufficient instruc- tions to faithfully reproduce the main experimental results, as described in supplemental material?
Question:
Answer: [Yes]
Justification: The authors provide implementation code in the supplementary materials that accompanies the submission. They also state their commitment to release a publicly available version of the code repository with the camera-ready version of the paper.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (https://nips.cm
haagli/c/guides//ddeebbbm....aa hot.:/eubbbmsiiooooooooooo. for more details.
While we encourage the release of code and data, we understand that this might not be possible, so "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (c.g., for new open-sourge benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https
gewiii/gguee//eeeeeeeieiiiiiseee CodeeSummeee onPolicy) for more details.
The authors should provide instructions on data access and preparation, including how access the raw data, preprocessed data, intermediate data, and generated data,
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible in supplemental material (appended to the paper) recommended, but including URLs to data and code permitted.
6. Experimental setting/details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification:
The paper provides experimental details in Section including dataset de- scriptions, baseline methods and evaluation metrics.
Guidelines:
The answer NA means that the paper does include experiments.
The experimental setting should be presented in the core the paper to a level of detail that is necessary appreciate the results and make sense of them.
The full details can be provided either with the code, appendix, as supplemental material.
7. Experiment statistical significance
Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Question:
Answer: [No]
Justification: Following established evaluation protocols in counterfactual explanation literature, we report deterministie performance metries on fixed test sets rather than statistical aggregates.
Guidelines:
The answer NA means that the paper does not include experiments.
17

---

The authors should answer "Yes" if the results are accompanied by error bars, confi- dence intervals, or statistical significance tests, least for the experiments that support the main claims of the paper.
The factors of variability that the enror bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g.. Normally distributed errors).
It should be clear whether the error bar is the standard deviation the standard error of the mean.
is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out range (e.g. negative error rates).
If error bars reported in tables plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables the text.
8. Experiments compute resources
For each experiment, does the paper provide sufficient information the com- puter resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
Question:
Answer: [Yes]
Justification:
The paper includes dedicated section in Appendix
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported the paper (e.g., preliminary or failed experiments that didn't I make it into the paper).
9. Code of ethics
Question: Does the research conducted the paper conform, in every respect, with the NeurlPS Code of Ethics
Answer: [Yes]
Justification: The research complies with the NeurlPS Code of Ethics by using established
benchmark datasets with proper citations, conducting transparent methodology comparisons, and advancing Al explainability to enhance faimess and transparency decision-making systems.
Guidelines:
The answer NA means that the authors have not reviewed the NeurlPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., there a special consid- eration due to laws regulations in their jurisdiction).
10. Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
18

---

Justification:
The paper addresses societal impacts by highlighting that counterfactual
explanations enhance transparency and actionability in sensitive domains.
Guidelines:
The answer NA means that there no societal impact of the work performed.
If the authors answer NA or No. they should explain why their work has no societal impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious unintended uses (e.g., disinformation. generating fake profiles, surveillance), fairness considerations (c.g.. deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (c.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification: The research focuses on counterfactual explanations for tabular data using standard benchmark datasets.
Guidelines:
The answer NA means that the paper poses such risks.
Released models that have high risk for misuse or dual-uss should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper. properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification:
The paper cites all original sources for the datasets used.
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package dataset.
19

---

The authors should state which version of the asset is used and, if possible, include URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset. For scraped data from a particular source (e.g.. website), the copyright and terms of service of that souree should be provided.
assets are released, the license, copyright information, and terms use in package should be provided. For popular datasets, paperswi thcode. com/ datasets has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
For existing datasets that re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. If this information is not available online, the authors are encouraged to reach out to the asset's s creators.
13. New assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [Yes]
Justification: Authors commit releasing a publicly available repository with the camera- ready version that will include further documentation, usage examples, and license informa- tion.
Guidelines:
The answer NA means that the paper does not release assets.
Researchers should communicate the details the dataset/code/model as part their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset used.
At submission time, remember anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsourcing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification: The research is purely computational, working with established benchmark datasets and evaluating algorithmic performance through objective metrics.
Guidelines:
The answer NA means that the paper does not involve crowdsoureing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included in the main paper.
According the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals equivalent for research with human subjects
Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Question:
Answer: [NA]
20

---

Justification:
The research does not involve human subjects, user studies, or any direct human participation.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with
human subjects.
Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere the NeurlPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
Declaration LLM usage
Does the paper describe the usage of LLMs if it is an important, original, or non-standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, formatting purposes and does not impact the core methodology. scientific rigorousness, or originality of the research, declaration is not required.
Question:
Answer: [NA]
Justification: LLMs are not involved in the core method development or implementation.
Guidelines:
The answer NA means that the method development in this research does not involve LLMs as any important, original, or non-standard components.
Please refer to our LLM policy for what should or should be described.
cttpiiipp.cc.cooooee cc/Conferencees/22255
21

---

A Theoretical Considerations
This section provides theoretical analysis of the diversity guarantees provided by DiCoFlex. We establish a formal lower bound on the expected diversity counterfactuals generated by our learned conditional normalizing flow.
A.1 Preliminary Lemma
Lemma A.I (Upper bound on difference expected values). Let p and be two distributions over the same finite set X, and let the total variation distance be defined as 1|p gllrr Exex (p(x)-9(2))
For any function f X -> Te, we have:
Σ BEX
[())((()) - ((x)) 2 max
[/(x)]
IP allev-
(9)
DEA
Proof. By the triangle inequality and the definition of total variation distance:
Σ f(z)(p(z) a(x))
f(x)] - 1xx))
(10)
EEA'
xEX
max #EX
[a)) Σ 1p(x) {())
(11)
zEX
max
#EX [f()) |pp g||Tv.
(12)
U
A.2 Main Theoretical Result
Theorem A.2 (Diversity Preservation in DiCoFlex). Let Lot''p/z (2.(11/2.3/ ,' p.m) be the learned conditional normalizing flow and q(x² (ar, y', dp.m) be the empirical distribution defined in Equation (6). Under assumptions (A1)-(33 stated below, for samples va drawn from po, the expected diversity satisfies:
Ep, (D(( 2 Jmin (1- K -
(13)
where D((a = min || - denotes the minimun pairwise distance among the generated
counterfactuals.
Assumptions
(A1) Minimum neighborhood separation: The neighborhood N(x, dp.m. K) contains K dis- tinct points with minimum pairwise distance Omin > 0. Specifically, for any Iy 2y E N(x, v/, dp.m, K) with i +j.
||,; - x,اl 2 amin-
(14)
(A2) Training convergence: The normalizing flow trained sufficiently close to the empirical distribution, satisfying:
DKl( |x, v', (loomll ..p.p.m) m)) se
(15)
for all (x,9', y', ,P, m) in the training distribution.
(A3) Bounded support: The support of pol- x. v. P. m) lies in a of finite diameter A, i.e. for any x',2" x² in the support,
|| - x'I
(16)
This implies that 0 < D(12)1 = min ||ا| - 2 A.
Proof. Step 1: Lower bound on empirical diversity. Consider the empirical distribution (('1<1, //, d which samples uniformly from K distinct neighbors. When sampling n points with replacement from these K points, the probability of selecting least two distinct points
(x(K) = K
K1-
(17)
K
22

---

Given assumption (A1), whenever two distinct points are selected, their distance is at least min- Therefore:
[g 2 min (.( m (1 ----)>
(18)
Step 2: Relating KL divergence to total variation distance. By Pinsker's inequality 66 40), which
states that fl & / V Dka for any two probability distributions and the total variation distance is bounded by the KL divergence:
V2 DxL (állp)) V
F
Ilpo p)) 0(-1ær, v dp.m) llrv I
(19)
Step 3: Bounding the difference in expected diversity. The diversity measure D({ is bounded above by A (assumption A3). Applying Lemma A.I
Eg[ s 2 A 1 - S 22 / Av2c.
E pa [D]
(20)
Step 4: Deriving the lower bound. diversity than q:
Considering the worst-case scenario where pe produces less
Epo (po E,D((= Av2e.
(21)
Substituting the result from Step 1 yields the desired bound:
Ep [D({{)) 2 miin K K1- A 2
(22)
A.3 Implications
Diversity Guarantee Theorem A.2 establishes that DiCoFlex maintains strong diversity guarantees. For sufficiently large K, the probability term (1 (1-K!--) K!- approaches 1, ensuring that the expected diversity is approximately miin A 2ve.. The theorem shows that the learned distribution po recovers nearly the full empirical diversity, with deviation bounded by the training error
Impact of Training Quality As training progresses and + O, the perturbation term A 2 vanishes, and the diversity of counterfactuals generated by the learned flow converges to that of the empirical distribution. This theoretical result validates the practical observation in Section that DiCoFlex achieves superior diversity metrics compared to baseline methods.
Sample Efficiency The bound demonstrates that generating n samples from DiCoFlex provides diversity guarantees that scale favorably with the number of neighbors K used during training. For fixed n and increasing K, the probability of obtaining diverse samples (1 - K K²-") approaches exponentially fast, explaining the effectiveness of our KNN-based training approach.
A.4 Validity Guarantees
Our method provides inherent validity guarantees by construction. Since ((='|x, y', d) (Equation (6) exclusively samples from the set of K --nearest neighbors ((x, v d, K), where h(xx)) V'. we have the following deterministic property:
Proposition A.3 (Validity). For all training samples drawn from q(x1|zz, vi d), the classification model returns the target class with probability one:
ply/\a') 1, Ya' q(x' px. V/ ,d).
(23)
where p(y((z")) is the class probability returned by the classification model lo(.).
Proof. By definition of q in Equation 6 we have q(x' x., y', d) > 0 only if x' E N(x, 1/, K).
The neighborhood N(x, y d, K) consists exclusively of training examples for which h((²) = 1/ by construction. Therefore, p/)/ 1 for all samples from
L
23

---

This theoretical property explains why DiCoFlex achieves high validity in all datasets in Table | while being orders of magnitude faster than optimization-bun methods. The normalizing flow trained on these valid samples inherits this property in expectation:
Pp [p(y' [z')] Rz
(24)
with the approximation quality depending on the training convergence (assumption A2 in Theo- rem A.2)
A.5
Proximity Guarantees
Our KNN sampling mechanism provides an implicit theoretical guarantee on proximity without requiring explicit proximity optimization.
Proposition A.4 (Proximity Upper Bound), For any counterfactual x' sampled from q(2 y/, d)
(Equation 6b). we have:
dx,x') S d(x, xk):
(25)
where s²k is the K-th nearest neighbor of x in class y/ under distance measure d(..-).
Proof. By definition of q in Equation (6. we have q(0'|1r, ,d)) > 0 if and only if x' E N (1r v d, K). The set N(x,y) v', d, K) contains exactly the K nearest neighbors of x in class y' according to distance d. Therefore, any x' with non-zero probability under I must satisfy:
d(z, x1) S
max E ((ras
d(z, v.) = d(x, x.))
(26)
as otherwise x' would not be among the K nearest neighbors and would have g(ø' [z, y', d) 0.
This provides an upper bound on proximity without requiring iterative optimization. The learned flow pe approximately respects this bound, with deviations controlled by the training error (assumption A2). The flcxibility to adjust the distance measure dp.m (Equation (8) allows users to control proximity characteristics at inference time through the sparsity parameter and mask m.
A.6 Plausibility Guarantees
We now establish theoretical guarantees for plausibility, addressing a key limitation of optimization- based methods that may generate out-of-distribution counterfactuals.
Proposition A.5 (In-Distribution Guarantee). Since the training distribution á(x' (z, v/ d) only assigns non-zero probability to K-nearest neighbors from the training set 'D (Equation 6 any sampled counterfactual x' satisfies:
Pdttta (x') 2 min Paaaa(1s)) > O,
(27)
a,ED
where Pdata denotes the true data distribution.
Proof. By construction, q(<'|x, y', d) assigns uniform probability & to each of the K neighbors
in N(x, v. d, K) c and zero probability elsewhere. Therefore, any sample x' ~ q an actual training point: x' E D. Since all training points are drawn from Pdata. we have Pdata(x') )= > 0 for all such.. x'.
Enhanced Plausibility with Sparse Constraints When using small p values (e.g., p = 0.01) in the Lp norm distance (Equation (7). we restrict the neighborhood to samples with minimal feature changes. These neighbors typically lie in higher-density regions of the data manifold, as points with few modified features are more likely to remain within dense areas of the feature space. This explains the improved Local Outlier Factor (LOF) scores for DiCoFlex (p=0.01) compared to DiCoFlex (p=2.0) observed in Table I
The normalizing flow learns to interpolate between these guaranteed in-distribution points while preserving the manifold structure through its invertible transformations. This provides a principled approach to ensuring plausibility, as the flow is constrained to learn smooth deformations between verified in-distribution samples rather than arbitrary transformations that might venture into low- density regions.
24

---

B Dataset Descriptions
This appendix provides detailed descriptions of the datasets used in our experimental evaluation. Table T summarizes the key characteristics of each dataset, including the number of samples used for our experiments, number of numerical and categorical features, and number of classes
Table 4: Dataset characteristics and statistics.
Dataset
Samples
Feat
# Num
# Cat
Target Class Dist.
Lending Club
30,000
12
8
4
21.8% default
Give Me Some Credit
30,000
9
6.7% yes
Bank Marketing
30,000
16
9
11.3% yes
Credit Default
27,000
23
14
22.1 1% yes
Adult Census
32,000
12
8
24.5% 250K
B.1 Lending Club
The Lending Club dataset 15] contains detailed information about loans issued through the Lending Club peer-to-peer lending platform. It includes borrower characteristics (such as credit score, annual income, employment length), loan specifies (loan amount, interest rate, purpose), and performance indicators (payment status, delinquency). The binary classification task is to predict whether loan will be fully paid or charged off (default). This dataset is particularly relevant for financial counter- factual explanations as it represents real-world credit risk assessment scenarios where understanding model decisions is crucial for both borrowers and lenders.
B.2
Give Me Some Credit
The Give Me Some Credit dataset 28 contains anonymized records of credit users with features such as debt-to-income ratio, number of times delinquent, monthly income, age, and number of open credit lines. The target variable indicates whether user experienced a serious delinquency (more than 90 days overdue) within the previous two years. This dataset provides insight into credit risk prediction in consumer finance, where counterfactual explanations offer actionable guidance to consumers looking to improve their creditworthiness.
B.3
Bank Marketing
The Bank Marketing dataset 21 contains information from direct marketing campaign conducted by Portuguese banking institution. The features include client data (age, job, marital status, education), campaign contact information (communication type, day, month), economic indicators, and previous campaign outcomes. The prediction task is to determine whether client will subscribe to term deposit. This dataset represents real-world marketing scenario where understanding model decisions can improve campaign efficiency and provide insights for personalized marketing strategies.
B.4 Credit Default
The Credit Default dataset 47 contains information on credit card clients in Taiwan, including demographic factors, credit data, payment history, and bill statements. The target variable indicates whether the client defaulted on their payment the following month. With 23 features (14 numerical and categorical), this dataset presents complex feature interdependencies common in financial data. The dataset is valuable for counterfactual explanation research because it represents real-world credit risk assessment with diverse feature types and nonlinear relationships.
B.5 Adult
The Adult Census dataset 3 contains demographic information extracted from the 1994 U.S. Census database. Features include age, education, occupation, work hours per week, and capital gain/loss. The binary classification task is to predict whether individual's 's income exceeds $50,000 per year.
25

---

This dataset is widely used in fairness and explainability research, as it contains sensitive attributes like race, gender, and age, making valuable for studying how counterfactual explanations handle demographic factors.
C Evaluation Metrics
We evaluate counterfactual quality using metrics that correspond to key desiderata. For test set X [ [h(x[]) 0) generate set of N counterfactuals x {xx] nn for class 1 with the evaluated model.
Validity measures the success rate of changing model predictions:
Nval
Validity (1)
Σ I(h(x()) = 1)
(28)
N
Sparsity quantifies feature modifications, separately for categorical and numerical features:
N.a
X,,e/mum
1
Xa.iiuuum llo
Sparsity Cat/Num (4)
(29)
Nval 1=1
Deat/nom
where xf. Xp,cat/mum represents n-th generated counterfactual reduced to categorical numerical attributes.
For continuous features, we use e-sparsity, counting features where the relative change from the original value exceeds threshold 0.05:
e-Sparsity cont. (4) Nval
1
Σ
I
[nnd I'mal Findd
(30)
Deomt
de
where r denotes original values and x' is the counterfactual.
Proximity measures distance original instances using Manhattan for continuous features:
Nai
Proximity Num (L)
|x
[x
X
(31)
Nval
pmmm
Predictive Performance assessed via Validity and Classif. prob. (model confidence in target prediction).
Diversity measured by Hypervol. log scale (24). which quantifies spread and coverage in objective space.
Plausibility is evaluated with LOF log scale (Local Outlier Factor from training distribution) and Log Density (probability under training data distribution).
Lower values are better for sparsity. proximity, and plausibility metrics ({), while higher values are better for validity, model confidence, and diversity (f).
D Generative Model Selection
We conducted an ablation study to select the most suitable normalizing flow architecture for our framework, comparing different models based on negative log-likelihood (NLL) the Adult dataset.
Table 5: Negative log-likelihood comparison of generative models on the Adult dataset. Lower values indicate better performance.
MAF
NICE
RealNVP
KDE
NLL
-43.2998
26.6644
26.5827
30.5120
26

---

We compared three normalizing flow architectures: MAF (26], NICE 8
and Real NVP (9. as well as KDE non--pil parameeteei baseline. MAF significantly outperformed all alternatives, while NICE and RealNVP showed comparable performance, and KDE exhibited the poorest results.
MAF's superior performance stems from its autoregressive structure, which enables more expressive transformations by conditioning each dimension on previously transformed dimensions. This property crucial for accurately modeling the conditional distribution of counterfactual explanations. Based on these results, we selected MAF as the architecture for DiCoFlex, contributing significantly to its ability to generate high-ge qugh-uua,yy, diverse counterfactual explanations.
E Details of training algorithm
Algorithm Training procedure
Require: number of steps T, training examples X' classification model h(.), prior class distribution æ, of sparsity levels P, set of considered masking M, number of nearest neighbors K Initialize 6g
for t 1 to T do
Sample x ~ X' and class 3/' π {h(x)}
Sample sparsity level p P and mask .M
Sample K counterfactuals
~ ((x'xxxxxxxxxxx , dp.m) given by (6:
Update parameters 0e by optimizing Q given by (4)
end for return 300
The training procedure is outlined in Algorithm 1 In each training iteration, data example x is drawn from the dataset X', and target class y/ is sampled from the class distribution excluding the current class of x, i.e., π hxx). Subsequently, sparsity level p is selected from predefined set P, along with corresponding masking vector from the M.
Next, the set of K nearest neighbors, denoted by N(x, v/, dn.m: K). is computed using the distance is then sampled from the distribution q(x' x, y dg m) as defined in 6 Finally, the parameters 0, are updated via gradient- based optimization procedure aimed at maximizing the objective in with conditioning on both p and m.
measure dn.m defined in (8). A counterfactual example &
E.1 Training Details and Hyperparameter Exploration
We report additional details of the DiCoFlex training process and hyperparameter configuration used in all experiments. All experiments were conducted GPU workstation equipped with an NVIDIA RTX 4090 (24 GB VRAM) and an AMD Ryzen Threadripper PRO 5975WX CPU with 256 GB RAM. Each model was trained for maximum of 1000 epochs using the Adam optimizer (Ir 10-4) and early stopping with a patience of 300 epochs based on the validation objective.
Training times. Training times for all benchmark datasets are visualized in Figure 3 Each subfigure corresponds to one dataset (Adult, Bank Marketing, Default, Give Me Some Credit, and Lending Club) and reports the wall-clock time required to complete full training, including early stopping. The training time primarily depends on the dataset size and feature dimensionality.
Hyperparameter exploration. We explored several key hyperparameters influencing model behav- ior and training stability:
Number of nearest neighbors K E (8, 16, 32)
Actionability penalty a E {1, 10, 1000} MAF hidden features {16, 32, 64}
MAF hidden layers E (2, 5}
For each combination, models were trained under identical conditions with early stopping. Hyper- parameter selection was guided by validation performance averaged across validity, proximity, and
27

---

sparsity metrics, favoring configurations that balanced these criteria without overfitting. Unless otherwise stated, the final configuration used K=16, 1010, 32 hidden features, and hidden layers.
Sensitivity analysis. To verify robustness, we performed limited sensitivity analysis the Adult dataset, varying each hyperparameter within the ranges listed above. Results confirmed that DiCoFlex remains stable across wide range of K, a, and model capacities. with minimal variation in validity and plausibility metrics. Detailed quantitative sensitivity results are provided in Appendix E.2.
F Limitations of our method
DiCoFlex deliberately designed for tabular data with mixed feature types, the most common domain for counterfactual explanations in high-stakes recision-makinng contexts. Although this focus enables strong performance where interpretability is most needed, extending to other data modalities would require architectural adaptations. Our approach exhibits natural trade-offs between competing explanation criteria, favoring diversity and plausibility while maintaining competitive performance in sparsity metrics. The computational efficiency during inference requires initial training investment, though this one-time cost enables subsequent real-time applications that outperform existing methods by orders of magnitude.
Recent work has demonstrated that counterfactual explanations can be exploited for model extraction attacks, they reveal decision boundary information [1 45). Furthermore, diverse counterfactual explanations can particularly enhance extraction effectiveness. However, DiCoFlex's 's design may offer partial protection. Unlike methods exploring arbitrary feature space regions, the learned normalizing flow captures only the conditional distribution over plausible, proximal counterfactuals, potentially limiting information available for extraction. Nevertheless, some extraction risk remains. DiCoFlex's 's diversity may still allow adversaries to triangulate decision boundaries from multiple sparse directions.
DiCoFlex generates counterfactuals based on proximity and plausibility without explicit fairness constraints. If the underlying model exhibits demographic biases, DiCoFlex may generate counterfac- tuals that reflect or amplify these biases. Future work should investigate incorporating fairness-aware constraints into the normalizing flow training to ensure protected attributes are handled appropriately.
As DiCoFlex trains on K-nearest neighbors from labeled training data (Equation 6). counterfactual quality depends on label accuracy.
G Context Vector Architecture
The conditional normalizing flow pe (x'1 x, n': p, m) requires a mechanism incorporate conditioning information during the generative process. We achieve this through a context vector that concatenates all conditioning inputs:
x 8/ p.p. m] E 1dd1+++dd
(32)
where x E IRd the original instance, 3/ E {0, 1} is the target class (one-hot encoded for multi-class scenarios), p E R is the sparsity parameter controlling the Lp norm, and m E (0, 1)dd is the binary actionability mask indicating which features should remain unchanged.
Following the Masked Autoregressive Flow (MAF) architecture 266, this context vector is passed to each layer of the flow through the affine coupling transformations. Specifically, MAF, each transformation layer computes:
2: x O exp(a; (x)s:: + (x,(''s c),
(33)
where as and μ4 neural networks that produce scale and shift parameters conditioned on both previous dimensions x'z, and the context vector c. This autoregressive conditioning allows the flow to learn expressive transformations that respect the user-specified constraints encoded in c.
The key advantage of this architecture that it enables flexible control at inference time: users can adjust p and m dynamically to generate counterfactuals satisfying different sparsity and actionability
28

---

requirements without retraining the model. The flow learns to map these constraint specifications to appropriate regions of the counterfactual distribution during training, as described in Algorithm !
H
Computational Resources
Our experimental framework utilized Python [42 as the primary programming language, Addition- ally, the open-source machine learning library PyTorch [27] is used to implement DiCoFlex. All experiments were conducted on a GPU cluster equipped with a GeForce RTX 4090 graphics card (24 GB VRAM) and AMD Ryzen Threadripper PRO 5975WX 32-core processor, with 256 GB of available RAM. These resources provide sufficient computational power and processing speed to meet the requirements of our algorithm.
I Additional experimental results
1.1 Runtime Comparison Across Datasets
Figure 3 displays runtime comparisons between DiCoFlex and baseline methods across all datasets, with time shown logarithmic scale. Both variants of DiCoFlex consistently achieve substantially faster execution times for counterfactual generation, while competing approaches demand processing times that are orders of magnitude longer. This substantial performance advantage stems from fundamental architectural differences. DiCE [22) performs separate optimization procedures for each explanation. CCHVAE (28) requires expensive latent space searching. Similarly, Wachter [4), ReViSE [16] and TABCF 25 rely on iterative gradient-based optimization procedures that scale poorly with the number of counterfactuals generated. contrast, DiCoFlex leverages conditional normalizing flows trained solely on labeled data to generate multiple diverse counterfactuals in single forward pass. By eliminating iterative optimization procedures and model access inference time, DiCoFlex enables real-time counterfactual generation.
1.2 Impact of Actionability Constraints
Table the evaluation of counterfactual explanations generated by DiCoFlex with different actionability constraints imposed through feature masks. The analysis reveals complex relationships between masking constraints and evaluation metrics. In particular, the application of different masks results in varying impacts across metrics without following a consistent directional pattern.
Mask 1, which prevents modifications to Capital Gain and Capital Loss, achieves the lowest continu- ous proximity score but exhibits reduced diversity, as indicated by its hypervolume score. In contrast, mask 4 (restricting Sex and Native Country modifications) yields the highest hypervolume while maintaining moderate performance across other metrics. Mask 3 (constraining Age) demonstrates high classification probability but the highest proximity score, indicating a greater deviation from the original instances.
The observed results indicate that actionability constraints introduce complex trade-offs that do follow simple patterns. The absence of consistent correlations between metrics under different masking configurations suggests that performance characteristics are highly dependent on the specific constraints applied rather than adhering predictable trade-off relationships.
These findings further validate DiCoFlex flexibility in selecting various user-defined constraints without retraining, while demonstrating that the selection of appropriate constraints should be guided by domain-specific requirements rather than general optimization principles. The mechanism enables the practical customization of counterfactual explanations according to specific application needs, where different feature restrictions may be necessary due to legal, ethical, or practical considerations.
I.3 Statistical Uncertainty Results
To assess the robustness of the reported metrics, we compute standard deviations across counterfactual sets generated per factual instance. For each test point, we produce multiple counterfactuals and evaluate the per-instance metric variance; the reported values represent the mean standard deviation across the test set. Note that the hypervolume metric operates the set level and thus does not admit standard deviation estimate.
29

---

2855
10a
10*
1285
4621
880
200
10a
Time (seconds)
Time (seconds)
Time (seconds)
107
10a
10"
20 .0
24.00
23.00
9.00
10'
6,00
100
103
0.10
0.38
3.10
10
10
DiCoflex (p-2.0)
CCHVAE
DICE
ReVISE
TABCF
Wachter
DiCoFlex (p-2.0)
DiCaFlex (p=0.01)
CCHVAE
DICE
ReVISe
TABCF
Wachter
DiCoFlex (p-2.00 20
DiCoFlex (p=0.01)
CCHVAE
DICE
ReViee
TABCF
Wachier
DiCoFlex
Methods
Methods
Methods
(a) Adult
(b) Bank
Default
10a
10a
2117
A15
10a
107
Time csnds)
10a
2,00
2.00
10c
10a
10-1
10-1
008
DICoFlex (p=2.0) 22.0)
DICoFlex (p-0.01)
CCHVAE
DICE
ReViSE
TABCF
Wachter
DICoFlex Fxx p=2.0)
DiCoFlex (p=0.01)
CCHWA
DICE
ReViSe
TABCF
Wachter
Methods
Methods
(d) GMC
(c) Lending-Club
Figure 3: Visualization of runtime DiCoFlex method and other baseline methods.
Notation:
Standard deviations are denoted directly as metric values in this table (no + notation used for compactness). Metrics are averaged across counterfactuals for each instance and then aggregated across the set.
1.4 German Credit Dataset Results
To evaluate the generalization of DiCoFlex to smaller tabular datasets, we conduct additional experiment on the German Credit dataset (1,000 samples, 20 features, binary target). Despite the limited data availability, DiCoFlex maintains consistent performance across all evaluation metrics, demonstrating robustness in low-data regimes.
Even under constrained data conditions, both DiCoFlex variants (DiCoFlex (p=2.0) and DiCoFlex (p=0.01)) achieve perfect validity and strong plausibility (lowest L.F),, confirming their ability to learn consistent counterfactual manifolds from limited examples. The results also show that the
30

---

Table Influence of imposing actionability constraints on the metrics used evaluate counterfactual explanations.
Classif. prob.
Proximity cont. +
Sparsity cat. 4
c-sparsity cont. 4
LOF log scale |
Hypervol.
Model
log scale
mask
0.987
0.496
0.557
0.483
1.881
0.881
mask 2
0.980
0.553
0.555
0.517
2.364
1.703
mask
0.993
0.627
0.568
0,513
2.310
2.411
mask 4
0.992
0.517
0.590
0.520
2.327
2.640
unconstrained
0.998
0.581
0.515
0.498
2.156
2.036
Table 7: Standard deviations of evaluation metrics across datasets and methods. Values indicate variability across generated counterfactuals for each instance. Lower values correspond to more stable generation behavior. Standard deviations are shown for all metrics except Hypervolume, which computed at the set level and thus not associated with instance- wise variance.
Validity f
Classif.
Proximity cont. 4
Sparsity cat. J
e-sparsity cont. L
LOF
Dataset
Model
prob.
log scale
Lending Club
DiCoFlex (p=2.0)
0
0.012
0.439
0.198
0.087
0.076
DiCoFlex (p=0.01)
0
0.031
0.432
0.209
0.100
0.053
CCHVAR
0
0.368
0.401
0.049
0.066
0.119
DICE
0.037
1.358
0.004
0.053
0.167
Adult
DiCoFlex (p=2.0)
0
0.011
0.518
0.099
0.127
0.256
DiCoFlex (p=0.01)
0.000
0.352
0.106
0.096
0.812
CCHVAE
0.102
0.646
0.049
0.189
0,976
DiCE
0
0.000
1,464
0.017
0.264
0.915
Bank
DiCoFlex (p=2.0)
0
0.025
0.571
0.100
0.111
0,016
DiCoFlex (p=0.01)
0
0.119
0.466
0.088
0,073
0,011
CCHVAE
0
0.053
0.606
0.061
0.090
0.078
DICE
0.012
1.162
0.056
0.082
0.139
Default
DiCoFlex (p=2.0)
0
0.021
0.346
0.138
0.071
0.038
DiCoFlex (p=0.01)
0.012
0.324
0.171
0.085
0.034
CCHVAE
0
0.043
0.273
0.097
0.076
0.047
DICE
0.097
1.203
0.141
0.113
0,073
GMC
DiCoFlex (p=2.0)
0
0.032
0.535
0.235
0.058
0.061
DiCoFlex (p=0.01)
0
0.037
0.694
0.229
0.059
0.099
CCHVAE
0
0.052
0.507
0.148
0.076
0.064
DICE
0.072
1.021
0.048
0.073
0.019
Table 8: Comparison counterfactual generation methods on the German Credit dataset. Lower proximity, sparsity, e-sparsity, and LOF indicate better results; higher validity, classification probabil- ity, and hypervolume indicate improved performance.
Classif. prob.
Proximity cont. L
Sparsity eat. J
e-sparsity cont. 1
LOF log L
Hypervol,
Dataset
Model
Validity f
log 7
German
DiCoFlex (p=2.0)
1.000
0,833
0.639
0.553
0.756
0.0465
-6.030
Crodit
DiCoFlex (p=0.01)
1.000
0,833
0.647
0.556
0.750
0.0443
-6.115
CCHVAE
1.000
0.650
0.610
0.538
0.825
0.0747
-8.878
DICE
0.954
ReViSE
0.673
0.731
0.841
0.523
0.742
0.1731
TABCF
1.000
0.912
0.829
0.348
0.559
0.0508
Wachter
0.356
0.508
1,635
0.000
0.952
0.2529
hypervolume metric remains competitive, suggesting that diversity preserved even when the training data distribution is relatively sparse.
31

---

These findings highlight that DiCoFlex generalizes effectively to smaller datasets, further reinforcing its practicality for real-world applications where large annotated samples may be unavailable.
32


Reviews:
[{"review_id": "i9PZIorKni", "reviewer": "Reviewer_TN7b", "summary": "This paper introduces DiCoFlex, a model-agnostic, conditional generative framework for generating diverse counterfactual explanations for tabular data. DiCoFlex leverages conditional normalizing flows to generate multiple plausible counterfactuals in a single forward pass. The results demonstrate that DiCoFlex achieves significant computational efficiency and flexibility for incorporating domain-specific constraints.", "questions": "Please refer to the weakness", "limitations": "Yes", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 3, "originality": 3, "strengths_and_weaknesses": "## Strengths\n1. The motivation is clear, and the proposed method is described in a detailed and structured way.\n2. The experimental setup is thorough, with comprehensive evaluations across diverse datasets and meaningful comparisons to baseline methods.\n3. The evaluation metrics for counterfactual quality, including diversity and plausibility provides extra perspectives.\n\n## Weaknesses\n\n1. There are gaps between the stated goals and the technical implementation. For example, the connection between validity, proximity, and plausibility and their calculation in Eq. (6) is not clearly articulated.\n2. It is not clear how the score function (Eq. 4) and the actionable constraints Eq (9) are integrated into the training of the flow-based model.\n3. The approach appears largely intuition-driven and lacks rigorous theoretical guarantees or proofs of properties such as diversity or constraint adherence.", "was_revised": true, "final_justification": "I have no questions about the submission. My only concern is that significant improvements made after the initial submission may require substantial revision.", "rebuttal": "Thank you for your thoughtful review and constructive feedback. We appreciate your recognition of DiCoFlex's clear motivation, thorough experimental evaluation, and computational efficiency advantages.\n\nWe address your main concerns below:\n\n# Clarification of Score Function Design (Eq. 6)\nWe agree that introducing the score function given by equation (6) may be confusing and will clarify it in the revised version. This function is not used for training and evaluation. Our intention was to show how the constraints representing the validity, proximity, and plausibility can be aggregated into one criterion and to show that direct optimization of (6) can provide only a single counterfactual explanation, so it does not solve the main goal of this paper, which was focused on generating multiple counterfactuals efficiently.\n\nThe connection between validity, proximity, and plausibility and their calculation in eq. (6) is as follows:\nlogprob $\\log p(y'|x')$ component represents the correct classification of conterfactual $x'$ to the desired class $y'$ (validity constraint).\n$d(x',x)$ represents the distance between the original example $x$, and the counterfactual $x'$ (with minus sign in equation (6), represents proximity constraint).\n$p_{data}(x')$ represents the density function for the data distribution (likelihood function representing plausibility constraint).\n\nAs mentioned earlier, we use the score function only for motivation; direct optimization requires access to data distribution (can be modelled with flow) and leads to a counterfactual point, not the distribution of counterfactuals. Therefore, we propose to construct the conditional distribution for generating counterfactual $q(x'|x,y',d)$ given by eq. (7). The generated counterfactuals with this distribution satisfy constraints:\nValidity, because we select examples from a valid class $y'$.\nProximity, because we take the nearest neighbours in class $y'$.\nPlausibility, because we take the real examples that exist in the data distribution.   \n\nBesides, they also satisfy:\nSparsity, because various norms can be used for distance calculation.\nActionability, because selected attributes can be masked and remain unchanged.\n\nThe unparametrized KNN-based model $q(x'|x,y',d)$ is further used to train a parametrized flow-based model $p_{\\theta}(x'|x, y)$ by minimizing KLD given by eq. (1) that is equivalent to minimizing $Q$ given eq. (4). The technical implementation is described by the Algorithm in Appendix D (Supplementary Material).\n\n# Integration of Score Function and Constraints in Training\nEq. (4) is the criterion used during training and is based on KLD between KNN-based model $q(x'|x,y',d)$  and flow-based model $p_{\\theta}(x'|x, y',p,m)$ that is used to train parameters of the flow-based model. The technical procedure for training is described by the Algorithm in Appendix D. In each iteration, we select an example $x$ from the training data and sample a class $y'$. We sample the sparsity level $p$ and mask the candidate $m$. Next, we sample $x'$, one of the $K$ nearest neighbours of $x$ in class $y'$. Note that neighbors are calculated using the distance given by the eq. (9) based on the current $p$ and $m$ values. Finally, the parameters of the flow-based model $p_{\\theta}(x'|x, y',p,m)$ are updated with a gradient-based procedure by minimizing $-\\log(p_{\\theta}(x'|x, y',p,m))$ (based on eq. (4)). We highlight, that we use condition variant of flow-based model, that takes $x$, $y'$ and sparsity parameter $s$ and actionability parametr represetned by mask $m$. So the flow-based model is trained by optimizing Eq. (4) using the neighbours calculated with the distance given by Eq. (9) with $m$ and $p$ sampled in each iteration. Because we sample $m$ and $p$  in each iteration during the training flow-based model, while generating counterfactuals, we can use this model to control sparsity and actionability via simple conditioning on $m$ and $p$.\n\n# Theoretical Considerations\n\nWe disagree that our approach is largely intuition-driven and lacks rigorous theoretical guarantees. We aim to construct a distribution $q(x'|x,y',d)$ for which the samples represent counterfactuals that satisfy validity (examples from correct class y'), proximity (the closest examples, because we use KNN), plausibility (we select examples that are in data distribution), sparsity (we control the norm with parameter $p$), and actionability (we selected only attributes that can be changed using masking procedure). In lines 175-181, we justify not taking $q(x'|x,y',d)$ directly as a sampling model. Finally, we formulate the theoretical problem of finding a parametrized probabilistic model as a surrogate model in eq. (1), and show how to solve it efficiently.\n\nAdditionally, we provide a theorem for theoretical guarantees of diversity preservation for our method that will be included into the final version of our work:\n\n## Lemma: Upper bound on difference of expected values between two distributions\n\nLet $p, q$ be two distributions over the same finite set $X$ and the total variation distance $TV(p,q) = \\frac{1}{2}\\sum_x |p(x) - q(x)|$. If for some function $f: X \\to \\mathbb{R}$, then:\n\n$$\\left|\\sum_x f(x)(p(x) - q(x))\\right| \\leq \\max_x |f(x)| \\cdot \\sum_x |p(x) - q(x)| = 2 \\cdot \\max_x |f(x)| \\cdot TV(p,q)$$\n\n## Theorem: Diversity Preservation in DiCoFlex\n### Statement\nLet $p_\\omega(x'|x,y',p,m)$ be the learned conditional normalizing flow and $\\hat{q}(x'|x,y',d_{p,m})$ be the empirical distribution defined in Eq. (7). Under assumptions (A1)-(A4), for n samples $x_i', i = 1, 2, \\ldots, n$ drawn from $p_\\omega$, the expected diversity satisfies:\n\n$$\n\\mathbb{E}\\_{p\\_\\omega}[D(\\{x'\\_i\\}\\_{i=1}^n)] \\geq \\sigma\\_{\\min}(1 - K^{1-n}) - \\Delta\\sqrt{2\\epsilon}\n$$\n\n### Assumptions\n- **(A1)** The neighborhood $N(x, y', d_{p,m}, K)$ contains $K$ distinct points with minimum pairwise distance $\\sigma_{\\min} > 0$. Specifically, for any $x_i, x_j \\in N(x, y', d_{p,m}, K)$ with $i \\neq j$,\n$$\n|x_i - x_j| \\geq \\sigma_{\\min}\n$$\n- **(A2)** The normalizing flow is trained sufficiently close to the empirical distribution, satisfying:\n$$\nD_{KL}(\\hat{q}(x'|x,y',d_{p,m}) \\| p_\\omega(x'|x,y',p,m)) \\leq \\epsilon\n$$\nfor all $(x,y',p,m)$ in the training distribution.\n- **(A3)** The support of $p_\\omega(\\cdot\\mid x,y',p,m)$ lies in a set of finite diameter $\\Delta$, i.e.\n\n$$\n|x' - x''| \\leq \\Delta \\quad \\Longrightarrow \\quad 0 \\leq D(\\{x'\\_i\\}) = \\min\\_{i \\neq j} |x'_i - x'_j| \\leq \\Delta.\n$$\n\n### Proof\n**Step 1: Empirical Diversity**\nConsider the empirical distribution $\\hat{q}$. When sampling $n$ points uniformly at random (with replacement) from $K$ distinct points, the expected diversity is at least the product of minimum pairwise distance $\\sigma_{\\min}$ and the probability of selecting at least two distinct points $P_n(K)$:\n\n$$\n\\mathbb{E}\\_{\\hat{q}}[D(\\{x'\\_i\\}_{i=1}^n)] \\geq \\sigma\\_{\\min} \\cdot P_n(K) = \\sigma\\_{\\min}(1 - K^{1-n})\n$$\n\n**Step 2: Total Variation Distance via Pinsker’s Inequality**\nPinsker's inequality relates the KL-divergence and total variation distance:\n\n$$\n||p\\_\\omega(\\cdot|x,y',p,m) - \\hat{q}(\\cdot|x,y',d\\_{p,m})||\\_{TV} \\leq \\sqrt{\\frac{\\epsilon}{2}}\n$$\n\n**Step 3: Bounding the Difference in Diversity**\nThe diversity measure, defined by pairwise distances, is bounded above by $\\Delta$. Thus, using Lemma 1 we obtain:\n\n$$\n|\\mathbb{E}\\_{p\\_\\omega}[D] - \\mathbb{E}\\_{\\hat{q}}[D]| \\leq 2 \\cdot \\Delta \\cdot ||p\\_\\omega - \\hat{q}||\\_{TV} \\leq 2 \\Delta\\sqrt{\\frac{\\epsilon}{2}} = \\Delta\\sqrt{2\\epsilon}\n$$\n\n**Step 4: Combining the Results**\nFrom Step 3, we have an absolute value bound. Since we specifically seek a lower bound for $\\mathbb{E}\\_{p_\\omega}[D]$, we remove the absolute value by explicitly considering the worst-case scenario for diversity under $p\\_\\omega$ relative to $\\hat{q}$:\n\n$$\n\\mathbb{E}\\_{p_\\omega}[D(\\{x'_i\\}\\_{i=1}^n)] \\geq \\mathbb{E}\\_{\\hat{q}}[D(\\{x'_i\\}\\_{i=1}^n)] - \\Delta\\sqrt{2\\epsilon}\n$$\n\nSubstituting Step 1 into the above, we obtain the desired explicit lower bound:\n\n$$\n\\mathbb{E}\\_{p\\_\\omega}[D(\\{x'_i\\}\\_{i=1}^n)] \\geq \\sigma\\_{\\min}(1 - K^{1-n}) - \\Delta\\sqrt{2\\epsilon}\n$$\n\n### Remarks\n1. **Diversity Guarantee**: For large $K$, $1 - K^{1-n}\\approx 1$, ensuring strong diversity. Thus the bound\n\n$$\n\\mathbb{E}\\_{p\\_\\omega}[D(\\{x'_i\\}\\_{i=1}^n)] \\geq \\sigma\\_{\\min}(1 - K^{1-n}) - \\Delta\\sqrt{2\\epsilon}\n$$\n\nguarantees that $p\\_\\omega$ recovers nearly the full empirical diversity except for the training error.\n\n2. **Impact of Training**: As training improves ($\\epsilon \\rightarrow 0$), the perturbation term $\\Delta\\sqrt{2\\epsilon}$ vanishes, and the learned distribution’s diversity converges to the empirical distribution’s diversity."}, {"review_id": "p2f6sOyvxd", "reviewer": "Reviewer_CeoU", "summary": "This paper introduces DiCoFlex, a conditional generative framework for model-agnostic counterfactual explanation. DiCoFlex is built upon conditional normalizing flows (specifically, Masked Autoregressive Flows) and trained using only labeled data, without requiring access to model gradients or internals. It enables generation of diverse, plausible, and constraint-aware counterfactuals in a single forward pass. The method is evaluated on five benchmark tabular datasets, where it outperforms or matches state-of-the-art baselines across key metrics including diversity, proximity, and plausibility.", "questions": "1. DiCoFlex vs. s-DiCoFlex: Since p is part of the conditioning context and can be set dynamically at inference time, what exactly distinguishes s-DiCoFlex from DiCoFlex beyond using different p values? Are they trained with different p ranges, or is this merely a naming convention?\n\n2. Sensitivity analysis: Can the authors provide or discuss a broader sweep over p values to show how sparsity, plausibility, and proximity metrics vary as a function of p?\n\n3. Clarify the wording around the sparsity effect of low p: the paper says “lower sparsity” is encouraged when p = 0.01, but the intended behavior is to encourage higher sparsity.\n\n4. Context vector construction: Can the authors clarify how the conditioning vector (including p, mask, and target class) is structured and passed into the MAF layers?", "limitations": "Additional reflection on robustness to labeling noise or fairness impacts of constraint settings would further strengthen this part.", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths:\n\nThe approach is model-agnostic and does not require gradient access or retraining when user constraints change.\n\nDiCoFlex supports dynamic inference-time control over constraints, which is both novel and practical.\n\nThe model is efficient: it generates multiple diverse counterfactuals per instance via a single forward pass.\n\nExperimental results are extensive and well-structured across multiple datasets and evaluation metrics.\n\nThe paper is highly reproducible, with code, datasets, evaluation procedures, and a detailed training algorithm provided.\n\n\n\nWeaknesses:\n\nWhile DiCoFlex claims inference-time controllability of sparsity via parameter p, the comparison between DiCoFlex and s-DiCoFlex is somewhat confusing , the paper treats them as different variants even though they use the same model with different p values.\n\nThe paper does not provide a sensitivity analysis or sweep over different values of p, which could strengthen the claim of flexible constraint handling.\n\nStatistical uncertainty (e.g., standard deviations, confidence intervals) is not reported in the evaluation.\n\nThe sparsity explanation in Section 4 contains unclear wording: it states “p = 0.01 encourages lower sparsity”, which contradicts the intended meaning (lower p encourages higher sparsity).", "was_revised": true, "final_justification": "The authors answered my questions and provided additional information on DiCoFlex vs. s-DiCoFlex. I am updating my score upwards, trusting the authors to better clarify these points in the final version of the paper.", "rebuttal": "Thank you for your thoughtful and constructive review. We appreciate your recognition of our method's strengths, particularly the model-agnostic approach, dynamic constraint control, and computational efficiency. We address your concerns below:\n\n# DiCoFlex vs. s-DiCoFlex Clarification\nYou are correct that DiCoFlex and s-DiCoFlex represent the same model. s-DiCoFlex is simply DiCoFlex evaluated with p=0.01 during inference to demonstrate sparsity control. Users can dynamically adjust p at inference time. We acknowledge the separate naming is misleading and will revise the paper to clarify that these are configurations of a single model rather than distinct methods.\n\n# Sensitivity Analysis Over p Values\nWe agree that a comprehensive sensitivity analysis strengthens our claims about flexible constraint handling. The table below presents results for different p values ($p \\in \\{{0.01, 0.08, 0.25, 1.0, 2.0}\\}$) for the Adult dataset, demonstrating the smooth control our method provides over the sparsity-proximity trade-off.\n\n| Model | Classif. prob. ↑ | Proximity cont. ↓ | Sparsity cat. ↓ | ε-sparsity cont. ↓ | LOF log scale ↓ | Hypervol. log scale ↑ |\n|---|---|---|---|---|---|---|\n| DiCoFlex_p0.01 | **1.000** | **0.373** | 0.568 | **0.441** | **1.9119** | 0.9023 |\n| DiCoFlex_p0.08 | 0.996 | 0.501 | 0.553 | 0.454 | 1.9680 | 1.0801 |\n| DiCoFlex_p0.25 | 0.995 | 0.551 | 0.541 | 0.501 | 2.2380 | 1.3780 |\n| DiCoFlex_p1.0 | 0.996 | 0.577 | 0.537 | 0.589 | 2.6349 | **1.9491** |\n| DiCoFlex_p2.0 | 0.998 | 0.581 | **0.515** | 0.601 | 2.6614 | 1.8862 |\n\nThe results reveal several key insights: Validity remains consistently high across all p values, confirming robust constraint satisfaction regardless of perturbation level. Clear proximity-sparsity trade-off: Lower p values achieve superior proximity and plausibility, while higher p values yield better categorical sparsity. Smooth transitions: All metrics change gradually across p values, enabling practitioners to fine-tune the balance between competing objectives based on their specific requirements.\n\nThis sensitivity analysis validates our method's ability to provide flexible constraint handling, allowing users to systematically navigate the multi-objective trade-off space by simply adjusting the perturbation parameter p.\n\nWe will include this analysis to our work in the final version.\n\n# Statistical Uncertainty Reporting\nWe agree that statistical uncertainty measures enhance evaluation rigor. We calculate standard deviations across sets of diverse counterfactual explanations for each instance. We report standard deviation values for all individual-level metrics below. We will add standard deviation values to our main experiment results in Table 1 in the final version.\n\n| Dataset | Model | Validity ↑ | Classif. prob. ↑ | Proximity cont. ↓ | Sparsity cat. ↓ | ε-sparsity cont. ↓ | LOF log scale ↓ |\n|---|---|---|---|---|---|---|---|\n| Lending Club | DiCoFlex | 0 | 0.012 | 0.439 | 0.198 | 0.087 | 0.076 |\n| | s-DiCoFlex | 0 | 0.031 | 0.432 | 0.209 | 0.100 | 0.053 |\n| | CCHVAE | 0 | 0.368 | 0.401 | 0.049 | 0.066 | 0.119 |\n| | DiCE | 0 | 0.037 | 1.358 | 0.004 | 0.053 | 0.167 |\n| Adult | DiCoFlex | 0 | 0.011 | 0.518 | 0.099 | 0.127 | 0.256 |\n| | s-DiCoFlex | 0 | 0 | 0.352 | 0.106 | 0.096 | 0.812 |\n| | CCHVAE | 0 | 0.102 | 0.646 | 0.049 | 0.189 | 0.976 |\n| | DiCE | 0 | 0 | 1.464 | 0.017 | 0.264 | 0.915 |\n| Bank | DiCoFlex | 0 | 0.025 | 0.571 | 0.100 | 0.111 | 0.016 |\n| | s-DiCoFlex | 0 | 0.119 | 0.466 | 0.088 | 0.073 | 0.011 |\n| | CCHVAE | 0 | 0.053 | 0.606 | 0.061 | 0.090 | 0.078 |\n| | DiCE | 0 | 0.012 | 1.162 | 0.056 | 0.082 | 0.139 |\n| Default | DiCoFlex | 0 | 0.021 | 0.346 | 0.138 | 0.071 | 0.038 |\n| | s-DiCoFlex | 0 | 0.012 | 0.324 | 0.171 | 0.085 | 0.034 |\n| | CCHVAE | 0 | 0.043 | 0.273 | 0.097 | 0.076 | 0.047 |\n| | DiCE | 0 | 0.097 | 1.203 | 0.141 | 0.113 | 0.073 |\n| GMC | DiCoFlex | 0 | 0.032 | 0.535 | 0.235 | 0.058 | 0.061 |\n| | s-DiCoFlex | 0 | 0.037 | 0.694 | 0.229 | 0.059 | 0.099 |\n| | CCHVAE | 0 | 0.052 | 0.507 | 0.148 | 0.076 | 0.064 |\n| | DiCE | 0 | 0.072 | 1.021 | 0.048 | 0.073 | 0.019 |\n\nNote that we exclude Hypervolume from uncertainty reporting as this is a set-level metric that computes a single value per entire counterfactual set, making standard deviation calculations inappropriate. \n\n# Sparsity Explanation Correction\n\nThank you for catching this error. The statement \"p = 0.01 encourages lower sparsity\" should read \"p = 0.01 encourages higher sparsity\" (fewer modified features). Lower p values in the Lp norm indeed encourage sparser solutions by penalizing modifications more heavily. We will correct this throughout the paper.\n\n# Context Vector Construction Details\nThe conditioning vector concatenates: \\[x (original instance), y (target class), p (sparsity parameter), m (actionability mask)\\]. This vector is passed to each MAF layer through affine coupling transformations. This way we condition the estimated probability on the conditioning vector as it is described in [1]. We will add a detailed description of this architecture in the Appendix.\n\n[1] Papamakarios, George, Theo Pavlakou, and Iain Murray. \"Masked autoregressive flow for density estimation.\" Advances in neural information processing systems 30 (2017).\n\n# Limitations\nSince DiCoFlex learns the counterfactual distribution for a specific classifier, classifier changes may invalidate some generated counterfactuals. However, generating multiple diverse counterfactuals allows filtering to retain valid ones, providing natural resilience without retraining.\n\nWe believe these revisions will significantly strengthen the paper while maintaining its core contributions. Thank you again for your valuable feedback."}, {"review_id": "2oxw0OjkPj", "reviewer": "Reviewer_jqT4", "summary": "This paper proposes a new generative approach for providing diverse counterfactual explanations. A key idea of the proposed method, called DiCoFlex, is to train a normalizing flow model by taking validity, proximity, and plausibility into account. In addition, DiCoFlex can handle sparsity and actionability constraints using a customized proximity measure without requiring retraining. Through experiments, the authors demonstrated that DiCoFlex was significantly faster than existing baselines, while maintaining comparable or superior quality of generated counterfactuals.", "questions": "1. In the experiments, the authors used five datasets with about 30000 samples. Can the proposed method perform similarly for smaller benchmark datasets, such as FICO and German?\n1. In Section 3.4, the authors state, \"While sparsity is often implicitly achieved for categorical variables due to the applied optimization scheme, enforcing sparsity on continuous features remains challenging.\" and \"Since categorical attributes are commonly encoded by one-hot vectors, the above scheme affects mostly continuous features.\" What do these sentences mean?", "limitations": "While the authors discussed the limitations of the proposed method in Appendix, there seems to be no discussion on its potential negative societal impacts. For example, I think the diverse counterfactual explanation poses a risk of model extraction [3, 4]. \n\n[3] Aïvodji et al.: Model extraction from counterfactual explanations. arXiv, 2020. \n\n[4] Wang et al.: DualCF: Efficient Model Extraction Attack from Counterfactual Explanations. FAccT, 2022.", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 2, "clarity": 1, "significance": 3, "originality": 2, "strengths_and_weaknesses": "Strengths:\n1. The motivation of the proposed method is reasonable. I think it is an interesting idea to model the desiderata of counterfactual explanation, including not only plausibility but also actionability, by the normalizing flow. \n1. The authors demonstrated well that the proposed method was significantly faster than the baselines without compromising the quality of the generated counterfactuals.  \n\nWeaknesses:\n1. The presentation of the proposed method in Section 3 could be more clarified and improved. While Section 3 primarily focuses on modeling $q$ and learning it as $p_\\theta$, it remains unclear how to generate counterfactuals. If my understanding is correct, the proposed method generates a set of counterfactuals $x'$ by sampling from a trained normalizing flow model $p_\\theta(x' \\mid x, y', p, m)$. However, I could not find how the proposed method ensures the diversity of the generated counterfactuals. The score function defined in Equation (6) was confusing for me because it is not directly used to generate counterfactuals. \n1. Although the proposed method heavily relies on the normalizing flow, this paper lacks details on the training of the normalizing flows in the experiments. For example, the average running times of training the normalizing flow models are not reported in this paper. In addition, I could not find how the authors determined the hyperparameters of the proposed method, such as $K$, $\\alpha$, number of training steps $T$, and model complexity (e.g., hidden layer sizes). I am concerned that the choice of these parameters may affect the performance of the proposed method. \n1. (minor) I am concerned about the use of the $L_p$-norm with $p \\in (0, 1)$ (e.g., $p=0.01$), as it may lead to instability in gradient-based training. I wonder if the sparsity can be sufficiently encouraged by the general $L_1$-norm. \n1. (minor) Although the key technique of the proposed method is the normalizing flow, this paper appears to overlook existing methods that also leverage the normalizing flow [1, 2]. \n\n[1] Wielopolski et al.: Probabilistically Plausible Counterfactual Explanations with Normalizing Flows. arXiv, 2024.\n\n[2] Furman et al.: Unifying Perspectives: Plausible Counterfactual Explanations on Global, Group-wise, and Local Levels. arXiv, 2024.", "was_revised": true, "final_justification": "Thank you for taking the time to answer all of my questions and concerns, and especially thank you for reporting additional experimental results. \nSince the rebuttal addressed some of my concerns (e.g., training details and small datasets), I have decided to improve my score.", "rebuttal": "Thank you for your detailed review and constructive feedback. We also appreciate your recognition of our method's key strengths: the novel use of normalizing flows to model counterfactual desiderata (including plausibility and actionability) and our demonstration that the proposed method achieves significant computational efficiency without compromising counterfactual quality.\n \nWe address your concerns below:\n# Presentation and Method Clarity\n\nWe thank the reviewer for raising this important point. In DiCoFlex, counterfactuals are generated by sampling multiple noise vectors from the base distribution (assumed to be Gaussian) that are further processed using the inverse transformation of the normalizing flow to transform them to counterfactuals. Because we utilize the conditioned variant of the normalizing flow, this process is guided by the initial example $x$, the target class $y'$, and the parameters $p$ and $m$ that control sparsity and controlability. By modeling $p(x'|x,y,p,m')$ as a distribution rather than a point estimate, sampling multiple times naturally produces diverse counterfactuals. The normalizing flow learns the manifold of counterfactuals, and different samples explore different regions of this manifold. That diversity obtained in such a process was empirically confirmed in the evaluation using the Hypervolume metric in our experiments. The role of the score function given by Eq. (6) was just to show how the constraints representing the validity, proximity, and plausibility can be aggregated into one criterion (see more detailed explanation provided to reviewer TN7b). We will revise Section 3 to make the generation process and the role of the score function more explicit.\n\nFurthermore, we provide theoretical analysis of diversity guarantees for our method (See the answer for reviewer TN7b).\n\n# Training Details and Hyperparameters\nWe conducted extensive hyperparameter exploration across the following ranges:\n- K: \\[8, 16, 32\\]\n- alpha: \\[1, 10, 1000\\]\n- MAF hidden features: \\[16, 32, 64\\]\n- MAF hidden layers: \\[2, 5\\]\n- Training configuration: 1000 epochs with early stopping patience of 300 epochs\n\nTraining times are reported in a table below:\n| Dataset | Training Time (seconds) |\n|---|---|\n| Bank | 1644.73 |\n| Adult | 5340.32 |\n| GMC | 5537.64 |\n| LendingClub | 5453.87 |\n| Default | 3611.40 |\n| German Credit | 95.69 |\n\nThe final hyperparameters were selected based on validation performance across multiple datasets, balancing counterfactual quality metrics (validity, proximity, plausibility) with computational efficiency. We will include a detailed hyperparameter sensitivity analysis in the final version, showing how these choices affect performance across different datasets and metrics.\n\n# Technical Concerns\n**$L_p$ Norm Stability**: Your concern about gradient instability with $p \\in (0,1)$ is understandable but doesn't apply here. **No gradients pass through this operation.** The $L_p$ norm is used only during the k-NN selection phase to define the ground-truth counterfactuals for training. The sparsity control mechanism operates at the data preparation level, not during gradient-based optimization of the flow model.\n\n**Related Work**: Thank you for highlighting the relevant papers [1,2]. Our key distinction is modeling the conditional probability distribution $p(x'|x,y')$ where both original instance x and target class y' condition the generation. In contrast, the cited works use flows to model $p(x'|y')$ and assess plausibility. Furthermore those methods have limitations regarding processing categorical variables, therefore it is impossible to include them to our benchmark. We will add detailed comparisons to our related work section.\n\n# Experimental Questions\n\n## Smaller Datasets\nWe evaluated our method on the German Credit dataset (1,000 samples) as requested. The results demonstrate that our approach maintains excellent performance on smaller datasets:\n\n| Dataset | Model | Validity ↑ | Classif. prob. ↑ | Proximity cont. ↓ | Sparsity cat. ↓ | ε-sparsity cont. ↓ | LOF log scale ↓ | Hypervol. log scale ↑ |\n|---------|-------|------------|-------------------|-------------------|-----------------|-------------------|-----------------|----------------------|\n| German Credit | DiCoFlex | **1.000** | **0.833** | 0.639 | 0.553 | 0.756 | 0.0465 | **-6.030** |\n| | s-DiCoFlex | **1.000** | **0.833** | 0.647 | 0.556 | **0.750** | **0.0443** | -6.115 |\n| | CCHVAE | **1.000** | 0.650 | **0.610** | 0.538 | 0.825 | 0.0747 | -8.878 |\n| | DiCE | 0.954 | 0.808 | 1.143 | **0.257** | 0.756 | 0.1936 | -7.456 |\n| | ReViSE | 0.673 | 0.731 | 0.841 | 0.523 | 0.742 | 0.1731 | -- |\n| | TABCF | 1.000 | 0.912 | 0.829 | 0.348 | 0.559 | 0.0508 | -- |\n| | Wachter | 0.356 | 0.508 | 1.633 | 0.000 | 0.952 | 0.2529 | -- |\n\nOur method achieves perfect validity and maintains high classification probability while delivering the best hypervolume performance and competitive LOF scores. These results confirm that our approach scales effectively to smaller benchmark datasets, addressing the reviewer's concern about generalizability across dataset sizes.\n\n## Sparsity Explanation\nThank you for seeking clarification on these statements. We provide the following explanation. The statements in Section 3.4 refer to the natural behavior of our k-NN selection mechanism:\n\n**Why categorical sparsity is implicit:** The key insight lies in the distance metric behavior for different variable types. For categorical variables encoded as one-hot vectors, consider two binary vectors $x=(x_1,x_2)$ and $y=(y_1,y_2)$. The p-distance $d_p(x,y)$ equals 0 when $x_1=y_1$ and equals 2 otherwise, regardless of the chosen p value. This discrete jump property means that to transition between different categories (changing only one categorical variable), the optimization must traverse a fixed distance of 2, naturally limiting categorical changes.\n\n**Why continuous features need explicit control:** In contrast, continuous variables allow for gradual changes with smaller distances. The choice of p-norm becomes crucial here, as smaller p-values promote sparse changes by concentrating modifications on fewer coordinates. \nWe acknowledge that alternative approaches, like dedicated preprocessing normalization, exist but are beyond the scope of this work.\n\n# Limitations and Societal Impact\nThe reviewer raised an important point about model extraction risks [3,4]. We will expand our limitations section to address potential negative societal impacts, including risk of model extraction through diverse counterfactual explanations.\n\nWe believe that these revisions will significantly improve the paper's clarity and completeness while addressing your technical concerns. Thank you for helping us to strengthen this work."}]

Author rebuttal:

Meta-review: The paper introduces DiCoFlex, a novel model-agnostic framework for generating diverse counterfactual explanations using conditional normalizing flows. All reviewers acknowledged the method's key innovation of enabling dynamic constraint control at inference time without retraining, achieving orders of magnitude faster generation than optimization-based methods while maintaining or improving quality metrics. The approach was validated across 5 tabular datasets with comprehensive metrics including validity, proximity, plausibility, and diversity, with code provided for reproducibility.

Initially, reviewers raised concerns about theoretical foundations (TN7b), method clarity and DiCoFlex vs. s-DiCoFlex naming confusion (CeoU, jqT4), missing training details and evaluation on smaller datasets (jqT4), and lack of statistical uncertainty reporting (CeoU). All reviewers who engaged post-rebuttal were satisfied with the responses, with jqT4 explicitly raising their score after additional experiments on German Credit dataset were provided, and TN7b confirming that theoretical guarantees with formal proofs addressed all concerns.

While this is a solid technical contribution with practical advantages in computational efficiency and flexible constraint handling, it represents an incremental advance in counterfactual explanation methods rather than a breakthrough result. It is good to present in poster.
Decision: Accept (poster)