<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3-mathml3.dtd">
<article xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" dtd-version="1.3" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Artif. Intell.</journal-id>
<journal-title-group>
<journal-title>Frontiers in Artificial Intelligence</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Artif. Intell.</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub">2624-8212</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/frai.2026.1743495</article-id>
<article-version article-version-type="Version of Record" vocab="NISO-RP-8-2008"/>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Original Research</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>Tabular diffusion counterfactual explanations</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Zhang</surname> <given-names>Wei</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; original draft" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-original-draft/">Writing &#x2013; original draft</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; review &amp; editing" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/">Writing &#x2013; review &#x00026; editing</role>
<uri xlink:href="https://loop.frontiersin.org/people/3272470"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Barr</surname> <given-names>Brian</given-names></name>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Conceptualization" vocab-term-identifier="https://credit.niso.org/contributor-roles/conceptualization/">Conceptualization</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Supervision" vocab-term-identifier="https://credit.niso.org/contributor-roles/supervision/">Supervision</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Visualization" vocab-term-identifier="https://credit.niso.org/contributor-roles/visualization/">Visualization</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; review &amp; editing" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/">Writing &#x2013; review &#x00026; editing</role>
</contrib>
<contrib contrib-type="author">
<name><surname>Paisley</surname> <given-names>John</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Methodology" vocab-term-identifier="https://credit.niso.org/contributor-roles/methodology/">Methodology</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Supervision" vocab-term-identifier="https://credit.niso.org/contributor-roles/supervision/">Supervision</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; review &amp; editing" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/">Writing &#x2013; review &#x00026; editing</role>
<uri xlink:href="https://loop.frontiersin.org/people/3380952"/>
</contrib>
</contrib-group>
<aff id="aff1"><label>1</label><institution>Electrical Engineering, Columbia University</institution>, <city>New York, NY</city>, <country country="us">United States</country></aff>
<aff id="aff2"><label>2</label><institution>Capital One</institution>, <city>New York, NY</city>, <country country="us">United States</country></aff>
<author-notes>
<corresp id="c001"><label>&#x0002A;</label>Correspondence: Wei Zhang, <email xlink:href="mailto:wz2363@columbia.edu">wz2363@columbia.edu</email></corresp>
</author-notes>
<pub-date publication-format="electronic" date-type="pub" iso-8601-date="2026-02-13">
<day>13</day>
<month>02</month>
<year>2026</year>
</pub-date>
<pub-date publication-format="electronic" date-type="collection">
<year>2026</year>
</pub-date>
<volume>9</volume>
<elocation-id>1743495</elocation-id>
<history>
<date date-type="received">
<day>10</day>
<month>11</month>
<year>2025</year>
</date>
<date date-type="rev-recd">
<day>17</day>
<month>01</month>
<year>2026</year>
</date>
<date date-type="accepted">
<day>21</day>
<month>01</month>
<year>2026</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2026 Zhang, Barr and Paisley.</copyright-statement>
<copyright-year>2026</copyright-year>
<copyright-holder>Zhang, Barr and Paisley</copyright-holder>
<license>
<ali:license_ref start_date="2026-02-13">https://creativecommons.org/licenses/by/4.0/</ali:license_ref>
<license-p>This is an open-access article distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License (CC BY)</ext-link>. The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</license-p>
</license>
</permissions>
<abstract>
<p>Counterfactual explanations methods provide an important tool in the field of interpretable machine learning. Recent advances in this direction have focused on diffusion models to explain a deep classifier. However, these techniques have predominantly focused on problems in computer vision. In this study, we focus on tabular data typical in finance and the social sciences and propose a novel guided reverse process for categorical features based on an approximation to the Gumbel-softmax distribution. Furthermore, we study the effect of the temperature &#x003C4; and derive a theoretical bound between the Gumbel-softmax distribution and our proposed approximated distribution. We perform experiments on several large-scale credit lending and other tabular datasets, assessing their performance in terms of the quantitative measures of interpretability, diversity, instability, and validity. These results indicate that our approach outperforms popular baseline methods, producing robust and realistic counterfactual explanations.</p></abstract>
<kwd-group>
<kwd>controllable diffusion models</kwd>
<kwd>counterfactual generation</kwd>
<kwd>heterogeneous data</kwd>
<kwd>discrete diffusion models</kwd>
<kwd>explainable machine learning</kwd>
</kwd-group>
<funding-group>
<funding-statement>The author(s) declared that financial support was received for this work and/or its publication. This research was supported by funding from Capital One Labs. C Capital One Labs was not involved in the study design, collection, analysis, interpretation of data, the writing of this article, or the decision to submit it for publication.</funding-statement>
</funding-group>
<counts>
<fig-count count="5"/>
<table-count count="5"/>
<equation-count count="30"/>
<ref-count count="56"/>
<page-count count="15"/>
<word-count count="10626"/>
</counts>
<custom-meta-group>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>AI in Finance</meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<label>1</label>
<title>Introduction</title>
<p>Deep neural networks have revolutionized many fields, perhaps most notably in computer vision and natural language processing. Despite its extraordinary performance, the frequent lack of a deep model&#x00027;s explainability prevents it from being widely adopted in regulated fields such as Fintech. Practitioners in those fields are interested in not only the decisions given by the black-box model, but also the reasons behind the decisions. This is necessary for transparency of the factors impacting the decision, and explaining alternatives that may produce different outcomes.</p>
<p>Many methods have been developed to improve the transparency of black-box models. A number of works generate feature importance based on local approximations (<xref ref-type="bibr" rid="B41">Ribeiro et al., 2016</xref>), global approximations (<xref ref-type="bibr" rid="B19">Ibrahim et al., 2019</xref>), gradient attributions (<xref ref-type="bibr" rid="B45">Shrikumar et al., 2017</xref>; <xref ref-type="bibr" rid="B51">Sundararajan et al., 2017</xref>), and SHAP values (<xref ref-type="bibr" rid="B26">Lundberg and Lee, 2017</xref>). Other methods focus on interventions in causal regimes (<xref ref-type="bibr" rid="B24">Liu et al., 2024</xref>, <xref ref-type="bibr" rid="B25">2018</xref>) and the construction of additive models using neural networks (<xref ref-type="bibr" rid="B1">Agarwal et al., 2021</xref>; <xref ref-type="bibr" rid="B39">Radenovic et al., 2022</xref>; <xref ref-type="bibr" rid="B5">Chang et al., 2022</xref>; <xref ref-type="bibr" rid="B56">Zhang et al., 2024</xref>).</p>
<p>In this study, we focus on tabular counterfactual explanations (CEs), a <italic>post-hoc</italic> method that answers the question &#x0201C;What changes can be made to an input so that its output label changes to the target class?&#x0201D; Counterfactual explanations are often preferable to methods such as LIME or gradient-based attributions because they provide actionable and intuitive insights that align with how people naturally reason about decisions. Rather than assigning <italic>post-hoc</italic> importance scores to features, counterfactuals answer a concrete &#x0201C;what-if&#x0201D; question: what minimal change to the input would lead to a different outcome? This makes them especially suitable for high-stakes settings where explanations must support decision-making. By directly reflecting the model&#x00027;s decision boundary, counterfactual explanations are both faithful to the model and more interpretable for end users.</p>
<p>CEs aim to explain a classifier <italic>f</italic>:&#x0211D;<sup><italic>d</italic></sup> &#x02192; {0, 1} by generating a counterfactual sample <inline-formula><mml:math id="M1"><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>^</mml:mo></mml:mover></mml:math></inline-formula> such that the predicted label is flipped with minimal changes to the input as defined by a metric <italic>d</italic>(&#x000B7;, &#x000B7;). This can be characteristically formulated as</p>
<disp-formula id="EQ1"><mml:math id="M2"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">arg</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo class="qopname">min</mml:mo></mml:mrow><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">^</mml:mo></mml:mover></mml:mrow></mml:munder></mml:mstyle><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">^</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mtext>&#x02003;</mml:mtext><mml:mtext class="textrm" mathvariant="normal">subject to</mml:mtext><mml:mtext>&#x02003;</mml:mtext><mml:mi>f</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">^</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">target</mml:mtext></mml:mrow></mml:msub><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(1)</label></disp-formula>
<p><xref ref-type="bibr" rid="B54">Wachter et al. (2017</xref>) cast this framework into an optimization problem and directly back-propagate the gradients of the classifier and distance constraints into the feature space. This approach treats each feature as a continuous variable and thus does not directly apply to categorical features. Other methods explicitly deal with categorical features and generate counterfactual explanations using graphs (<xref ref-type="bibr" rid="B38">Poyiadzi et al., 2020</xref>), prototypes (<xref ref-type="bibr" rid="B53">Van Looveren and Klaise, 2021</xref>), multi-objective functions (<xref ref-type="bibr" rid="B6">Dandl et al., 2020</xref>), rule-based sets (<xref ref-type="bibr" rid="B14">Guidotti et al., 2018</xref>), point processes (<xref ref-type="bibr" rid="B29">Mothilal et al., 2020</xref>), and random forests (<xref ref-type="bibr" rid="B10">Fern&#x000E1;ndez et al., 2020</xref>).</p>
<p>Deep generative models, such as variational autoencoders (VAEs) (<xref ref-type="bibr" rid="B22">Kingma, 2013</xref>) and generative adversarial networks (GANs) (<xref ref-type="bibr" rid="B12">Goodfellow et al., 2020</xref>), also play an important role in counterfactual generation. Compared with optimization-based approaches, generative methods are often preferred due to their ability to produce more plausible counterfactuals and generate them efficiently at inference time. <xref ref-type="bibr" rid="B21">Joshi et al. (2019</xref>) and <xref ref-type="bibr" rid="B2">Antor&#x000E1;n et al. (2020</xref>) propose methods that search in the latent space of a VAE to generate counterfactuals. <xref ref-type="bibr" rid="B37">Pawelczyk et al. (2020</xref>) focus explicitly on tabular data and use conditional VAEs as the generator for a target class. Methods in this line of work build on VAE architectures and rely on an efficient searching algorithm. <xref ref-type="bibr" rid="B16">Guo et al. (2023b</xref>); <xref ref-type="bibr" rid="B49">Sumiya and Shouno (2024</xref>) leverage the amortized cost during the inference time to improve the efficiency. <xref ref-type="bibr" rid="B32">Nemirovsky et al. (2022</xref>) deploys a GAN-based framework to learn the residual between an input and its counterfactual for vision data. Furthermore, it has been empirically shown that diffusion models can achieve better generative capacity and more stable training in fields such as vision tasks <xref ref-type="bibr" rid="B17">Ho et al. (2020</xref>); <xref ref-type="bibr" rid="B47">Song et al. (2020</xref>); <xref ref-type="bibr" rid="B42">Rombach et al. (2022</xref>), language texts <xref ref-type="bibr" rid="B34">Nie et al. (2025</xref>), and tabular data <xref ref-type="bibr" rid="B35">Panagiotou et al. (2024</xref>).</p>
<p>Instead, like <xref ref-type="bibr" rid="B54">Wachter et al. (2017</xref>) we work directly in the feature space, but approach the problem from the perspective of diffusion modeling (<xref ref-type="bibr" rid="B17">Ho et al., 2020</xref>; <xref ref-type="bibr" rid="B47">Song et al., 2020</xref>). In the continuous image domain, <xref ref-type="bibr" rid="B7">Dhariwal and Nichol (2021</xref>) has introduced classifier guidance on the reverse process for continuous features such as image data, while <xref ref-type="bibr" rid="B3">Augustin et al. (2022</xref>) built upon this framework with a counterfactual constraint on the reverse process. The proposed methods generate high-fidelity counterfactual images for a vision classifier. Explainable diffusion models for categorical tabular data have received less consideration. While diffusion models have been extensively studied for categorical tabular data, e.g., <xref ref-type="bibr" rid="B18">Hoogeboom et al. (2021</xref>); <xref ref-type="bibr" rid="B50">Sun et al. (2022</xref>); <xref ref-type="bibr" rid="B8">Dieleman et al. (2022</xref>); <xref ref-type="bibr" rid="B23">Kotelnikov et al. (2023</xref>); <xref ref-type="bibr" rid="B40">Regol and Coates (2023</xref>), this line of work rarely intends to provide explanations for a classifier.</p>
<p>Two notable recent investigations in this area include (<xref ref-type="bibr" rid="B13">Gruver et al., 2024</xref>; <xref ref-type="bibr" rid="B44">Schiff et al., 2024</xref>). <xref ref-type="bibr" rid="B13">Gruver et al. (2024</xref>) focuses on controllable discrete diffusion models in protein design by introducing a learnable mapping function that projects a discrete vector onto a continuous representation. The resulting representation is treated as a continuous variable and is diffused through the Gaussian distribution. <xref ref-type="bibr" rid="B44">Schiff et al. (2024</xref>) also focuses on discrete data by treating a one-hot vector as continuous. Nevertheless, their works mainly focus on pure discrete data such as language texts. Direct adoption of a classifier for counterfactual explanations cannot be straightforwardly applied.</p>
<p>Despite the growing body of work on counterfactual explanations, existing approaches face several important limitations when applied to tabular data. Optimization-based methods often require solving a separate optimization problem for each input instance, which can be computationally expensive at inference time. Additionally, without strong constraints or priors, the resulting counterfactuals may sometimes deviate from the realistic data manifold. VAEs-based approaches often require a well-trained latent space and an additional search procedure, which can introduce instability, mode collapse, or misalignment between latent perturbations and interpretable feature-level changes. More recent diffusion-based methods demonstrate strong generative performance for tabular and discrete data, but have largely focused on data synthesis rather than explanation, and do not directly integrate a classifier for tabular counterfactual explanations. As a result, there remains a gap for methods that can generate faithful counterfactual explanations in heterogeneous tabular data while operating directly in the original feature space and remaining tightly coupled to the decision boundary of the target classifier. To this goal, we propose a novel tabular diffusion model for counterfactual explanations that leverages Gumbel-softmax re-parameterization (<xref ref-type="bibr" rid="B20">Jang et al., 2017</xref>). Gumbel-Softmax reparameterization is widely used to handle categorical variables in a differentiable manner, enabling gradient-based backpropagation. However, integrating Gumbel-Softmax into classifier-guided diffusion models remains challenging. Our contributions are threefold:</p>
<list list-type="order">
<list-item><p>Our method permits gradient backpropagation, and the resulting reverse process resembles the classifier guidance in the Gaussian case. It is easy to implement and efficient for counterfactual generation.</p></list-item>
<list-item><p>We study the effect of temperature &#x003C4; in the Gumbel-softmax distribution on our model and derive a tight bound between an introduced approximation. Our proposed method approximates the base model better as the temperature decreases.</p></list-item>
<list-item><p>We experiment on four large-scale tabular datasets. The results demonstrate that our method achieves competitive performance on popular metrics used to evaluate counterfactuals within the field.</p></list-item>
</list></sec>
<sec id="s2">
<label>2</label>
<title>Related work</title>
<p>To situate our method within technological developments, we first review machine learning works related to counterfactual explanations and recent advances in controllable diffusion models, highlighting some of the key differences and shortcomings our method seeks to address for tabular data.</p>
<sec>
<label>2.1</label>
<title>Counterfactual explanations</title>
<p>Following <xref ref-type="disp-formula" rid="EQ1">Equation 1</xref>, researchers have leveraged the auto-encoder architecture to construct a counterfactual explainer. <xref ref-type="bibr" rid="B21">Joshi et al. (2019</xref>) takes a learned auto-encoder and aims to find the latent vector of the counterfactual sample by back-propagating gradients from the classifier into the latent space. The distance constraint is applied in the feature space. <xref ref-type="bibr" rid="B2">Antor&#x000E1;n et al. (2020</xref>) takes a similar approach but uses Bayesian Neural Networks to estimate the uncertainty of the generated counterfactual. <xref ref-type="bibr" rid="B37">Pawelczyk et al. (2020</xref>) also works in the latent space but explicitly tackles a set of immutable features. The authors use the conditional HVAE (<xref ref-type="bibr" rid="B31">Nazabal et al., 2020</xref>) and condition on the immutable features while searching for the counterfactual is again completed in the latent space with validity and minimum changes constraints in the feature space. <xref ref-type="bibr" rid="B35">Panagiotou et al. (2024</xref>) relies on the VAE framework but leverages a transformer to encode and decode input samples. These methods work in the latent space, and once the latent vector is found, the counterfactual sample is generated from the pretrained decoder. The searching phase is often computationally expensive, as we illustrated in the experimental section. In addition, VAE-based methods often generate counterfactual samples through a black-box decoder, which might introduce another layer of uncertainty.</p>
<p>To mitigate the searching task, <xref ref-type="bibr" rid="B15">Guo et al. (2023a</xref>,<xref ref-type="bibr" rid="B16">b</xref>); <xref ref-type="bibr" rid="B55">Zhang et al. (2022</xref>) train the classifier and counterfactual generator simultaneously by supervising the latent space. Counterfactual samples can be generated by linear mapping (<xref ref-type="bibr" rid="B55">Zhang et al., 2022</xref>) and non-linear mapping (<xref ref-type="bibr" rid="B15">Guo et al., 2023a</xref>,<xref ref-type="bibr" rid="B16">b</xref>) in the latent space, which effectively reduces the computational cost. <xref ref-type="bibr" rid="B49">Sumiya and Shouno (2024</xref>) replace the counterfactual generator with an invertible flow model with validity and proximity constraints. Although efficient, such explainers are model-dependent, and the uncertainty of the decoder still exists. In contrast, our approach will be model-agnostic, which only requires differentiability and directly operates in the feature space.</p>
<p>On the other hand, <xref ref-type="bibr" rid="B54">Wachter et al. (2017</xref>) directly works in the feature space. The proposed method back-propagates the gradients that lead to the target class label with minimum changes in the feature space. Through this back-propagation, it becomes easier to handle immutable features, which simply mask the corresponding gradients. Similar to this approach, <xref ref-type="bibr" rid="B43">Sanderson et al. (2025</xref>) enhances the searching algorithm by including additional losses such as sparsity, proximity, plausibility, and diversity. <xref ref-type="bibr" rid="B52">Tsiourvas et al. (2024</xref>) solves mixed-integer optimization with searching in the live polytopes to reduce the computational cost. However, the study only focuses on the ReLU-based model, whereas our model has no such constraint. (<xref ref-type="bibr" rid="B9">Duell et al. 2024</xref>) only includes the proximity constraint but introduces the uncertainty minimizer to reduce the randomness of the counterfactual path. Though effective, it is still hard to handle categorical features in this setting. In addition, it has been shown that a single pixel can fool a well-trained classifier (<xref ref-type="bibr" rid="B48">Su et al., 2019</xref>). Thus, although the resulting counterfactual sample might be valid (i.e., changed its label), it may not provide meaningful human-actionable information or insight into the learned deep neural network.</p>
<p>Another method called FACE (<xref ref-type="bibr" rid="B38">Poyiadzi et al., 2020</xref>) also works in the feature space. Here, a graph is first constructed based on the existing dataset. A graph search algorithm is then performed until it finds the counterfactual sample with the target label and minimum changes. If immutable features are present, a sub-graph is selected from the original graph. Though intuitive, the counterfactual samples are only selected from the existing dataset, which limits the diversity of the generated samples. Depending on the size of the dataset, the proposed method might also suffer from an instability issue. The computational cost is also high for a large dataset.</p>
</sec>
<sec>
<label>2.2</label>
<title>Guided diffusion models</title>
<p>Diffusion models have demonstrated much generative power for image generation (<xref ref-type="bibr" rid="B47">Song et al., 2020</xref>; <xref ref-type="bibr" rid="B17">Ho et al., 2020</xref>) and tabular data generation (<xref ref-type="bibr" rid="B23">Kotelnikov et al., 2023</xref>). However, counterfactual explanations through diffusion models are still rapidly developing. Guided diffusion models have been extensively studied (<xref ref-type="bibr" rid="B7">Dhariwal and Nichol, 2021</xref>) and extended (<xref ref-type="bibr" rid="B3">Augustin et al., 2022</xref>; <xref ref-type="bibr" rid="B30">Na and Lee, 2025</xref>) for counterfactual generation in the continuous domain. In this study, we employ these developments for tabular data, but challenges remain for extending to categorical features. Guided diffusion works because it operates in continuous spaces, where gradients can be calculated. However, this is infeasible in discrete spaces. <xref ref-type="bibr" rid="B27">Madaan and Bedathur (2024</xref>) attempted to solve this issue by using a look-up dictionary as the encoder and decoder. Nevertheless, the look-up dictionary introduces additional learning parameters and requires discretizations as diffusion models operate in continuous space. <xref ref-type="bibr" rid="B11">Galwaduge and Samarabandu (2025</xref>) involves training a classifier that can classify the noisy samples during the reverse process and primarily focuses on the intrusion detection task. Our method only requires a differentiable classifier that classifies an unperturbed sample.</p>
<p>Recently, <xref ref-type="bibr" rid="B13">Gruver et al. (2024</xref>) has developed a controllable diffusion pipeline for protein generation, which is purely categorical data, using a continuous function mapping. <xref ref-type="bibr" rid="B44">Schiff et al. (2024</xref>) also worked on categorical language data, by directly treating the categorical vector as if it were a continuous vector. Both of these recent works have demonstrated their efficacy for their related tasks. While in this line of work, our study is distinct in two ways: (1) We propose a new approach to handling categorical data in controllable diffusion models that requires minimal modification to the existing tabular diffusion frameworks, and (2) We handle both continuous and categorical data simultaneously with the aim of explainable classification, whereas these two studies do not involve a classification problem.</p>
</sec>
</sec>
<sec id="s3">
<label>3</label>
<title>Background on diffusion models</title>
<sec>
<label>3.1</label>
<title>Tabular diffusion models</title>
<p>Diffusion models have been extensively studied recently as a powerful generative model for high fidelity images (<xref ref-type="bibr" rid="B46">Sohl-Dickstein et al., 2015</xref>; <xref ref-type="bibr" rid="B17">Ho et al., 2020</xref>; <xref ref-type="bibr" rid="B33">Nichol and Dhariwal, 2021</xref>; <xref ref-type="bibr" rid="B47">Song et al., 2020</xref>). A typical diffusion model consists of a forward and reverse Markov process. The forward process injects Gaussian noise to the input along a sequence of time steps, terminating at a prior, typically isotropic Gaussian distribution. The Markovian assumption factorizes the forward process as <inline-formula><mml:math id="M3"><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>:</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msubsup><mml:mrow><mml:mo>&#x0220F;</mml:mo></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. The reverse process aims to gradually denoise from the prior <italic>x</italic><sub><italic>T</italic></sub>&#x0007E;<italic>q</italic>(<italic>x</italic><sub><italic>T</italic></sub>) to generate a new sample through <inline-formula><mml:math id="M4"><mml:mi>p</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn><mml:mo>:</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msubsup><mml:mrow><mml:mo>&#x0220F;</mml:mo></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. Although the Gaussian forward process can be derived in closed form, the reverse process <italic>p</italic>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>) is intractable and requires a neural network to approximate. The parameters of the denoising neural network can be learned by maximizing the evidence lower bound,</p>
<disp-formula id="E2"><mml:math id="M5"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">log</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mo>&#x02265;</mml:mo><mml:msub><mml:mrow><mml:mi>E</mml:mi></mml:mrow><mml:mrow><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:msub><mml:mstyle mathsize="1.61em"><mml:mrow><mml:mo>(</mml:mo></mml:mrow></mml:mstyle><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mstyle displaystyle="true"><mml:munder accentunder="false"><mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo>&#x0FE38;</mml:mo></mml:munder></mml:mstyle></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:munder></mml:mstyle><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mstyle displaystyle="true"><mml:munder accentunder="false"><mml:mrow><mml:mtext class="textrm" mathvariant="normal">KL</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo>&#x0FE38;</mml:mo></mml:munder></mml:mstyle></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="EQ3"><mml:math id="M6"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>2</mml:mn></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mstyle displaystyle="true"><mml:munder accentunder="false"><mml:mrow><mml:mtext class="textrm" mathvariant="normal">KL</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo>&#x0FE38;</mml:mo></mml:munder></mml:mstyle></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder></mml:mstyle><mml:mstyle mathsize="1.61em"><mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(2)</label></disp-formula>
<p>The key distinction of tabular diffusion models is that there are two independent processes: Gaussian diffusion models for continuous features and Multinomial diffusion models for categorical features (<xref ref-type="bibr" rid="B23">Kotelnikov et al., 2023</xref>).</p>
<sec>
<label>3.1.1</label>
<title>Continuous diffusions</title>
<p>Let <inline-formula><mml:math id="M7"><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02208;</mml:mo><mml:msup><mml:mrow><mml:mi>&#x0211D;</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> and &#x003B1;<sub><italic>t</italic></sub> &#x0003D; 1&#x02212;&#x003B2;<sub><italic>t</italic></sub> where <italic>t</italic>&#x02208;[1, <italic>T</italic>] is the time step. The forward process follows the distribution</p>
<disp-formula id="EQ4"><mml:math id="M8"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mrow><mml:mi mathvariant="script">N</mml:mi></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msqrt><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msqrt><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mi>I</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(3)</label></disp-formula>
<p>Given <italic>x</italic><sub>0</sub>, the marginal distribution of <italic>x</italic><sub><italic>t</italic></sub> for any <italic>t</italic> is <inline-formula><mml:math id="M9"><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mrow><mml:mi mathvariant="script">N</mml:mi></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msqrt><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msqrt><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msqrt><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msqrt><mml:mi>I</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> where <inline-formula><mml:math id="M10"><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mrow><mml:mo>&#x0220F;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. This allows direct generation of the noisy <italic>x</italic><sub><italic>t</italic></sub>. The reverse process approximates the true posterior <italic>q</italic>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>, <italic>x</italic><sub>0</sub>) with <italic>q</italic><sub>&#x003B8;</sub>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>). By Bayes&#x00027; rule, <italic>q</italic>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>, <italic>x</italic><sub>0</sub>) can be computed in closed form and is Gaussian. Therefore, <italic>q</italic><sub>&#x003B8;</sub>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>) is usually chosen to be a neural network-parameterized Gaussian, <inline-formula><mml:math id="M11"><mml:msub><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mrow><mml:mi mathvariant="script">N</mml:mi></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003BC;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003A3;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. Alternatively, <xref ref-type="bibr" rid="B17">Ho et al. (2020</xref>) found that, instead of directly producing the mean of the posterior Gaussian distribution, more favorable results can be found by predicting the noise at each time step:</p>
<disp-formula id="EQ5"><mml:math id="M12"><mml:mrow><mml:msub><mml:mi>&#x02112;</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant='double-struck'>E</mml:mi><mml:mrow><mml:mi>&#x003F5;</mml:mi><mml:mo>~</mml:mo><mml:mi mathvariant='script'>N</mml:mi><mml:mo stretchy='false'>(</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mi>I</mml:mi><mml:mo stretchy='false'>)</mml:mo></mml:mrow></mml:msub><mml:mo>&#x02016;</mml:mo><mml:msub><mml:mi>&#x003F5;</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>&#x003F5;</mml:mi><mml:mi>&#x003B8;</mml:mi></mml:msub><mml:mo stretchy='false'>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo stretchy='false'>)</mml:mo><mml:mo stretchy='false'>)</mml:mo><mml:msup><mml:mo>&#x02016;</mml:mo><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math><label>(4)</label></disp-formula>
<p>where &#x003F5;<sub>&#x003B8;</sub> is a neural network. Once trained, the mean of the posterior can be derived as</p>
<disp-formula id="EQ6"><mml:math id="M13"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>&#x003BC;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msqrt><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msqrt></mml:mrow></mml:mfrac><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msqrt><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msqrt></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>&#x003F5;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(5)</label></disp-formula>
<p>which gradually denoises <italic>x</italic><sub><italic>t</italic></sub>. Furthermore, <xref ref-type="bibr" rid="B17">Ho et al. (2020</xref>) constructs the generative process using stochastic Langevin dynamics, which introduce randomness during the sampling process. We use the same dynamics, except for the final step, which produces actual samples.</p></sec>
<sec>
<label>3.1.2</label>
<title>Categorical diffusions</title>
<p>Multinomial diffusion models adapt the framework to handle categorical data (<xref ref-type="bibr" rid="B18">Hoogeboom et al., 2021</xref>). Let <italic>x</italic><sub><italic>t</italic></sub> be a <italic>K</italic>-dimensional one-hot vector. The forward process now becomes</p>
<disp-formula id="EQ7"><mml:math id="M14"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mtext class="textrm" mathvariant="normal">Cat</mml:mtext><mml:mstyle mathsize="1.19em"><mml:mrow><mml:mo>(</mml:mo></mml:mrow></mml:mstyle><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>K</mml:mi><mml:mstyle mathsize="1.19em"><mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(6)</label></disp-formula>
<p>When <italic>T</italic> is large enough, the resulting <italic>x</italic><sub><italic>T</italic></sub>&#x0007E;Cat(<italic>x</italic><sub><italic>T</italic></sub>|1/<italic>K</italic>). Similar to the continuous case, <italic>x</italic><sub><italic>t</italic></sub> can be computed as <inline-formula><mml:math id="M15"><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">Cat</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mi>K</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. The posterior of the reverse process can be derived using Bayes&#x00027; rule,</p>
<disp-formula id="EQ8"><mml:math id="M16"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mtext class="textrm" mathvariant="normal">Cat</mml:mtext><mml:mstyle mathsize="1.61em"><mml:mrow><mml:mo>(</mml:mo></mml:mrow></mml:mstyle><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mi>&#x003C0;</mml:mi><mml:mo>/</mml:mo><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mstyle mathsize="1.61em"><mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(7)</label></disp-formula>
<p>where <inline-formula><mml:math id="M17"><mml:mi>&#x003C0;</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mi>K</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>&#x02299;</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mi>K</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>. The loss <inline-formula><mml:math id="M18"><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> in the categorical case is the KL divergence KL(<italic>q</italic>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>, <italic>x</italic><sub>0</sub>)||<italic>p</italic><sub>&#x003B8;</sub>(<italic>x</italic><sub><italic>t</italic>&#x02212;1</sub>|<italic>x</italic><sub><italic>t</italic></sub>)) where the neural network outputs the predicted <inline-formula><mml:math id="M19"><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> directly from the noisy input <italic>x</italic><sub><italic>t</italic></sub>.</p>
</sec>
</sec>
<sec>
<label>3.2</label>
<title>Classifier guidance</title>
<p>Controllable reverse processes have been explored to generate class-dependent samples (<xref ref-type="bibr" rid="B33">Nichol and Dhariwal, 2021</xref>). In classifier-free guidance, the target class label <italic>y</italic> is embedded into the denoising neural network, generating class-dependent predicted noise. No classifier exists to be explained or generate counterfactuals for, and so these techniques are outside the scope of this study.</p>
<p>In classifier guidance methods, a differentiable classifier <italic>p</italic><sub>&#x003D5;</sub>(<italic>y</italic>|<italic>x</italic>) is trained on the input space, and a guided reverse process is formulated as</p>
<disp-formula id="EQ9"><mml:math id="M20"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>Z</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(8)</label></disp-formula>
<p>where <italic>f</italic><sub><italic>dn</italic></sub> reconstructs the noise-free sample. A first-order Taylor expansion around the mean &#x003BC; gives the approximation</p>
<disp-formula id="EQ10"><mml:math id="M21"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>Z</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mrow><mml:mi mathvariant="script">N</mml:mi></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x003BC;</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003A3;</mml:mi><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x003A3;</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(9)</label></disp-formula>
<p>where <italic>g</italic> &#x0003D; &#x02207;<sub><italic>x</italic><sub><italic>t</italic></sub></sub>log<italic>p</italic><sub>&#x003D5;</sub>(<italic>y</italic>|<italic>f</italic><sub><italic>dn</italic></sub>(<italic>x</italic><sub><italic>t</italic></sub>))|<sub><italic>x</italic><sub><italic>t</italic></sub> &#x0003D; &#x003BC;</sub>. We see that the reverse process uses gradient information from the target class in the generative process.</p>
<p>However, in the categorical setting, a combinatorial challenge arises when calculating gradients, resulting in <inline-formula><mml:math id="M22"><mml:mrow><mml:mi mathvariant="script">O</mml:mi></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mo>&#x0220F;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> forward passes from the classifier, where <italic>K</italic><sub><italic>i</italic></sub> is the number of options for the <italic>i</italic>-th categorical variable. This is infeasible when the number of categorical variables becomes large. This challenge motivates our following use of Gumbel-softmax reparameterization, resulting in a reverse process similar to that of the continuous case.</p>
</sec>
</sec>
<sec id="s4">
<label>4</label>
<title>Categorical tabular diffusions for counterfactual explanations</title>
<p>We propose a novel method to generate counterfactual explanations for any differentiable classifier, with particular interest in the categorical data scenario. We adopt the Gumbel-softmax re-parameterization (<xref ref-type="bibr" rid="B20">Jang et al., 2017</xref>) transform to provide a continuous representation of discrete data. This allows the model to leverage the gradients from the differentiable classifier on all the categorical variables and produce counterfactual information. The pipeline of our method is shown in <xref ref-type="fig" rid="F1">Figure 1</xref>.</p>
<fig position="float" id="F1">
<label>Figure 1</label>
<caption><p>The pipeline of Tabular Diffusion Counterfactual Explanations (TDCE). The categorical variables in the one-hot vector are first re-parameterized. Then, the q sampling generates the noisy version of the input sample. The denoising module runs T steps with the gradient from the classifier to generate the counterfactual sample.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frai-09-1743495-g0001.tif">
<alt-text content-type="machine-generated">Flowchart depicting a data processing pipeline for generating counterfactuals. Numerical input \(X_{\text{num}}\) undergoes normalization. Categorical inputs \(X_{\text{cat1}}\) and \(X_{\text{cat2}}\) use Gumbel-softmax reparameterization. Outputs feed into \(q\) sampling, producing \(X_{\text{in}}\). This input enters a system combining U-Net \(t\) and function \(f\), with results indicated by gradient \( \nabla f \). The process iterates over time \(T\) to produce counterfactual \(X_{\text{cf}}\).</alt-text>
</graphic>
</fig>
<sec>
<label>4.1</label>
<title>Tabular counterfactual generation</title>
<p>We break a data point <italic>x</italic> into its continuous and categorical portions, <italic>x</italic><sup>num</sup> and <italic>x</italic><sup>cat</sup>, respectively.</p>
<sec>
<label>4.1.1</label>
<title>Continuous features</title>
<p>Here, we follow the adaptive parameterization (<xref ref-type="bibr" rid="B3">Augustin et al., 2022</xref>) to implement the guided reverse process. The mean transition of <xref ref-type="disp-formula" rid="EQ9">Equation 9</xref> now becomes</p>
<disp-formula id="EQ11"><mml:math id="M23"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>&#x003BC;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">num</mml:mtext></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003A3;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">num</mml:mtext></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003BC;</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">num</mml:mtext></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">guided</mml:mtext></mml:mrow></mml:msub></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(10)</label></disp-formula>
<disp-formula id="E12"><mml:math id="M24"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">guided</mml:mtext></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mo>&#x02207;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mo>&#x02207;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo></mml:mrow></mml:mfrac><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mo>&#x02207;</mml:mo><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mo>&#x02207;</mml:mo><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:math></disp-formula>
<p>is the normalized gradient from the classifier and the normalized distance constraint.</p>
<p>Intuitively, each original denoising step is guided by the classifier&#x00027;s gradients multiplied by the covariance of the denoising step and the magnitude of the unguided mean vector. This process takes the classifier&#x00027;s impact into account and generates high-quality data not only around a dataset&#x00027;s manifold but also in the cluster of the target class. The proposed counterfactual changes should be minimal compared with the initial sample.</p></sec>
<sec>
<label>4.1.2</label>
<title>Categorical features</title>
<p>Working with <xref ref-type="disp-formula" rid="EQ8">Equation 8</xref>,</p>
<disp-formula id="EQ13"><mml:math id="M25"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:mo class="qopname">log</mml:mo><mml:mi>Z</mml:mi><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(11)</label></disp-formula>
<p>we observe that the adaptive parameterization approach cannot be straightforwardly applied because the gradient cannot be back-propagated to the discrete one-hot vector space. To guide the reverse process in discrete data scenarios, all combinations must be exhausted, which is infeasible and motivated recent developments (<xref ref-type="bibr" rid="B44">Schiff et al., 2024</xref>).</p>
<p>In this study, we approach this problem through the Gumbel-softmax re-parameterization; instead of working in the discrete space, we propose to use the Gumbel-softmax vector to softly approximate the discrete data.</p>
</sec>
</sec>
<sec>
<label>4.2</label>
<title>Relaxation of categorical variables</title>
<p>At each time step, a categorical variable is modeled as <inline-formula><mml:math id="M26"><mml:msup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">cat</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mo>&#x0007E;</mml:mo><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">Cat</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">cat</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mo>|</mml:mo><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> where <inline-formula><mml:math id="M27"><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover><mml:mo>&#x02208;</mml:mo><mml:msup><mml:mrow><mml:mi>&#x00394;</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> is a normalized non-negative vector. A one-hot vector can be constructed as <inline-formula><mml:math id="M28"><mml:msup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">cat</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">onehot</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mo class="qopname">argmax</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>, where <italic>g</italic><sub><italic>i</italic></sub>&#x0007E;Gumbel(0, 1). Following <xref ref-type="bibr" rid="B20">Jang et al. (2017</xref>), and re-parameterize this as</p>
<disp-formula id="EQ14"><mml:math id="M29"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msubsup><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cat</mml:mtext></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mo class="qopname">exp</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mo class="qopname">exp</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(12)</label></disp-formula>
<p>at each time step of the reverse process, where &#x003C4;&#x02265;0 is the temperature. As is evident, as &#x003C4; &#x02192; 0, <inline-formula><mml:math id="M30"><mml:msubsup><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">cat</mml:mtext></mml:mstyle></mml:mrow></mml:msubsup></mml:math></inline-formula> reduces to a one-hot vector. Using this continuous transformation, the log<italic>p</italic><sub>&#x003B8;</sub>(<italic>x</italic><sub><italic>t</italic></sub>|<italic>x</italic><sub><italic>t</italic>&#x0002B;1</sub>) term in <xref ref-type="disp-formula" rid="EQ11">Equation 11</xref> can be modeled with a Gumbel-softmax vector. The density of Gumbel-softmax (GS) (<xref ref-type="bibr" rid="B20">Jang et al., 2017</xref>; <xref ref-type="bibr" rid="B28">Maddison et al., 2016</xref>) is</p>
<disp-formula id="EQ15"><mml:math id="M31"><mml:msub><mml:mi>p</mml:mi><mml:mrow><mml:mi>G</mml:mi><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mover accent='true'><mml:mi>x</mml:mi><mml:mo>&#x002DC;</mml:mo></mml:mover><mml:mrow><mml:mn>1</mml:mn><mml:mo>:</mml:mo><mml:mi>K</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0007C;</mml:mo><mml:mover accent='true'><mml:mi>&#x003C0;</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mi>&#x003C4;</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x00393;</mml:mi><mml:mo stretchy='false'>(</mml:mo><mml:mi>K</mml:mi><mml:mo stretchy='false'>)</mml:mo><mml:msup><mml:mi>&#x003C4;</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mstyle displaystyle='true'><mml:munderover><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>K</mml:mi></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mover accent='true'><mml:mi>&#x003C0;</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mover accent='true'><mml:mi>x</mml:mi><mml:mo>&#x002DC;</mml:mo></mml:mover></mml:mfrac></mml:mrow></mml:mstyle></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>&#x02212;</mml:mo><mml:mi>K</mml:mi></mml:mrow></mml:msup><mml:mstyle displaystyle='true'><mml:munderover><mml:mo>&#x0220F;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>K</mml:mi></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mover accent='true'><mml:mi>&#x003C0;</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msubsup><mml:mover accent='true'><mml:mi>x</mml:mi><mml:mo>&#x002DC;</mml:mo></mml:mover><mml:mi>i</mml:mi><mml:mrow><mml:mi>&#x003C4;</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:mfrac></mml:mrow></mml:mstyle><mml:mo>.</mml:mo></mml:math><label>(13)</label></disp-formula>
<p>Using <xref ref-type="disp-formula" rid="EQ29">Equation 12</xref>, we switch from the discrete one-hot representation to the continuous softmax representation. In the forward and backward process, the transitions are</p>
<disp-formula id="EQ16"><mml:math id="M32"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mtext class="textrm" mathvariant="normal">GS</mml:mtext><mml:mstyle mathsize="1.19em"><mml:mrow><mml:mo>(</mml:mo></mml:mrow></mml:mstyle><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>K</mml:mi><mml:mstyle mathsize="1.19em"><mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="EQ17"><mml:math id="M33"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>q</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0007E;</mml:mo><mml:mtext class="textrm" mathvariant="normal">GS</mml:mtext><mml:mstyle mathsize="1.19em"><mml:mrow><mml:mo>(</mml:mo></mml:mrow></mml:mstyle><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mover accent="false"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover><mml:mo>/</mml:mo><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mstyle mathsize="1.19em"><mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(14)</label></disp-formula>
<p>where <inline-formula><mml:math id="M34"><mml:mover accent="false"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mi>K</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>&#x02299;</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mi>K</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>. The final categorical sample can be obtained by <inline-formula><mml:math id="M35"><mml:msup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">cat</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">onehot</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mo class="qopname">argmax</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. <xref ref-type="disp-formula" rid="EQ11">Equation 11</xref> in the Gumbel-softmax space reflects this change straightforwardly,</p>
<disp-formula id="EQ18"><mml:math id="M36"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(15)</label></disp-formula>
<p>The reverse process <inline-formula><mml:math id="M37"><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> is a parameterized neural network. A challenge arises while solving the guided process with the Gumbel-softmax distribution, not faced by Gaussian diffusions, because the Gaussian model mathematically accommodates a first-order Taylor approximation of the classifier well. The Gumbel-softmax distribution in <xref ref-type="disp-formula" rid="EQ13">Equation 13</xref> proposed by <xref ref-type="bibr" rid="B20">Jang et al. (2017</xref>) cannot be directly applied in <xref ref-type="disp-formula" rid="EQ11">Equation 11</xref> and leverage Taylor expansion to derive as it is for the Gaussian case in <xref ref-type="disp-formula" rid="EQ9">Equation 9</xref>. This stops from direct adoption of Gumbel-softmax reparameterization in controlled Gaussian diffusion models. Therefore, for the Gumbel-softmax we approximate the log density <inline-formula><mml:math id="M38"><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> as</p>
<disp-formula id="EQ19"><mml:math id="M39"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x02248;</mml:mo><mml:msubsup><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mo>&#x022A4;</mml:mo></mml:mrow></mml:msubsup><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(16)</label></disp-formula>
<p>We evaluate this approximation in Section 4.3 in terms of a KL divergence bound between the Gumbel-softmax distribution and <xref ref-type="disp-formula" rid="EQ19">Equation 16</xref>.</p>
<p>Next, we take the first order of Taylor expansion for the classifier around <inline-formula><mml:math id="M40"><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, leading to</p>
<disp-formula id="EQ20"><mml:math id="M41"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x02248;</mml:mo><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mo>&#x022A4;</mml:mo></mml:mrow></mml:msup><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(17)</label></disp-formula>
<p>where <inline-formula><mml:math id="M42"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x02207;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>y</mml:mi><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula>. Replacing <xref ref-type="disp-formula" rid="EQ19">Equations 16</xref>, <xref ref-type="disp-formula" rid="EQ17">17</xref> in <xref ref-type="disp-formula" rid="EQ15">Equation 15</xref>, the guided reverse process becomes</p>
<disp-formula id="EQ21"><mml:math id="M43"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x003D5;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x02248;</mml:mo><mml:msubsup><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mo>&#x022A4;</mml:mo></mml:mrow></mml:msubsup><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003BB;</mml:mi><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(18)</label></disp-formula>
<p>where &#x003BB; is a regularization hyperparameter. The familiar expression that results has a similar interpretation to the continuous case. We illustrate the reverse process dynamics of our approach in <xref ref-type="fig" rid="F2">Figure 2</xref>.</p>
<fig position="float" id="F2">
<label>Figure 2</label>
<caption><p>A simulation of diffusions for the Gumbel-softmax vector over a single categorical variable with three classes. Each blue dot is a data point. <bold>Top</bold>: The reverse diffusion process for the Gumbel-softmax vector on a 3D simplex <italic>without</italic> classifier guidance. <bold>Bottom</bold>: The reverse diffusion process <italic>with</italic> classifier guidance.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frai-09-1743495-g0002.tif">
<alt-text content-type="machine-generated">Sequence of eleven triangular plots showing data points in blue, decreasing in density from left to right. Each triangle is labeled with decreasing time intervals, starting from t=1000 to t=100.</alt-text>
</graphic>
</fig>
</sec>
<sec>
<label>4.3</label>
<title>Closeness of the approximation</title>
<p>At each reverse time step, the log density <inline-formula><mml:math id="M44"><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> follows the Gumbel-softmax distribution <inline-formula><mml:math id="M45"><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>G</mml:mi><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. We model the log density as</p>
<disp-formula id="EQ22"><mml:math id="M46"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x0220F;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:msubsup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msubsup></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(19)</label></disp-formula>
<p>where <inline-formula><mml:math id="M47"><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> is the normalizing constant and <inline-formula><mml:math id="M48"><mml:msub><mml:mrow><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mo>&#x000B7;</mml:mo></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> is the probability estimator parameterized by a diffusion network.</p>
<p>Theorem 4.1. Let <inline-formula><mml:math id="M49"><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mi>&#x003C0;</mml:mi><mml:mo>&#x02208;</mml:mo><mml:msup><mml:mrow><mml:mi>&#x00394;</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> and the temperature &#x003C4;&#x02208;&#x0211D;<sup>&#x0002B;</sup>. Define <inline-formula><mml:math id="M50"><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> the minimum value <inline-formula><mml:math id="M51"><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>&#x0007E;</mml:mo></mml:mover></mml:math></inline-formula> can take. The KL divergence between <italic>p</italic><sub><italic>GS</italic></sub> defined in <xref ref-type="disp-formula" rid="EQ13">Equation 13</xref> and its approximation <italic>p</italic><sub>&#x003B8;</sub> in <xref ref-type="disp-formula" rid="EQ19">Equation 19</xref> is bounded as follows:</p>
<disp-formula id="E23"><mml:math id="M52"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">KL</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>G</mml:mi><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0003C;</mml:mo><mml:mo>-</mml:mo><mml:mi>K</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x003C4;</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mi>&#x003C4;</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:mi>&#x00393;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>K</mml:mi><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>!</mml:mo></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">KL</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>G</mml:mi><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0003E;</mml:mo><mml:mi>K</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x003C4;</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mi>&#x003C4;</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo class="qopname">&#x0007E;</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x0002B;</mml:mo><mml:mo class="qopname">log</mml:mo><mml:mi>&#x00393;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>K</mml:mi><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>/</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>!</mml:mo></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Proof: See the <xref ref-type="supplementary-material" rid="SM1">Supplementary material</xref>.</p>
<p>An empirical example of the bound is shown in <xref ref-type="fig" rid="F3">Figure 3</xref>. The benefits of our proposed approximation are:</p>
<list list-type="simple">
<list-item><p>1) It allows us to use the first-order Taylor expansion, resulting in a closed-form update at each time step for the reverse process. This update directs the unguided logits with the gradient of the classifier toward the target class, which is intuitive and similar to the Gaussian case.</p></list-item>
<list-item><p>2) The Taylor expansion, which is also applied to the Gaussian case, requires no additional step for guided categorical variables. The gradient can be calculated concurrently with the Gaussian case over any continuous variables in the data, which significantly reduces computational complexity.</p></list-item>
</list>
<fig position="float" id="F3">
<label>Figure 3</label>
<caption><p>KL divergence between the Gumbel-softmax distribution and our approximation on simulated data as a function of temperature &#x003C4;. The KL divergence increases as the &#x003C4; grows, as do the bounds.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frai-09-1743495-g0003.tif">
<alt-text content-type="machine-generated">Two line graphs compare KL Divergence versus Tau for different K values. The left graph with K equals 3 shows a steady increase in KL Divergence up to 10. The right graph with K equals 5 shows a sharp initial rise, followed by fluctuations, reaching over 400. Both include shaded areas representing the range.</alt-text>
</graphic>
</fig>
<p>Although a lower temperature leads to a better approximation, it also introduces a larger variance and may result in vanishing gradient issues. As &#x003C4; &#x02192; 0, the soft representation approaches a one-hot vector, which may prevent the backwards flow of the gradients through the softmax function. A lower temperature can also introduce significant variance in the estimated gradients. To see this, let <italic>Y</italic><sub><italic>i</italic></sub> &#x0003D; softmax((<italic>z</italic><sub><italic>i</italic></sub>&#x0002B;<italic>g</italic><sub><italic>i</italic></sub>)/&#x003C4;) where <italic>g</italic><sub><italic>i</italic></sub> is the Gumbel noise. The partial derivative <inline-formula><mml:math id="M53"><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>Y</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>Y</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>Y</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>, which is bounded above by <inline-formula><mml:math id="M54"><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>4</mml:mn><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac></mml:math></inline-formula>, and so <inline-formula><mml:math id="M55"><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">Var</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>Y</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x02264;</mml:mo><mml:mi>E</mml:mi><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>Y</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>&#x0003C;</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>16</mml:mn><mml:msup><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:math></inline-formula>. For the lower bound, the integral over the Gumbel noise is required, which is complicated. However, we know that <inline-formula><mml:math id="M56"><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>Y</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02265;</mml:mo><mml:mfrac><mml:mrow><mml:mi>B</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac></mml:math></inline-formula> for some constant <italic>B</italic>, meaning both bounds of the variance indicate that it becomes larger as the temperature decreases. In implementation, we therefore start with a warmer temperature and gradually decrease to a smaller value away from zero.</p>
</sec>
<sec>
<label>4.4</label>
<title>Immutable features</title>
<p>Immutable features are those that are predefined as unchangeable by the source of a datum, e.g., a location. When generating counterfactuals, these cannot be changed. One simple approach is to define a binary mask <italic>m</italic> indicating which features can change, and produce the counterfactual <italic>x</italic><sub><italic>t</italic></sub>&#x0002A;<italic>m</italic>&#x0002B;<italic>x</italic>&#x0002A;(1&#x02212;<italic>m</italic>). The main issue here is with the so-called coherence (<xref ref-type="bibr" rid="B4">Avrahami et al., 2022</xref>), yielding samples that fall outside the data manifold.</p>
<p>Motivated by the blended diffusions of vision tasks (<xref ref-type="bibr" rid="B4">Avrahami et al., 2022</xref>), we combine the noisy version of the immutable features from the input with the guided mutable features according to <italic>x</italic><sub><italic>t</italic>, guided</sub>&#x0002A;<italic>m</italic>&#x0002B;<italic>x</italic><sub><italic>t</italic>, noisy</sub>&#x0002A;(1&#x02212;<italic>m</italic>) where <italic>x</italic><sub><italic>t</italic>, noisy</sub> is obtained from the forward process. At the final step, the immutable features are replaced by the original input. Our algorithm is shown in <xref ref-type="statement" rid="algo1">Algorithm 1</xref>.</p>
<statement content-type="algorithm" id="algo1">
<label>Algorithm 1</label>
<title>Tabular diffusion counterfactual explanations</title>
<p>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frai-09-1743495-i0001.tif"/>
</p>
</statement>
</sec>
</sec>
<sec id="s5">
<label>5</label>
<title>Experiments</title>
<p>We compare our method with other popular methods for generating counterfactual explanations. The classifier <italic>f</italic> to be explained shares the same architecture as the U-net in the diffusion model, and the last layer outputs two-dimensional logits for binary classification. The U-net classifier is trained independently from our counterfactual generator. Our method is applicable to any differentiable black-box classifier where gradients are readily available with respect to the input. We refer to our method as Tabular Diffusion Counterfactual Explanation (TDCE). We use the same U-net architecture as described in <xref ref-type="bibr" rid="B23">Kotelnikov et al. (2023</xref>) for denoising samples and follow the same training procedure. Once trained, we follow the <xref ref-type="statement" rid="algo1">Algorithm 1</xref> to generate a counterfactual sample for any differentiable black-box classifier.</p>
<sec>
<label>5.1</label>
<title>Datasets</title>
<p>We focus on tabular datasets, selecting popular and public datasets that consists of both numerical and categorical features. A description of data is shown in <xref ref-type="table" rid="T1">Table 1</xref>. Lending Club Dataset (LCD) and Give Me Some Credit (GMC) focus on credit lending decisions. &#x0201C;Adult&#x0201D; predicts binarized annual income based on a set of features. The LAW data predicts pass/fail on a law school test. For each dataset, we select 1,000 samples as the test data with an equal number of positive and negative samples. The balanced test dataset is preferred for fair comparisons under metrics such as interpretability score, where autoencoders are trained on positive and negative samples. In all the experiments, we perform standardization for each continuous feature and convert each categorical feature to a one-hot vector.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Statistics from the tabular data sets we use.</p></caption>
<table frame="box" rules="all">
<thead>
<tr>
<th valign="top" align="left"><bold>Dataset</bold></th>
<th valign="top" align="center"><bold>&#x00023;Train</bold></th>
<th valign="top" align="center"><bold>&#x00023;Val</bold></th>
<th valign="top" align="center"><bold>&#x00023;Test</bold></th>
<th valign="top" align="center"><bold>&#x00023;Num</bold></th>
<th valign="top" align="center"><bold>&#x00023;Cat</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">LCD</td>
<td valign="top" align="center">10,000</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">5</td>
<td valign="top" align="center">1</td>
</tr>
<tr>
<td valign="top" align="left">GMC</td>
<td valign="top" align="center">15,000</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">9</td>
<td valign="top" align="center">1</td>
</tr>
<tr>
<td valign="top" align="left">Adult</td>
<td valign="top" align="center">47,842</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">9</td>
<td valign="top" align="center">2</td>
</tr>
<tr>
<td valign="top" align="left">LAW</td>
<td valign="top" align="center">5,502</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">1,000</td>
<td valign="top" align="center">8</td>
<td valign="top" align="center">3</td>
</tr></tbody>
</table>
</table-wrap>
</sec>
<sec>
<label>5.2</label>
<title>Baselines and evaluation metrics</title>
<p>As a baseline, we compare with five methods for generating counterfactual explanations of a binary classifier. <xref ref-type="bibr" rid="B54">Wachter et al. (2017</xref>) presents the most straightforward baseline. They generate counterfactuals by following the gradients of a classifier from the input <italic>x</italic> to the decision boundary. Although it can generate a valid counterfactual sample with minimum distance, as we show in the next section, this simple and intuitive approach struggles to generate realistic counterfactuals. In addition, we also note that the L2 distance is dramatically increased as it searches for a more realistic counterfactual. We also benchmark against VAE-based methods designed to fix this, including Counterfactual Conditional Heterogeneous Autoencoder (CCHVAE) (<xref ref-type="bibr" rid="B37">Pawelczyk et al., 2020</xref>), Realistic, Explainable, and Interpretable Searched Explanations (REVISE) (<xref ref-type="bibr" rid="B21">Joshi et al., 2019</xref>), and Counterfactual Latent Uncertainty Explanations (CLUE) (<xref ref-type="bibr" rid="B2">Antor&#x000E1;n et al., 2020</xref>), as well as a method based on graph search called Feasible and Actionable Counterfactual Explanations (FACE) (<xref ref-type="bibr" rid="B38">Poyiadzi et al., 2020</xref>), the neural network based method CounterNet (<xref ref-type="bibr" rid="B16">Guo et al., 2023b</xref>) and flow-based method FastDCFlow (<xref ref-type="bibr" rid="B49">Sumiya and Shouno, 2024</xref>). We implement these benchmarks using the CARLA library (<xref ref-type="bibr" rid="B36">Pawelczyk et al., 2021</xref>) or the source code provided by the authors.</p>
<p>We evaluate these methods using several widely used metrics for counterfactual-based explainability: L2 distance, Interpretability, Diversity, Validity, Instability, and the JS divergence. Among these, Diversity, L2 distance, and Instability are restricted to continuous features, while JS divergence applies only to categorical features. There is no global metric that quantifies counterfactual performance, and so the set of metrics described below combines to paint a subjective picture for evaluation.</p>
<sec>
<label>5.2.1</label>
<title>L2 distance</title>
<p>Counterfactual samples aim to have turned their label to the target class with the minimum changes in the feature space. This is the key standard of counterfactual generation described in <xref ref-type="disp-formula" rid="EQ1">Equation 1</xref> and can be quantified using L2 distance,</p>
<disp-formula id="EQ24"><mml:math id="M64"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">L2</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup><mml:mo>|</mml:mo><mml:msubsup><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(20)</label></disp-formula>
<p>Please note that this metric can only evaluate continuous features. For categorical features, we aim to recover the distribution of the categorical variable in the target class, which will be described later.</p></sec>
<sec>
<label>5.2.2</label>
<title>Interpretability</title>
<p><xref ref-type="bibr" rid="B53">Van Looveren and Klaise (2021</xref>) use an autoencoder to evaluate the <italic>interpretability</italic> of a counterfactual method. Let AE<sub><italic>o</italic></sub>, AE<sub><italic>t</italic></sub>, and AE be three autoencoders trained on the original class, target class, and the entire dataset, respectively. The IM1 and IM2 scores are</p>
<disp-formula id="E25"><mml:math id="M65"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">IM1</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mfrac><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mtext class="textrm" mathvariant="normal">AE</mml:mtext></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:msup><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mtext class="textrm" mathvariant="normal">AE</mml:mtext></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:msup><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003F5;</mml:mi></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="EQ26"><mml:math id="M66"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">IM2</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mfrac><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mtext class="textrm" mathvariant="normal">AE</mml:mtext></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:mtext class="textrm" mathvariant="normal">AE</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:msup><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003F5;</mml:mi></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(21)</label></disp-formula>
<p>where <inline-formula><mml:math id="M67"><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mstyle></mml:mrow></mml:msubsup></mml:math></inline-formula> is the <italic>i</italic>th of <italic>N</italic> counterfactuals. A lower value of IM1 indicates that the generated counterfactuals are reconstructed better by the autoencoder trained on the counterfactual class (AE<sub><italic>t</italic></sub>) than the autoencoder trained on the original class. This suggests that the counterfactual is closer to the data manifold of the counterfactual class, and thus more plausible. A similar interpretation holds for IM2. Hence, lower values of IM1 and IM2 are preferred.</p></sec>
<sec>
<label>5.2.3</label>
<title>Diversity</title>
<p>Diversity provides additional performance information because low IM1 and IM2 may occur with counterfactuals that tend to merge to a single point; not only should the counterfactual look like the counterclass, it should also preserve its variety. The diversity metric is calculated as</p>
<disp-formula id="EQ27"><mml:math id="M68"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">Diversity</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>N</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(22)</label></disp-formula>
<p>where <italic>d</italic>(&#x000B7;, &#x000B7;) is a predefined distance function. We use the Euclidean distance in this study.</p></sec>
<sec>
<label>5.2.4</label>
<title>Validity</title>
<p>This metric verifies that the The generated counterfactual indeed lies in the counter-class region of the classifier to be explained. This is</p>
<disp-formula id="EQ28"><mml:math id="M69"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">Validity</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mtext class="textrm" mathvariant="normal">1</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>f</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(23)</label></disp-formula>
<p>where <italic>f</italic>(&#x000B7;) is the explained classifier and <italic>y</italic>&#x02032; is the target label. (Not all counterfactual methods generate counterfactuals that are guaranteed to change their label).</p></sec>
<sec>
<label>5.2.5</label>
<title>Instability</title>
<p>A stable counterfactual explainer should produce similar counterfactual outputs for two similar query inputs. Instability quantifies this as</p>
<disp-formula id="EQ29"><mml:math id="M70"><mml:mrow><mml:mtext class="textrm" mathvariant="normal">Instability</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mfrac><mml:mrow><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>^</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">cf</mml:mtext></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x0002B;</mml:mo><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>^</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<p>where <inline-formula><mml:math id="M71"><mml:msub><mml:mrow><mml:mover accent="false"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>^</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo class="qopname">arg</mml:mo><mml:munder class="msub"><mml:mrow><mml:mo class="qopname">min</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>X</mml:mi><mml:mo>\</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>f</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:munder><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mo>|</mml:mo></mml:math></inline-formula>, the point within the data set closest to <italic>x</italic><sub><italic>i</italic></sub> that has the same label. A low instability is preferred.</p></sec>
<sec>
<label>5.2.6</label>
<title>JS divergence</title>
<p>We also evaluate how well the distribution of counterfactual categorical variables aligns with the distribution of the target class. We calculate the average JS divergence across categorical variables,</p>
<disp-formula id="EQ30"><mml:math id="M72"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">JS</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:munderover></mml:mstyle><mml:mtext class="textrm" mathvariant="normal">JS</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">target</mml:mtext></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>C</mml:mi><mml:mi>F</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math><label>(24)</label></disp-formula>
<p>where <italic>N</italic><sup><italic>c</italic></sup> is the number of categorical variables. A lower JS score indicates similarity between the distributions of generated counterfactuals and the target class.</p>
</sec>
</sec>
<sec>
<label>5.3</label>
<title>Results</title>
<sec>
<label>5.3.1</label>
<title>Quantitative evaluation</title>
<p>We show quantitative results in <xref ref-type="table" rid="T2">Tables 2</xref>, <xref ref-type="table" rid="T3">3</xref>. The <xref ref-type="table" rid="T2">Table 2</xref> is for the no-masking setting, while the <xref ref-type="table" rid="T3">Table 3</xref> is for masking a preselected feature, prohibiting it from being changed by the counterfactual generator. While there is no single combination of these various metrics that determines relative performance, a subjective evaluation indicates the competitive performance of our TDCE method. For example, it achieves the best validity among other methods with significant margins, indicating nearly all the generated samples have turned to the target class&#x02014;arguably a prerequisite for other metrics to have meaning. We observe the competitive or superior performance on IM1 and IM2 as well, indicating that the generated counterfactuals stay on the data manifold of the target class and have better interpretability.</p>
<table-wrap position="float" id="T2">
<label>Table 2</label>
<caption><p>Counterfactual quantitative evaluation without masking of features that are allowed to change.</p></caption>
<table frame="box" rules="all">
<thead>
<tr>
<th valign="top" align="center" colspan="9"><bold>Counterfactual evaluations</bold></th>
</tr>
<tr>
<th valign="top" align="center" colspan="2"><bold>Model</bold></th>
<th valign="top" align="center"><bold>L2</bold>&#x02193;</th>
<th valign="top" align="center"><bold>Diversity</bold>&#x02191;</th>
<th valign="top" align="center"><bold>Instability</bold>&#x02193;</th>
<th valign="top" align="center"><bold>JS</bold>&#x02193;</th>
<th valign="top" align="center"><bold>IM1</bold>&#x02193;</th>
<th valign="top" align="center"><bold>IM2</bold>&#x02193;</th>
<th valign="top" align="center"><bold>Validity</bold>&#x02191;</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" rowspan="9">LCD</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.34</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.73</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><underline>0.11</underline>&#x000B1;0.03</td>
<td valign="top" align="center">0.12 &#x000B1; 0.03</td>
<td valign="top" align="center">1.33 &#x000B1; 0.04</td>
<td valign="top" align="center">0.16 &#x000B1; 0.03</td>
<td valign="top" align="center">0.60 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.76 &#x000B1; 0.02</td>
<td valign="top" align="center">0.71 &#x000B1; 0.03</td>
<td valign="top" align="center">0.13 &#x000B1; 0.03</td>
<td valign="top" align="center">0.12 &#x000B1; 0.03</td>
<td valign="top" align="center">0.71 &#x000B1; 0.04</td>
<td valign="top" align="center">0.13 &#x000B1; 0.03</td>
<td valign="top" align="center">0.97 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.56 &#x000B1; 0.03</td>
<td valign="top" align="center">0.19 &#x000B1; 0.01</td>
<td valign="top" align="center">0.21 &#x000B1; 0.02</td>
<td valign="top" align="center">0.09 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.57</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.08</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.59 &#x000B1; 0.01</td>
<td valign="top" align="center">0.18 &#x000B1; 0.03</td>
<td valign="top" align="center">0.22 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center">0.89 &#x000B1; 0.03</td>
<td valign="top" align="center">0.09 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center">0.70 &#x000B1; 0.02</td>
<td valign="top" align="center">0.26 &#x000B1; 0.03</td>
<td valign="top" align="center">0.31 &#x000B1; 0.03</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.72 &#x000B1; 0.04</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.83 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.69 &#x000B1; 0.01</td>
<td valign="top" align="center">0.54 &#x000B1; 0.05</td>
<td valign="top" align="center"><underline>0.11</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.06</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.91 &#x000B1; 0.07</td>
<td valign="top" align="center">0.11 &#x000B1; 0.03</td>
<td valign="top" align="center">0.85 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center"><underline>0.35</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.45 &#x000B1; 0.03</td>
<td valign="top" align="center">0.25 &#x000B1; 0.02</td>
<td valign="top" align="center">0.15 &#x000B1; 0.02</td>
<td valign="top" align="center">0.99 &#x000B1; 0.03</td>
<td valign="top" align="center">0.69 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.62 &#x000B1; 0.08</td>
<td valign="top" align="center"><underline>0.69</underline>&#x000B1;0.06</td>
<td valign="top" align="center">0.29 &#x000B1; 0.02</td>
<td valign="top" align="center">0.17 &#x000B1; 0.02</td>
<td valign="top" align="center">0.91 &#x000B1; 0.06</td>
<td valign="top" align="center">0.56 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center">0.59 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.73</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.01</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.63</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="9">GMC</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.03</bold>&#x000B1;0.02</td>
<td valign="top" align="center">0.25 &#x000B1; 0.02</td>
<td valign="top" align="center">0.09 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.03</bold>&#x000B1;0.01</td>
<td valign="top" align="center">1.04 &#x000B1; 0.05</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.73 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.27 &#x000B1; 0.02</td>
<td valign="top" align="center">0.22 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.03</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>1.01</underline>&#x000B1;0.05</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.01</td>
<td valign="top" align="center">0.93 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.21 &#x000B1; 0.03</td>
<td valign="top" align="center">0.21 &#x000B1; 0.01</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">1.14 &#x000B1; 0.05</td>
<td valign="top" align="center">0.15 &#x000B1; 0.02</td>
<td valign="top" align="center">0.77 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.23 &#x000B1; 0.02</td>
<td valign="top" align="center">0.21 &#x000B1; 0.02</td>
<td valign="top" align="center">0.13 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.05</underline>&#x000B1;0.01</td>
<td valign="top" align="center">1.18 &#x000B1; 0.05</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.80 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center"><underline>0.18</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.18 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.08 &#x000B1; 0.01</td>
<td valign="top" align="center">1.14 &#x000B1; 0.04</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.21 &#x000B1; 0.02</td>
<td valign="top" align="center">0.17 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.01</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">1.18 &#x000B1; 0.01</td>
<td valign="top" align="center">0.08 &#x000B1; 0.01</td>
<td valign="top" align="center">0.86 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center">0.20 &#x000B1; 0.01</td>
<td valign="top" align="center">0.17 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">1.02 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.97</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.25 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.98</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.13 &#x000B1; 0.03</td>
<td valign="top" align="center">0.07 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>1.01</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.10 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.96</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center"><underline>0.18</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>1.08</bold>&#x000B1;0.06</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.03</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.96</bold>&#x000B1;0.04</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="9">Adult</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.27</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>1.11</bold>&#x000B1;0.01</td>
<td valign="top" align="center">0.09 &#x000B1; 0.01</td>
<td valign="top" align="center">0.13 &#x000B1; 0.01</td>
<td valign="top" align="center">1.31 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.05</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.57 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.97 &#x000B1; 0.03</td>
<td valign="top" align="center">0.92 &#x000B1; 0.01</td>
<td valign="top" align="center">0.08 &#x000B1; 0.01</td>
<td valign="top" align="center">0.13 &#x000B1; 0.01</td>
<td valign="top" align="center">1.01 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.87 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center"><underline>0.79</underline>&#x000B1;0.03</td>
<td valign="top" align="center">0.19 &#x000B1; 0.02</td>
<td valign="top" align="center">0.22 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">1.89 &#x000B1; 0.07</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">0.61 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.99 &#x000B1; 0.02</td>
<td valign="top" align="center">0.43 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">1.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.58 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center">0.81 &#x000B1; 0.03</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.01</td>
<td valign="top" align="center">0.17 &#x000B1; 0.03</td>
<td valign="top" align="center">1.41 &#x000B1; 0.05</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.01</td>
<td valign="top" align="center">0.62 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.89 &#x000B1; 0.02</td>
<td valign="top" align="center">0.74 &#x000B1; 0.04</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.06</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.97 &#x000B1; 0.02</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.75</underline>&#x000B1;0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center">0.86 &#x000B1; 0.02</td>
<td valign="top" align="center">0.69 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.09 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.96</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.94</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.96 &#x000B1; 0.05</td>
<td valign="top" align="center"><underline>0.79</underline>&#x000B1;0.06</td>
<td valign="top" align="center">0.08 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.98</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.92</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center">0.85 &#x000B1; 0.04</td>
<td valign="top" align="center"><underline>0.80</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.03</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.90</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.94</bold>&#x000B1;0.04</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="9">LAW</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.17</bold>&#x000B1;0.04</td>
<td valign="top" align="center"><bold>1.22</bold>&#x000B1;0.05</td>
<td valign="top" align="center">0.13 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">1.73 &#x000B1; 0.02</td>
<td valign="top" align="center">0.12 &#x000B1; 0.02</td>
<td valign="top" align="center">0.58 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.87 &#x000B1; 0.04</td>
<td valign="top" align="center">1.12 &#x000B1; 0.05</td>
<td valign="top" align="center">0.12 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">1.31 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">0.88 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.99 &#x000B1; 0.02</td>
<td valign="top" align="center">0.20 &#x000B1; 0.01</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.05</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.95 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.09</underline>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center"><underline>0.71</underline>&#x000B1;0.03</td>
<td valign="top" align="center">0.91 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.06</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">1.56 &#x000B1; 0.05</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.61 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center">0.79 &#x000B1; 0.02</td>
<td valign="top" align="center">0.37 &#x000B1; 0.01</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.05</underline>&#x000B1;0.01</td>
<td valign="top" align="center">1.21 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
<td valign="top" align="center">0.83 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.03</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.01</td>
<td valign="top" align="center">1.31 &#x000B1; 0.06</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center">0.79 &#x000B1; 0.01</td>
<td valign="top" align="center">0.91 &#x000B1; 0.02</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.93</underline>&#x000B1;0.03</td>
<td valign="top" align="center">0.08 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.88 &#x000B1; 0.04</td>
<td valign="top" align="center"><underline>0.96</underline>&#x000B1;0.05</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.96</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.98</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.97</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><underline>0.06</underline>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.89</bold>&#x000B1;0.05</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr></tbody>
</table>
<table-wrap-foot>
<p>We provide an evaluation according to the metrics described in the text. The arrow beside each metric indicates the preferred value. We select one feature to mask in the masking setting. bold = 1st, underline = 2nd. The classifier in CounterNet requires a different architecture because it is model-dependent. <italic>Wach</italic>.<sup><italic>IM</italic>1</sup> is generated by linearly interpolating the generated sample such that the IM1 score is maximized. The mean and standard deviation are calculated based on 5 runs with different random seeds.</p>
</table-wrap-foot>
</table-wrap>
<table-wrap position="float" id="T3">
<label>Table 3</label>
<caption><p>Counterfactual quantitative evaluation with masking of features that are allowed to change.</p></caption>
<table frame="box" rules="all">
<thead>
<tr>
<th valign="top" align="center" colspan="8"><bold>Counterfactual evaluations</bold></th>
</tr>
<tr>
<th valign="top" align="center" colspan="2"><bold>Model</bold></th>
<th valign="top" align="center"><bold>L2</bold>&#x02193;</th>
<th valign="top" align="center"><bold>Diversity</bold>&#x02191;</th>
<th valign="top" align="center"><bold>Instability</bold>&#x02193;</th>
<th valign="top" align="center"><bold>IM1</bold>&#x02193;</th>
<th valign="top" align="center"><bold>IM2</bold>&#x02193;</th>
<th valign="top" align="center"><bold>Validity</bold>&#x02191;</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" rowspan="9">LCD</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.34</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><underline>0.73</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><underline>0.12</underline>&#x000B1;0.01</td>
<td valign="top" align="center">1.04 &#x000B1; 0.05</td>
<td valign="top" align="center">0.27 &#x000B1; 0.03</td>
<td valign="top" align="center">0.75 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.51 &#x000B1; 0.02</td>
<td valign="top" align="center">0.61 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.11</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.84 &#x000B1; 0.05</td>
<td valign="top" align="center">0.18 &#x000B1; 0.03</td>
<td valign="top" align="center">0.96 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.50 &#x000B1; 0.03</td>
<td valign="top" align="center">0.36 &#x000B1; 0.03</td>
<td valign="top" align="center">0.29 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.64</bold>&#x000B1;0.05</td>
<td valign="top" align="center"><underline>0.16</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.98</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.52 &#x000B1; 0.02</td>
<td valign="top" align="center">0.33 &#x000B1; 0.03</td>
<td valign="top" align="center">0.21 &#x000B1; 0.02</td>
<td valign="top" align="center">0.82 &#x000B1; 0.04</td>
<td valign="top" align="center">0.19 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.98</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center">0.49 &#x000B1; 0.02</td>
<td valign="top" align="center">0.38 &#x000B1; 0.04</td>
<td valign="top" align="center">0.24 &#x000B1; 0.02</td>
<td valign="top" align="center">0.92 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.15</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.69 &#x000B1; 0.02</td>
<td valign="top" align="center">0.55 &#x000B1; 0.03</td>
<td valign="top" align="center">0.17 &#x000B1; 0.01</td>
<td valign="top" align="center">0.79 &#x000B1; 0.07</td>
<td valign="top" align="center">0.20 &#x000B1; 0.01</td>
<td valign="top" align="center">0.87 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center"><underline>0.35</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.45 &#x000B1; 0.03</td>
<td valign="top" align="center">0.25 &#x000B1; 0.02</td>
<td valign="top" align="center">1.09 &#x000B1; 0.03</td>
<td valign="top" align="center">0.88 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.62 &#x000B1; 0.08</td>
<td valign="top" align="center">0.69 &#x000B1; 0.06</td>
<td valign="top" align="center">0.29 &#x000B1; 0.02</td>
<td valign="top" align="center">0.99 &#x000B1; 0.06</td>
<td valign="top" align="center">0.66 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center">0.49 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.77</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.09</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><underline>0.77</underline>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="9">GMC</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.01</td>
<td valign="top" align="center">0.23 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center">1.13 &#x000B1; 0.09</td>
<td valign="top" align="center"><underline>0.13</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.57 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.15 &#x000B1; 0.01</td>
<td valign="top" align="center">0.24 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">1.04 &#x000B1; 0.09</td>
<td valign="top" align="center"><underline>0.13</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.77 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.17 &#x000B1; 0.02</td>
<td valign="top" align="center">0.21 &#x000B1; 0.01</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">1.19 &#x000B1; 0.03</td>
<td valign="top" align="center">0.15 &#x000B1; 0.01</td>
<td valign="top" align="center">0.52 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.16 &#x000B1; 0.02</td>
<td valign="top" align="center">0.21 &#x000B1; 0.02</td>
<td valign="top" align="center">0.12 &#x000B1; 0.01</td>
<td valign="top" align="center">1.10 &#x000B1; 0.05</td>
<td valign="top" align="center">0.17 &#x000B1; 0.01</td>
<td valign="top" align="center">0.53 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">0.20 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.08</underline>&#x000B1;0.01</td>
<td valign="top" align="center">1.32 &#x000B1; 0.05</td>
<td valign="top" align="center"><underline>0.13</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.57 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center"><underline>0.09</underline>&#x000B1;0.03</td>
<td valign="top" align="center">0.16 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.07</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><underline>1.03</underline>&#x000B1;0.02</td>
<td valign="top" align="center"><underline>0.13</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.65 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center">0.20 &#x000B1; 0.01</td>
<td valign="top" align="center">0.17 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center">1.09 &#x000B1; 0.02</td>
<td valign="top" align="center">0.16 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.90</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.25 &#x000B1; 0.01</td>
<td valign="top" align="center"><bold>0.98</bold>&#x000B1;0.04</td>
<td valign="top" align="center">0.13 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>1.04</underline>&#x000B1;0.04</td>
<td valign="top" align="center"><underline>0.11</underline>&#x000B1;0.02</td>
<td valign="top" align="center"><underline>0.95</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.83</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.94</bold>&#x000B1;0.02</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="9">Adult</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.28</bold>&#x000B1;0.04</td>
<td valign="top" align="center"><bold>1.01</bold>&#x000B1;0.03</td>
<td valign="top" align="center">0.15 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>1.00</underline>&#x000B1;0.05</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.51 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.83 &#x000B1; 0.04</td>
<td valign="top" align="center">0.99 &#x000B1; 0.03</td>
<td valign="top" align="center">0.16 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.98</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.71 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.62 &#x000B1; 0.03</td>
<td valign="top" align="center">0.72 &#x000B1; 0.03</td>
<td valign="top" align="center">0.17 &#x000B1; 0.02</td>
<td valign="top" align="center">1.11 &#x000B1; 0.03</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.55 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.78 &#x000B1; 0.03</td>
<td valign="top" align="center">0.78 &#x000B1; 0.02</td>
<td valign="top" align="center">0.09 &#x000B1; 0.01</td>
<td valign="top" align="center">1.11 &#x000B1; 0.06</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.61 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center"><underline>0.61</underline>&#x000B1;0.03</td>
<td valign="top" align="center">0.71 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.07</bold>&#x000B1;0.01</td>
<td valign="top" align="center">1.14 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.06</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.55 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.85 &#x000B1; 0.02</td>
<td valign="top" align="center">0.79 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.08</underline>&#x000B1;0.01</td>
<td valign="top" align="center">1.02 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.06</underline>&#x000B1;0.01</td>
<td valign="top" align="center">0.58 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center">0.86 &#x000B1; 0.02</td>
<td valign="top" align="center">0.69 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.07</underline>&#x000B1;0.02</td>
<td valign="top" align="center">1.03 &#x000B1; 0.02</td>
<td valign="top" align="center">0.10 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.84</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.96 &#x000B1; 0.05</td>
<td valign="top" align="center"><underline>0.79</underline>&#x000B1;0.06</td>
<td valign="top" align="center">0.08 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>1.01</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.09 &#x000B1; 0.01</td>
<td valign="top" align="center"><underline>0.84</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center">0.79 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.82</underline>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.06</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.93</bold>&#x000B1;0.04</td>
<td valign="top" align="center"><bold>0.05</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>0.86</bold>&#x000B1;0.04</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="9">LAW</td>
<td valign="top" align="left">Wach.</td>
<td valign="top" align="center"><bold>0.26</bold>&#x000B1;0.02</td>
<td valign="top" align="center"><bold>1.12</bold>&#x000B1;0.02</td>
<td valign="top" align="center">0.13 &#x000B1; 0.02</td>
<td valign="top" align="center">1.54 &#x000B1; 0.01</td>
<td valign="top" align="center">0.14 &#x000B1; 0.01</td>
<td valign="top" align="center">0.39 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="center"><italic>Wach</italic>.<sup><italic>IM</italic>1</sup></td>
<td valign="top" align="center">0.91 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>1.09</bold>&#x000B1;0.02</td>
<td valign="top" align="center">0.15 &#x000B1; 0.02</td>
<td valign="top" align="center">1.22 &#x000B1; 0.01</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.81 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">CCH.</td>
<td valign="top" align="center">0.89 &#x000B1; 0.02</td>
<td valign="top" align="center">0.75 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.05</underline>&#x000B1;0.01</td>
<td valign="top" align="center">1.43 &#x000B1; 0.02</td>
<td valign="top" align="center">0.13 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">REVI.</td>
<td valign="top" align="center">0.80 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>1.02</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.09 &#x000B1; 0.02</td>
<td valign="top" align="center">1.37 &#x000B1; 0.02</td>
<td valign="top" align="center">0.11 &#x000B1; 0.01</td>
<td valign="top" align="center">0.60 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">CLUE</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
<td valign="top" align="center">0.68 &#x000B1; 0.01</td>
<td valign="top" align="center">0.07 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.76</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.09</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.99</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FACE</td>
<td valign="top" align="center">0.92 &#x000B1; 0.01</td>
<td valign="top" align="center">0.81 &#x000B1; 0.03</td>
<td valign="top" align="center"><bold>0.04</bold>&#x000B1;0.01</td>
<td valign="top" align="center">1.63 &#x000B1; 0.01</td>
<td valign="top" align="center">0.16 &#x000B1; 0.01</td>
<td valign="top" align="center">0.80 &#x000B1; 0.03</td>
</tr>
 <tr>
<td valign="top" align="left">CounterNet</td>
<td valign="top" align="center">0.79 &#x000B1; 0.01</td>
<td valign="top" align="center">0.91 &#x000B1; 0.02</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.96 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.09</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.98</underline>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">FastDCFlow</td>
<td valign="top" align="center">0.88 &#x000B1; 0.04</td>
<td valign="top" align="center">0.96 &#x000B1; 0.05</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center"><underline>0.98</underline>&#x000B1;0.04</td>
<td valign="top" align="center">0.12 &#x000B1; 0.02</td>
<td valign="top" align="center"><bold>0.98</bold>&#x000B1;0.01</td>
</tr>
 <tr>
<td valign="top" align="left">TDCE</td>
<td valign="top" align="center"><underline>0.79</underline>&#x000B1;0.02</td>
<td valign="top" align="center">0.95 &#x000B1; 0.03</td>
<td valign="top" align="center"><underline>0.05</underline>&#x000B1;0.01</td>
<td valign="top" align="center"><bold>0.73</bold>&#x000B1;0.03</td>
<td valign="top" align="center"><bold>0.07</bold>&#x000B1;0.01</td>
<td valign="top" align="center"><underline>0.98</underline>&#x000B1;0.02</td>
</tr></tbody>
</table>
<table-wrap-foot>
<p>We provide an evaluation according to the metrics described in the text. The arrow beside each metric indicates the preferred value. We select one feature to mask in the masking setting. bold = 1st, underline = 2nd. <italic>Wach</italic>.<sup><italic>IM</italic>1</sup> is generated by linearly interpolating the generated sample such that the IM1 score is maximized. The mean and standard deviation are calculated based on 5 runs with different random seeds.</p>
</table-wrap-foot>
</table-wrap>
<p>In the experiments, the baseline Wachter shows volatile performance in terms of the metrics across different datasets. It is able to produce robust samples with fair diversity, but it lacks interpretability, such as on LCD. Although the Wachter achieves the best L2 distance, the price is in other metrics, including validity. To see this, we linearly interpolate between the sample and the generated counterfactual to search for the sample such that IM1 is maximized. As it is evident, when the highest IM1 (which is still lower than ours) is achieved, the L2 distance is much worse than our TDCE. In the masking setting, we observe a similar performance. In addition, we see that FastDCFlow achieves a better diversity score because it adds perturbations for diversity purposes while generating counterfactual samples. However, this comes at the price of a high L2 distance, which is the key metric of counterfactual explanations. Furthermore, we also note that CCHVAE, REVISE, and CLUE show strong robustness (low instability). However, these results are usually accompanied by a low diversity score, indicating that the algorithms tend to generate similar counterfactuals. The same conclusion can also be drawn from their relatively high JS score, a high JS score suggesting that the generated categorical variables do not match the distribution in the target class.</p>
<p>To give a concrete example of what we observed, when analyzing the LCD dataset, we found that the Fair, Isaac and Company (FICO) score dominates the classifier&#x00027;s decision, while the categorical loan-term variable is less important. All benchmark methods tend to completely ignore the less significant feature because changing one&#x00027;s FICO score quickly changes the classification. In contrast, our TDCE method pays more attention to each feature, which creates less discrepancy between the distributions of the counterfactual and counter-class data.</p>
<p>We also note that TDCE is faster compared with other searching algorithms. Wachter, REVISE, and FACE require iterative searching for each individual sample, while TDCE&#x00027;s reverse process is a fixed Markov chain learned during training.</p></sec>
<sec>
<label>5.3.2</label>
<title>Proximity</title>
<p>We evaluate the proximity between the generated counterfactual sample and the original query samples using L2 distance. In the experiments, we observe that Wachter has achieved the lowest L2 distance across all the datasets. This is because Wachter stops searching when it finds the sample that changes its label with minimum modification in the feature space. This can produce a sample around the decision boundary, though by using minimal changes, it might produce a less meaningful explanation that is out of sample (i.e., has high IM1/IM2). We show that its L2 distance would be much worse if we interpolate the original sample and the counterfactual sample to find the sample with the maximum IM1 score. We emphasize that we are focusing on a higher validity and greater interpretability (i.e., low IM1/IM2) and therefore are willing to sacrifice on L2 distance. Nevertheless, our TDCE is adjustable for the importance of L2 distance by simply adding a regularization to <xref ref-type="disp-formula" rid="EQ10">Equation 10</xref>.</p></sec>
<sec>
<label>5.3.3</label>
<title>Efficency</title>
<p>We show the runtime for generating counterfactual samples in <xref ref-type="table" rid="T4">Table 4</xref>. We observe that CounterNet and FastDCFlow run faster than other methods because, instead of searching, it generates the counterfactuals through a single forward pass of a neural network. However, we highlight that our TDCE is model-agnostic(only requires differentiability), whereas CounterNet is model-dependent, requiring the encoder to be the classifier as well. FastDCFlow requires an invertible architecture as a counterfactual generator, restricting the model&#x00027;s expressiveness. The results also show that while FastDCFlow generally achieves a high diversity score, this comes at the cost of a larger L2 distance, which is the key metric of counterfactual explanations. In addition, TDCE is capable of generating more interpretable samples (i.e., low IM1/IM2) for all datasets we consider. Aside from CounterNet and FastDCFlow, TDCE runs faster than all other search-based algorithms because TDCE can generate the counterfactual samples in a pre-defined number of reverse steps, while search algorithms rely heavily on the objective function.</p>
<table-wrap position="float" id="T4">
<label>Table 4</label>
<caption><p>Counterfactual generation time in seconds per 100 samples on the same computer setting.</p></caption>
<table frame="box" rules="all">
<thead>
<tr>
<th valign="top" align="center" colspan="9"><bold>Counterfactual generation time (sec/100 sample)</bold></th>
</tr>
<tr>
<th valign="top" align="left"><bold>Dataset\Model</bold></th>
<th valign="top" align="center"><bold>Wach</bold>.</th>
<th valign="top" align="center"><bold>CCH</bold>.</th>
<th valign="top" align="center"><bold>REVI</bold>.</th>
<th valign="top" align="center"><bold>CLUE</bold></th>
<th valign="top" align="center"><bold>FACE</bold></th>
<th valign="top" align="center"><bold>CounterNet</bold></th>
<th valign="top" align="center"><bold>FasthCFlow</bold></th>
<th valign="top" align="center"><bold>TDCE</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">LCD</td>
<td valign="top" align="center">0.9</td>
<td valign="top" align="center">0.8</td>
<td valign="top" align="center">0.8</td>
<td valign="top" align="center">0.9</td>
<td valign="top" align="center">1.0</td>
<td valign="top" align="center">0.1</td>
<td valign="top" align="center">0.1</td>
<td valign="top" align="center">0.3</td>
</tr>
<tr>
<td valign="top" align="left">GMC</td>
<td valign="top" align="center">1.1</td>
<td valign="top" align="center">1.2</td>
<td valign="top" align="center">1.1</td>
<td valign="top" align="center">1.3</td>
<td valign="top" align="center">1.5</td>
<td valign="top" align="center">0.2</td>
<td valign="top" align="center">0.2</td>
<td valign="top" align="center">0.5</td>
</tr>
<tr>
<td valign="top" align="left">Adult</td>
<td valign="top" align="center">1.1</td>
<td valign="top" align="center">1.3</td>
<td valign="top" align="center">1.2</td>
<td valign="top" align="center">1.3</td>
<td valign="top" align="center">1.6</td>
<td valign="top" align="center">0.2</td>
<td valign="top" align="center">0.1</td>
<td valign="top" align="center">0.5</td>
</tr>
<tr>
<td valign="top" align="left">LAW</td>
<td valign="top" align="center">1.0</td>
<td valign="top" align="center">1.1</td>
<td valign="top" align="center">1.1</td>
<td valign="top" align="center">1.2</td>
<td valign="top" align="center">1.4</td>
<td valign="top" align="center">0.1</td>
<td valign="top" align="center">0.2</td>
<td valign="top" align="center">0.4</td>
</tr></tbody>
</table>
</table-wrap>
</sec>
<sec>
<label>5.3.4</label>
<title>Ablation</title>
<p>We show the ablation study of our TDCE in <xref ref-type="table" rid="T5">Table 5</xref>. In the study, we experiment on the datasets with and without the L2 distance constraint described in <xref ref-type="disp-formula" rid="EQ10">Equation 10</xref>. The L2 distance constraint aims to generate a counterfactual sample with minimum changes. The results show that without an L2 distance constraint, TDCE can still generate interpretable results with a larger diversity score. However, the L2 distance constraint is necessary by the definition in <xref ref-type="disp-formula" rid="EQ1">Equation 1</xref>. In a no-masking setting, the JS score is almost unchanged as the categorical module in TDCE is separated from the continuous part and fixed during the ablation study.</p>
<table-wrap position="float" id="T5">
<label>Table 5</label>
<caption><p>Ablation study of TDCE with or without distance constraint in <xref ref-type="disp-formula" rid="EQ10">Equation 10</xref>.</p></caption>
<table frame="box" rules="all">
<thead>
<tr>
<th valign="top" align="center" colspan="9"><bold>Ablation study of TDCE with or without distance constraint in</bold> <xref ref-type="disp-formula" rid="EQ10">Equation 10</xref></th>
</tr>
<tr>
<th valign="top" align="left" colspan="2"><bold>Dataset\Metrics</bold></th>
<th valign="top" align="center"><bold>L2</bold>&#x02193;</th>
<th valign="top" align="center"><bold>Diversity</bold>&#x02191;</th>
<th valign="top" align="center"><bold>Instability</bold>&#x02193;</th>
<th valign="top" align="center"><bold>JS</bold>&#x02193;</th>
<th valign="top" align="center"><bold>IM1</bold>&#x02193;</th>
<th valign="top" align="center"><bold>IM2</bold>&#x02193;</th>
<th valign="top" align="center"><bold>Validity</bold>&#x02191;</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" rowspan="4">LCD</td>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.88 &#x000B1; 0.04</td>
<td valign="top" align="center">0.81 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">0.02 &#x000B1; 0.01</td>
<td valign="top" align="center">0.54 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.59 &#x000B1; 0.03</td>
<td valign="top" align="center">0.73 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.01 &#x000B1; 0.01</td>
<td valign="top" align="center">0.63 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.58 &#x000B1; 0.02</td>
<td valign="top" align="center">0.91 &#x000B1; 0.03</td>
<td valign="top" align="center">0.08 &#x000B1; 0.03</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.79 &#x000B1; 0.02</td>
<td valign="top" align="center">0.05 &#x000B1; 0.02</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.49 &#x000B1; 0.02</td>
<td valign="top" align="center">0.77 &#x000B1; 0.03</td>
<td valign="top" align="center">0.09 &#x000B1; 0.02</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.77 &#x000B1; 0.02</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="4">GMC</td>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.31 &#x000B1; 0.03</td>
<td valign="top" align="center">1.38 &#x000B1; 0.06</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.03 &#x000B1; 0.01</td>
<td valign="top" align="center">0.94 &#x000B1; 0.04</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.18 &#x000B1; 0.03</td>
<td valign="top" align="center">1.08 &#x000B1; 0.06</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.03 &#x000B1; 0.01</td>
<td valign="top" align="center">0.96 &#x000B1; 0.04</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.20 &#x000B1; 0.02</td>
<td valign="top" align="center">0.91 &#x000B1; 0.03</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.98 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">0.94 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.11 &#x000B1; 0.02</td>
<td valign="top" align="center">0.83 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.99 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.94 &#x000B1; 0.02</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="4">Adult</td>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">1.01 &#x000B1; 0.05</td>
<td valign="top" align="center">0.89 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">0.03 &#x000B1; 0.02</td>
<td valign="top" align="center">0.93 &#x000B1; 0.04</td>
<td valign="top" align="center">0.05 &#x000B1; 0.02</td>
<td valign="top" align="center">0.93 &#x000B1; 0.04</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.85 &#x000B1; 0.04</td>
<td valign="top" align="center">0.80 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.03 &#x000B1; 0.02</td>
<td valign="top" align="center">0.90 &#x000B1; 0.02</td>
<td valign="top" align="center">0.04 &#x000B1; 0.01</td>
<td valign="top" align="center">0.94 &#x000B1; 0.04</td>
</tr>
 <tr>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.88 &#x000B1; 0.03</td>
<td valign="top" align="center">0.89 &#x000B1; 0.04</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.97 &#x000B1; 0.04</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">0.83 &#x000B1; 0.04</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.79 &#x000B1; 0.03</td>
<td valign="top" align="center">0.82 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.93 &#x000B1; 0.04</td>
<td valign="top" align="center">0.05 &#x000B1; 0.02</td>
<td valign="top" align="center">0.86 &#x000B1; 0.04</td>
</tr>
<tr>
<td valign="top" align="left" rowspan="4">LAW</td>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.99 &#x000B1; 0.03</td>
<td valign="top" align="center">1.19 &#x000B1; 0.04</td>
<td valign="top" align="center">0.07 &#x000B1; 0.02</td>
<td valign="top" align="center">0.04 &#x000B1; 0.02</td>
<td valign="top" align="center">0.90 &#x000B1; 0.05</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.81 &#x000B1; 0.02</td>
<td valign="top" align="center">0.97 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.02</td>
<td valign="top" align="center">0.04 &#x000B1; 0.02</td>
<td valign="top" align="center">0.89 &#x000B1; 0.05</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">0.99 &#x000B1; 0.01</td>
</tr>
 <tr>
<td valign="top" align="left">without distance constraint</td>
<td valign="top" align="center">0.96 &#x000B1; 0.02</td>
<td valign="top" align="center">1.21 &#x000B1; 0.03</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.76 &#x000B1; 0.04</td>
<td valign="top" align="center">0.06 &#x000B1; 0.01</td>
<td valign="top" align="center">0.96 &#x000B1; 0.02</td>
</tr>
 <tr>
<td valign="top" align="left">with distance constraint</td>
<td valign="top" align="center">0.79 &#x000B1; 0.02</td>
<td valign="top" align="center">0.95 &#x000B1; 0.03</td>
<td valign="top" align="center">0.05 &#x000B1; 0.01</td>
<td valign="top" align="center">&#x02212;</td>
<td valign="top" align="center">0.73 &#x000B1; 0.03</td>
<td valign="top" align="center">0.07 &#x000B1; 0.01</td>
<td valign="top" align="center">0.98 &#x000B1; 0.02</td>
</tr></tbody>
</table>
<table-wrap-foot>
<p>For each dataset, the top two rows are for no masking, and the bottom two rows are for masking.</p>
</table-wrap-foot>
</table-wrap>
</sec>
<sec>
<label>5.3.5</label>
<title>Discussion</title>
<p>Through the experiments, each benchmark shows a good ability to generate counterfactuals, yet they are somewhat limited due to design issues. Gradient-based methods, such as Wachter, which directly operate in the feature space, can often be fooled by spurious changes. This causes the classifier to change its prediction by small, uninterpretable movements. Although it can achieve the minimum L2 distance, further analysis shows that such samples often result in a worse interpretability score(IM1/IM2). VAE-based methods such as CLUE, REVISE, and CCHVAE leverage the generative power of VAEs but heavily rely on the black-box latent space in which they work. This may lead to counterfactuals that fall off the data manifold. Furthermore, we also observe that these methods occasionally tend to produce unvaried samples, implying that mode collapse might occur. In addition, the black-box decoder might also add uncertainty to the produced counterfactuals. Graph methods like FACE depend on sample quality and coverage, and search only within the graph itself, producing a sample that already exists in the data set. The construction of the graph and searching algorithm are inherently computationally expensive. Although CounterNet and FastDCFlow generate counterfactual samples at a faster speed, they often suffer from the worst interpretability score(CounterNet) due to the black-box decoder or larger L2 distance(FastDCFlow) due to added noise in the latent space. In contrast, our TDCE uses a diffusion model operating directly in the ambient features space. This connects it to Wachter, while still leveraging the generative power available to deep models such as the VAE. We believe the combination of these desirable aspects accounts for our good relative performance.</p></sec>
<sec>
<label>5.3.6</label>
<title>Qualitative evaluations</title>
<p>We also provide a qualitative comparison on the LCD dataset in <xref ref-type="fig" rid="F4">Figure 4</xref>. LCD contains five numerical features and one categorical feature. In the non-mask setting, all features are guided by the classifier. Darker pixels show greater discrepancy between the counterfactual sample and the target class. As we can see from the first row, TDCE has fewer darker pixels in general. Importantly, in the middle row, the generated categorical variables from TDCE perfectly match the distribution of the target class. In the masking setting, we fix the categorical variable and only guide the continuous features. In general, the distributional agreement between the target class and the counterfactual class is much greater with TDCE than with other methods.</p>
<fig position="float" id="F4">
<label>Figure 4</label>
<caption><p>Qualitative comparisons between TDCE and other methods on LCD dataset. <bold>Top</bold>: the absolute difference between the correlation of counterfactual samples and that of the target class for the continuous features (debt-to-income ratio, loan amount, interest rate, annual income, FICO score). <bold>Middle</bold>: Bar plots for the categorical variable (loan term: 36 months or 60 months). <bold>Bottom</bold>: The same metrics as the top when masking the categorical variable. The absolute difference is the same for CounterNet and FastDCFlow because it simply copies the immutable features from the query sample.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frai-09-1743495-g0004.tif">
<alt-text content-type="machine-generated">A series of visualizations comparing different models: TDCE, Wachter, CCHVAE, REVISE, CLUE, FACE, CounterNet, and FastDCFlow. Each model has three sections: a heatmap, a bar graph showing counts for Class 1 over 36 and 60 months, and a second heatmap. The heatmaps display varying shades of orange and brown, while the bar graphs compare model predictions over time, represented in blue and orange.</alt-text>
</graphic>
</fig>
</sec>
<sec>
<label>5.3.7</label>
<title>Discussion on temperature &#x003C4;</title>
<p>We evaluate the temperature &#x003C4; over IM1, IM2, JS and Validity on LCD dataset in <xref ref-type="fig" rid="F5">Figure 5</xref>. The temperature affects the overall counterfactual performance significantly. As the temperature drops, the Gumbel-softmax approaches a one-hot vector. However, this blocks the flow of gradients from the classifier back to the categorical variable, producing the vanishing gradient issue. In this case, the reverse process is mainly governed by the continuous features. This does not automatically prevent a model from generating valid counterfactual samples because the categorical variables might not be significant in the prediction. However, it does prevent the model from generating realistic counterfactual samples, which diminishes the legitimacy of counterfactual explanations.</p>
<fig position="float" id="F5">
<label>Figure 5</label>
<caption><p>An analysis on the temperature &#x003C4; of LCD dataset. The best JS score is achieved when &#x003C4; &#x0003D; 0.3 with balanced IM1 and IM2 scores.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frai-09-1743495-g0005.tif">
<alt-text content-type="machine-generated">Four line graphs display data labeled IM1, IM2, JS, and Val against the x-axis of Tau. Each graph shows mean values with ranges indicated by vertical error bars. IM1 and IM2 display increasing trends, JS shows a sharp dip at 0.5 Tau, and Val has a significant drop at 0.5 Tau with variability across other points.</alt-text>
</graphic>
</fig>
<p>As the temperature increases, the counterfactual generator tends to recover the distribution of the categorical variable in the target class. However, according to Theorem 4.1, our reverse process might diverge from the true reverse process as the temperature becomes larger. The resulting model may not be able to recover the distribution of categorical variables well. In the experiments, we search for the best &#x003C4; ranging from 0.1 to 5 for each dataset and select the best &#x003C4; based on the minimum L2 distance.</p>
</sec>
</sec>
</sec>
<sec sec-type="conclusions" id="s6">
<label>6</label>
<title>Conclusion</title>
<p>We proposed a tabular diffusion model that generates counterfactual explanations for a classifier. We leverage the Gumbel-softmax distribution to re-parameterize one-hot vectors into a continuous vector, which allows us to utilize the gradients from the classifier to guide the reverse process. We provided theoretical bounds and experimented on four popular tabular datasets. Quantitative results support that our method combines the advantages of working directly in the feature space of Wachter and graph methods with the advantage of neural networks of VAE-based methods.</p></sec>
</body>
<back>
<sec sec-type="data-availability" id="s7">
<title>Data availability statement</title>
<p>The original contributions presented in the study are included in the article/<xref ref-type="supplementary-material" rid="SM1">Supplementary material</xref>, further inquiries can be directed to the corresponding author.</p>
</sec>
<sec sec-type="author-contributions" id="s8">
<title>Author contributions</title>
<p>WZ: Writing &#x02013; original draft, Writing &#x02013; review &#x00026; editing. BB: Conceptualization, Supervision, Visualization, Writing &#x02013; review &#x00026; editing. JP: Methodology, Supervision, Writing &#x02013; review &#x00026; editing.</p>
</sec>
<sec sec-type="COI-statement" id="conf1">
<title>Conflict of interest</title>
<p>BB was employed by Capital One.</p>
<p>The remaining author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="ai-statement" id="s10">
<title>Generative AI statement</title>
<p>The author(s) declared that generative AI was not used in the creation of this manuscript.</p>
<p>Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.</p></sec>
<sec sec-type="disclaimer" id="s11">
<title>Publisher&#x00027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<sec sec-type="supplementary-material" id="s12">
<title>Supplementary material</title>
<p>The Supplementary Material for this article can be found online at: <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/articles/10.3389/frai.2026.1743495/full#supplementary-material">https://www.frontiersin.org/articles/10.3389/frai.2026.1743495/full#supplementary-material</ext-link></p>
<supplementary-material xlink:href="Data_Sheet_1.pdf" id="SM1" mimetype="application/pdf" xmlns:xlink="http://www.w3.org/1999/xlink"/></sec>
<ref-list>
<title>References</title>
<ref id="B1">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Agarwal</surname> <given-names>R.</given-names></name> <name><surname>Melnick</surname> <given-names>L.</given-names></name> <name><surname>Frosst</surname> <given-names>N.</given-names></name> <name><surname>Zhang</surname> <given-names>X.</given-names></name> <name><surname>Lengerich</surname> <given-names>B.</given-names></name> <name><surname>Caruana</surname> <given-names>R.</given-names></name> <etal/></person-group>. (<year>2021</year>). <article-title>&#x0201C;Neural additive models: Interpretable machine learning with neural nets,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B2">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Antor&#x000E1;n</surname> <given-names>J.</given-names></name> <name><surname>Bhatt</surname> <given-names>U.</given-names></name> <name><surname>Adel</surname> <given-names>T.</given-names></name> <name><surname>Weller</surname> <given-names>A.</given-names></name> <name><surname>Hern&#x000E1;ndez-Lobato</surname> <given-names>J. M.</given-names></name></person-group> (<year>2020</year>). <article-title>Getting a CLUE: a method for explaining uncertainty estimates</article-title>. <source>arXiv</source> [preprint] arXiv:2006.06848. doi: <pub-id pub-id-type="doi">10.48550/arXiv.2006.06848</pub-id></mixed-citation>
</ref>
<ref id="B3">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Augustin</surname> <given-names>M.</given-names></name> <name><surname>Boreiko</surname> <given-names>V.</given-names></name> <name><surname>Croce</surname> <given-names>F.</given-names></name> <name><surname>Hein</surname> <given-names>M.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;Diffusion visual counterfactual explanations,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B4">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Avrahami</surname> <given-names>O.</given-names></name> <name><surname>Lischinski</surname> <given-names>D.</given-names></name> <name><surname>Fried</surname> <given-names>O.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;Blended diffusion for text-driven editing of natural images,&#x0201D;</article-title> in <source>IEEE Conference on Computer Vision and Pattern Recognition</source> (<publisher-loc>Washington, DC</publisher-loc>).</mixed-citation>
</ref>
<ref id="B5">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Chang</surname> <given-names>C.-H.</given-names></name> <name><surname>Caruana</surname> <given-names>R.</given-names></name> <name><surname>Goldenberg</surname> <given-names>A.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;Node-GAM: Neural generalized additive model for interpretable deep learning,&#x0201D;</article-title> in <source>International Conference on Learning Representations</source> (<publisher-loc>Amherst, MA</publisher-loc>: <publisher-name>OpenReview</publisher-name>).</mixed-citation>
</ref>
<ref id="B6">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Dandl</surname> <given-names>S.</given-names></name> <name><surname>Molnar</surname> <given-names>C.</given-names></name> <name><surname>Binder</surname> <given-names>M.</given-names></name> <name><surname>Bischl</surname> <given-names>B.</given-names></name></person-group> (<year>2020</year>). <article-title>&#x0201C;Multi-objective counterfactual explanations,&#x0201D;</article-title> in <source>International Conference on Parallel Problem Solving from Nature</source> (<publisher-loc>Cham</publisher-loc>: <publisher-name>Springer</publisher-name>).</mixed-citation>
</ref>
<ref id="B7">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Dhariwal</surname> <given-names>P.</given-names></name> <name><surname>Nichol</surname> <given-names>A.</given-names></name></person-group> (<year>2021</year>). <article-title>&#x0201C;Diffusion models beat GANs on image synthesis,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B8">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Dieleman</surname> <given-names>S.</given-names></name> <name><surname>Sartran</surname> <given-names>L.</given-names></name> <name><surname>Roshannai</surname> <given-names>A.</given-names></name> <name><surname>Savinov</surname> <given-names>N.</given-names></name> <name><surname>Ganin</surname> <given-names>Y.</given-names></name> <name><surname>Richemond</surname> <given-names>P. H.</given-names></name> <etal/></person-group>. (<year>2022</year>). <article-title>Continuous diffusion for categorical data</article-title>. <source>arXiv</source> [preprint] arXiv:2211.15089. doi: <pub-id pub-id-type="doi">10.48550/arXiv.2211.15089</pub-id></mixed-citation>
</ref>
<ref id="B9">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Duell</surname> <given-names>J.</given-names></name> <name><surname>Seisenberger</surname> <given-names>M.</given-names></name> <name><surname>Fu</surname> <given-names>H.</given-names></name> <name><surname>Fan</surname> <given-names>X.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;QUCE: the minimisation and quantification of path-based uncertainty for generative counterfactual explanations,&#x0201D;</article-title> in <source>2024 IEEE International Conference on Data Mining (ICDM)</source> (<publisher-loc>IEEE</publisher-loc>), <fpage>693</fpage>&#x02013;<lpage>698</lpage>.</mixed-citation>
</ref>
<ref id="B10">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fern&#x000E1;ndez</surname> <given-names>R. R.</given-names></name> <name><surname>De Diego</surname> <given-names>I. M.</given-names></name> <name><surname>Ace na</surname> <given-names>V.</given-names></name> <name><surname>Fern&#x000E1;ndez-Isabel</surname> <given-names>A.</given-names></name> <name><surname>Moguerza</surname> <given-names>J. M.</given-names></name></person-group> (<year>2020</year>). <article-title>Random forest explainability using counterfactual sets</article-title>. <source>Inform. Fusion</source> <volume>63</volume>, <fpage>196</fpage>&#x02013;<lpage>207</lpage>. doi: <pub-id pub-id-type="doi">10.1016/j.inffus.2020.07.001</pub-id></mixed-citation>
</ref>
<ref id="B11">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Galwaduge</surname> <given-names>V.</given-names></name> <name><surname>Samarabandu</surname> <given-names>J.</given-names></name></person-group> (<year>2025</year>). <article-title>Novel actionable counterfactual explanations for intrusion detection using diffusion models</article-title>. <source>J. Cybersecur. Privacy</source> <volume>5</volume>:<fpage>68</fpage>. doi: <pub-id pub-id-type="doi">10.3390/jcp5030068</pub-id></mixed-citation>
</ref>
<ref id="B12">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Goodfellow</surname> <given-names>I.</given-names></name> <name><surname>Pouget-Abadie</surname> <given-names>J.</given-names></name> <name><surname>Mirza</surname> <given-names>M.</given-names></name> <name><surname>Xu</surname> <given-names>B.</given-names></name> <name><surname>Warde-Farley</surname> <given-names>D.</given-names></name> <name><surname>Ozair</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>Generative adversarial networks</article-title>. <source>Commun. ACM</source> <volume>63</volume>, <fpage>139</fpage>&#x02013;<lpage>144</lpage>. doi: <pub-id pub-id-type="doi">10.1145/3422622</pub-id></mixed-citation>
</ref>
<ref id="B13">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Gruver</surname> <given-names>N.</given-names></name> <name><surname>Stanton</surname> <given-names>S.</given-names></name> <name><surname>Frey</surname> <given-names>N.</given-names></name> <name><surname>Rudner</surname> <given-names>T. G.</given-names></name> <name><surname>Hotzel</surname> <given-names>I.</given-names></name> <name><surname>Lafrance-Vanasse</surname> <given-names>J.</given-names></name> <etal/></person-group>. (<year>2024</year>). <article-title>&#x0201C;Protein design with guided discrete diffusion,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B14">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Guidotti</surname> <given-names>R.</given-names></name> <name><surname>Monreale</surname> <given-names>A.</given-names></name> <name><surname>Ruggieri</surname> <given-names>S.</given-names></name> <name><surname>Pedreschi</surname> <given-names>D.</given-names></name> <name><surname>Turini</surname> <given-names>F.</given-names></name> <name><surname>Giannotti</surname> <given-names>F.</given-names></name></person-group> (<year>2018</year>). <article-title>Local rule-based explanations of black box decision systems</article-title>. <source>arXiv</source> [preprint] arXiv:1805.10820. doi: <pub-id pub-id-type="doi">10.48550/arXiv.1805.10820</pub-id></mixed-citation>
</ref>
<ref id="B15">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Guo</surname> <given-names>H.</given-names></name> <name><surname>Jia</surname> <given-names>F.</given-names></name> <name><surname>Chen</surname> <given-names>J.</given-names></name> <name><surname>Squicciarini</surname> <given-names>A.</given-names></name> <name><surname>Yadav</surname> <given-names>A.</given-names></name></person-group> (<year>2023a</year>). <article-title>&#x0201C;Rocoursenet: Robust training of a prediction aware recourse model,&#x0201D;</article-title> in <source>Proceedings of the 32nd ACM International Conference on Information and Knowledge Management</source> (<publisher-loc>New York, NY</publisher-loc>), <fpage>619</fpage>&#x02013;<lpage>628</lpage>.</mixed-citation>
</ref>
<ref id="B16">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Guo</surname> <given-names>H.</given-names></name> <name><surname>Nguyen</surname> <given-names>T. H.</given-names></name> <name><surname>Yadav</surname> <given-names>A.</given-names></name></person-group> (<year>2023b</year>). <article-title>&#x0201C;CounterNet: End-to-end training of prediction aware counterfactual explanations,&#x0201D;</article-title> in <source>Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining</source> (<publisher-loc>New York, NY</publisher-loc>), <fpage>577</fpage>&#x02013;<lpage>589</lpage>. doi: <pub-id pub-id-type="doi">10.1145/3580305.3599290</pub-id></mixed-citation>
</ref>
<ref id="B17">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Ho</surname> <given-names>J.</given-names></name> <name><surname>Jain</surname> <given-names>A.</given-names></name> <name><surname>Abbeel</surname> <given-names>P.</given-names></name></person-group> (<year>2020</year>). <article-title>&#x0201C;Denoising diffusion probabilistic models,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B18">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Hoogeboom</surname> <given-names>E.</given-names></name> <name><surname>Nielsen</surname> <given-names>D.</given-names></name> <name><surname>Jaini</surname> <given-names>P.</given-names></name> <name><surname>Forr&#x000E9;</surname> <given-names>P.</given-names></name> <name><surname>Welling</surname> <given-names>M.</given-names></name></person-group> (<year>2021</year>). <article-title>&#x0201C;Argmax flows and multinomial diffusion: learning categorical distributions,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B19">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Ibrahim</surname> <given-names>M.</given-names></name> <name><surname>Louie</surname> <given-names>M.</given-names></name> <name><surname>Modarres</surname> <given-names>C.</given-names></name> <name><surname>Paisley</surname> <given-names>J.</given-names></name></person-group> (<year>2019</year>). <article-title>&#x0201C;Global explanations of neural networks: Mapping the landscape of predictions,&#x0201D;</article-title> in <source>AAAI/ACM Conference on AI, Ethics, and Society</source> (<publisher-loc>New York, NY</publisher-loc>).</mixed-citation>
</ref>
<ref id="B20">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Jang</surname> <given-names>E.</given-names></name> <name><surname>Gu</surname> <given-names>S.</given-names></name> <name><surname>Poole</surname> <given-names>B.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;Categorical reparameterization with Gumbel-softmax,&#x0201D;</article-title> in <source>International Conference on Learning Representations</source> (<publisher-loc>Amherst, MA</publisher-loc>: <publisher-name>OpenReview</publisher-name>).</mixed-citation>
</ref>
<ref id="B21">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Joshi</surname> <given-names>S.</given-names></name> <name><surname>Koyejo</surname> <given-names>O.</given-names></name> <name><surname>Vijitbenjaronk</surname> <given-names>W.</given-names></name> <name><surname>Kim</surname> <given-names>B.</given-names></name> <name><surname>Ghosh</surname> <given-names>J.</given-names></name></person-group> (<year>2019</year>). <article-title>Towards realistic individual recourse and actionable explanations in black-box decision making systems</article-title>. <source>arXiv</source> [preprint] arXiv:1907.09615. doi: <pub-id pub-id-type="doi">10.48550/arXiv.1907.09615</pub-id></mixed-citation>
</ref>
<ref id="B22">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kingma</surname> <given-names>D. P.</given-names></name></person-group> (<year>2013</year>). <article-title>Auto-encoding variational Bayes</article-title>. <source>arXiv</source> [preprint] arXiv:1312.6114. doi: <pub-id pub-id-type="doi">10.48550/arXiv.1312.6114</pub-id></mixed-citation>
</ref>
<ref id="B23">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Kotelnikov</surname> <given-names>A.</given-names></name> <name><surname>Baranchuk</surname> <given-names>D.</given-names></name> <name><surname>Rubachev</surname> <given-names>I.</given-names></name> <name><surname>Babenko</surname> <given-names>A.</given-names></name></person-group> (<year>2023</year>). <article-title>&#x0201C;TabDDPM: Modelling tabular data with diffusion models,&#x0201D;</article-title> in <source>International Conference on Machine Learning</source> (<publisher-loc>Cambridge, MA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B24">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Liu</surname> <given-names>L. T.</given-names></name> <name><surname>Barocas</surname> <given-names>S.</given-names></name> <name><surname>Kleinberg</surname> <given-names>J.</given-names></name> <name><surname>Levy</surname> <given-names>K.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;On the actionability of outcome prediction,&#x0201D;</article-title> in <source>AAAI Conference on Artificial Intelligence</source> (<publisher-loc>Washington, DC</publisher-loc>).</mixed-citation>
</ref>
<ref id="B25">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Liu</surname> <given-names>L. T.</given-names></name> <name><surname>Dean</surname> <given-names>S.</given-names></name> <name><surname>Rolf</surname> <given-names>E.</given-names></name> <name><surname>Simchowitz</surname> <given-names>M.</given-names></name> <name><surname>Hardt</surname> <given-names>M.</given-names></name></person-group> (<year>2018</year>). <article-title>&#x0201C;Delayed impact of fair machine learning,&#x0201D;</article-title> in <source>International Conference on Machine Learning</source> (<publisher-loc>Cambridge, MA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B26">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Lundberg</surname> <given-names>S.</given-names></name> <name><surname>Lee</surname> <given-names>S.-I.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;A unified approach to interpreting model predictions,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B27">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Madaan</surname> <given-names>N.</given-names></name> <name><surname>Bedathur</surname> <given-names>S.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;Navigating the structured what-if spaces: Counterfactual generation via structured diffusion,&#x0201D;</article-title> in <source>2024 IEEE Conference on Secure and Trustworthy Machine Learning (SaTML)</source> (<publisher-loc>Toronto, ON</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>710</fpage>&#x02013;<lpage>722</lpage>.</mixed-citation>
</ref>
<ref id="B28">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Maddison</surname> <given-names>C. J.</given-names></name> <name><surname>Mnih</surname> <given-names>A.</given-names></name> <name><surname>Teh</surname> <given-names>Y. W.</given-names></name></person-group> (<year>2016</year>). <article-title>The concrete distribution: A continuous relaxation of discrete random variables</article-title>. <source>arXiv</source> [preprint] arXiv:1611.00712. doi: <pub-id pub-id-type="doi">10.48550/arXiv.1611.00712</pub-id></mixed-citation>
</ref>
<ref id="B29">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Mothilal</surname> <given-names>R. K.</given-names></name> <name><surname>Sharma</surname> <given-names>A.</given-names></name> <name><surname>Tan</surname> <given-names>C.</given-names></name></person-group> (<year>2020</year>). <article-title>&#x0201C;Explaining machine learning classifiers through diverse counterfactual explanations,&#x0201D;</article-title> in <source>Conference on Fairness, Accountability, and Transparency</source> (<publisher-loc>New York, NY</publisher-loc>).</mixed-citation>
</ref>
<ref id="B30">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Na</surname> <given-names>S.-H.</given-names></name> <name><surname>Lee</surname> <given-names>S.-W.</given-names></name></person-group> (<year>2025</year>). <article-title>Counterfactual explanation through latent adjustment in disentangled space of diffusion model</article-title>. <source>IEEE Trans. Neural Netw. Learn. Syst</source>. <volume>36</volume>, <fpage>18355</fpage>&#x02013;<lpage>18368</lpage>. doi: <pub-id pub-id-type="doi">10.1109/TNNLS.2025.3580118</pub-id><pub-id pub-id-type="pmid">40553672</pub-id></mixed-citation>
</ref>
<ref id="B31">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Nazabal</surname> <given-names>A.</given-names></name> <name><surname>Olmos</surname> <given-names>P. M.</given-names></name> <name><surname>Ghahramani</surname> <given-names>Z.</given-names></name> <name><surname>Valera</surname> <given-names>I.</given-names></name></person-group> (<year>2020</year>). <article-title>Handling incomplete heterogeneous data using vaes</article-title>. <source>Pattern Recogn</source>. <volume>107</volume>:<fpage>107501</fpage>. doi: <pub-id pub-id-type="doi">10.1016/j.patcog.2020.107501</pub-id></mixed-citation>
</ref>
<ref id="B32">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Nemirovsky</surname> <given-names>D.</given-names></name> <name><surname>Thiebaut</surname> <given-names>N.</given-names></name> <name><surname>Xu</surname> <given-names>Y.</given-names></name> <name><surname>Gupta</surname> <given-names>A.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;CounteRGAN: Generating counterfactuals for real-time recourse and interpretability using residual gans,&#x0201D;</article-title> in <source>Uncertainty in Artificial Intelligence</source> (<publisher-loc>New York</publisher-loc>: <publisher-name>PMLR</publisher-name>), <fpage>1488</fpage>&#x02013;<lpage>1497</lpage>.</mixed-citation>
</ref>
<ref id="B33">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Nichol</surname> <given-names>A. Q.</given-names></name> <name><surname>Dhariwal</surname> <given-names>P.</given-names></name></person-group> (<year>2021</year>). <article-title>&#x0201C;Improved denoising diffusion probabilistic models,&#x0201D;</article-title> in <source>International Conference on Machine Learning</source> (<publisher-loc>Amherst, MA</publisher-loc>: <publisher-name>OpenReview</publisher-name>).</mixed-citation>
</ref>
<ref id="B34">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Nie</surname> <given-names>S.</given-names></name> <name><surname>Zhu</surname> <given-names>F.</given-names></name> <name><surname>You</surname> <given-names>Z.</given-names></name> <name><surname>Zhang</surname> <given-names>X.</given-names></name> <name><surname>Ou</surname> <given-names>J.</given-names></name> <name><surname>Hu</surname> <given-names>J.</given-names></name> <etal/></person-group>. (<year>2025</year>). <article-title>Large language diffusion models</article-title>. <source>arXiv</source> [preprint] arXiv:2502.09992. doi: <pub-id pub-id-type="doi">10.48550/arXiv.2502.09992</pub-id></mixed-citation>
</ref>
<ref id="B35">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Panagiotou</surname> <given-names>E.</given-names></name> <name><surname>Heurich</surname> <given-names>M.</given-names></name> <name><surname>Landgraf</surname> <given-names>T.</given-names></name> <name><surname>Ntoutsi</surname> <given-names>E.</given-names></name></person-group> (<year>2024</year>). &#x0201C;TABCF: Counterfactual explanations for tabular data using a transformer-based VAE,&#x0201D; <italic>Proceedings of the 5th ACM International Conference on AI in Finance</italic> (New York, NY), <fpage>274</fpage>&#x02013;<lpage>282</lpage>.</mixed-citation>
</ref>
<ref id="B36">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Pawelczyk</surname> <given-names>M.</given-names></name> <name><surname>Bielawski</surname> <given-names>S.</given-names></name> <name><surname>Heuvel</surname> <given-names>J.</given-names></name> <name><surname>Richter</surname> <given-names>T.</given-names></name> <name><surname>Kasneci</surname> <given-names>G.</given-names></name></person-group> (<year>2021</year>). <article-title>&#x0201C;CARLA: a Python library to benchmark algorithmic recourse and counterfactual explanation algorithms,&#x0201D;</article-title> in <source>Neural Information Processing Systems Track on Datasets and Benchmarks</source> (<publisher-loc>New York, NY</publisher-loc>: <publisher-name>Association for Computing Machinery</publisher-name>).</mixed-citation>
</ref>
<ref id="B37">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Pawelczyk</surname> <given-names>M.</given-names></name> <name><surname>Broelemann</surname> <given-names>K.</given-names></name> <name><surname>Kasneci</surname> <given-names>G.</given-names></name></person-group> (<year>2020</year>). <article-title>&#x0201C;Learning model-agnostic counterfactual explanations for tabular data,&#x0201D;</article-title> in <source>The Web Conference</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B38">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Poyiadzi</surname> <given-names>R.</given-names></name> <name><surname>Sokol</surname> <given-names>K.</given-names></name> <name><surname>Santos-Rodriguez</surname> <given-names>R.</given-names></name> <name><surname>De Bie</surname> <given-names>T.</given-names></name> <name><surname>Flach</surname> <given-names>P.</given-names></name></person-group> (<year>2020</year>). <article-title>&#x0201C;FACE: feasible and actionable counterfactual explanations,&#x0201D;</article-title> in <source>AAAI/ACM Conference on AI, Ethics, and Society</source> (<publisher-loc>New York, NY</publisher-loc>).</mixed-citation>
</ref>
<ref id="B39">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Radenovic</surname> <given-names>F.</given-names></name> <name><surname>Dubey</surname> <given-names>A.</given-names></name> <name><surname>Mahajan</surname> <given-names>D.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;Neural basis models for interpretability,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source> (<publisher-loc>San Diego, CA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B40">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Regol</surname> <given-names>F.</given-names></name> <name><surname>Coates</surname> <given-names>M.</given-names></name></person-group> (<year>2023</year>). <article-title>&#x0201C;Diffusing Gaussian mixtures for generating categorical data,&#x0201D;</article-title> in <source>AAAI Conference on Artificial Intelligence</source> (<publisher-loc>Washington, DC</publisher-loc>).</mixed-citation>
</ref>
<ref id="B41">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ribeiro</surname> <given-names>M. T.</given-names></name> <name><surname>Singh</surname> <given-names>S.</given-names></name> <name><surname>Guestrin</surname> <given-names>C.</given-names></name></person-group> (<year>2016</year>). &#x0201C;&#x0201C;Why should i trust you?&#x0201D; explaining the predictions of any classifier,&#x0201D; in <italic>International Conference on Knowledge Discovery and Data Mining</italic> (New York, NY).</mixed-citation>
</ref>
<ref id="B42">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Rombach</surname> <given-names>R.</given-names></name> <name><surname>Blattmann</surname> <given-names>A.</given-names></name> <name><surname>Lorenz</surname> <given-names>D.</given-names></name> <name><surname>Esser</surname> <given-names>P.</given-names></name> <name><surname>Ommer</surname> <given-names>B.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;High-resolution image synthesis with latent diffusion models,&#x0201D;</article-title> in <source>Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition</source> (<publisher-loc>New Orleans, LA</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>10684</fpage>&#x02013;<lpage>10695</lpage>.</mixed-citation>
</ref>
<ref id="B43">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sanderson</surname> <given-names>J.</given-names></name> <name><surname>Mao</surname> <given-names>H.</given-names></name> <name><surname>Woo</surname> <given-names>W. L.</given-names></name></person-group> (<year>2025</year>). <article-title>GradCFA: A hybrid gradient-based counterfactual and feature attribution explanation algorithm for local interpretation of neural networks</article-title>. <source>IEEE Trans. Artif. Intellig</source>. <volume>6</volume>, <fpage>2575</fpage>&#x02013;<lpage>2587</lpage>. doi: <pub-id pub-id-type="doi">10.1109/TAI.2025.3552057</pub-id></mixed-citation>
</ref>
<ref id="B44">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schiff</surname> <given-names>Y.</given-names></name> <name><surname>Sahoo</surname> <given-names>S. S.</given-names></name> <name><surname>Phung</surname> <given-names>H.</given-names></name> <name><surname>Wang</surname> <given-names>G.</given-names></name> <name><surname>Boshar</surname> <given-names>S.</given-names></name> <name><surname>Dalla-torre</surname> <given-names>H.</given-names></name> <etal/></person-group>. (<year>2024</year>). <article-title>Simple guidance mechanisms for discrete diffusion models</article-title>. <source>arXiv</source> [preprint] arXiv:2412.10193. doi: <pub-id pub-id-type="doi">10.48550/arXiv.2412.10193</pub-id></mixed-citation>
</ref>
<ref id="B45">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Shrikumar</surname> <given-names>A.</given-names></name> <name><surname>Greenside</surname> <given-names>P.</given-names></name> <name><surname>Kundaje</surname> <given-names>A.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;Learning important features through propagating activation differences,&#x0201D;</article-title> in <source>International Conference on Machine Learning</source> (<publisher-loc>Cambridge, MA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B46">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Sohl-Dickstein</surname> <given-names>J.</given-names></name> <name><surname>Weiss</surname> <given-names>E.</given-names></name> <name><surname>Maheswaranathan</surname> <given-names>N.</given-names></name> <name><surname>Ganguli</surname> <given-names>S.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;Deep unsupervised learning using nonequilibrium thermodynamics,&#x0201D;</article-title> in <source>International Conference on Machine Learning</source> (<publisher-loc>Cambridge, MA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B47">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Song</surname> <given-names>J.</given-names></name> <name><surname>Meng</surname> <given-names>C.</given-names></name> <name><surname>Ermon</surname> <given-names>S.</given-names></name></person-group> (<year>2020</year>). <article-title>Denoising diffusion implicit models</article-title>. <source>arXiv</source> [preprint] arXiv:2010.02502. doi: <pub-id pub-id-type="doi">10.48550/arXiv.2010.02502</pub-id></mixed-citation>
</ref>
<ref id="B48">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Su</surname> <given-names>J.</given-names></name> <name><surname>Vargas</surname> <given-names>D. V.</given-names></name> <name><surname>Sakurai</surname> <given-names>K.</given-names></name></person-group> (<year>2019</year>). <article-title>One pixel attack for fooling deep neural networks</article-title>. <source>IEEE Trans. Evol. Comp</source>. <volume>23</volume>, <fpage>828</fpage>&#x02013;<lpage>841</lpage>. doi: <pub-id pub-id-type="doi">10.1109/TEVC.2019.2890858</pub-id></mixed-citation>
</ref>
<ref id="B49">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Sumiya</surname> <given-names>Y.</given-names></name> <name><surname>Shouno</surname> <given-names>H.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;Model-based counterfactual explanations incorporating feature space attributes for tabular data,&#x0201D;</article-title> in <source>2024 International Joint Conference on Neural Networks (IJCNN)</source> (<publisher-loc>Yokohama</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>1</fpage>&#x02013;<lpage>10</lpage>.</mixed-citation>
</ref>
<ref id="B50">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sun</surname> <given-names>H.</given-names></name> <name><surname>Yu</surname> <given-names>L.</given-names></name> <name><surname>Dai</surname> <given-names>B.</given-names></name> <name><surname>Schuurmans</surname> <given-names>D.</given-names></name> <name><surname>Dai</surname> <given-names>H.</given-names></name></person-group> (<year>2022</year>). <article-title>Score-based continuous-time discrete diffusion models</article-title>. <source>arXiv</source> [preprint] arXiv:2211.16750. doi: <pub-id pub-id-type="doi">10.48550/arXiv.2211.16750</pub-id></mixed-citation>
</ref>
<ref id="B51">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Sundararajan</surname> <given-names>M.</given-names></name> <name><surname>Taly</surname> <given-names>A.</given-names></name> <name><surname>Yan</surname> <given-names>Q.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;Axiomatic attribution for deep networks,&#x0201D;</article-title> in <source>International Conference on Machine Learning</source> (<publisher-loc>Cambridge, MA</publisher-loc>).</mixed-citation>
</ref>
<ref id="B52">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Tsiourvas</surname> <given-names>A.</given-names></name> <name><surname>Sun</surname> <given-names>W.</given-names></name> <name><surname>Perakis</surname> <given-names>G.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;Manifold-aligned counterfactual explanations for neural networks,&#x0201D;</article-title> in <source>International Conference on Artificial Intelligence and Statistics</source> (<publisher-loc>New York</publisher-loc>: <publisher-name>PMLR</publisher-name>), <fpage>3763</fpage>&#x02013;<lpage>3771</lpage>.</mixed-citation>
</ref>
<ref id="B53">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Van Looveren</surname> <given-names>A.</given-names></name> <name><surname>Klaise</surname> <given-names>J.</given-names></name></person-group> (<year>2021</year>). <article-title>&#x0201C;Interpretable counterfactual explanations guided by prototypes,&#x0201D;</article-title> in <source>Joint European Conference on Machine Learning and Knowledge Discovery in Databases</source> (<publisher-loc>Cham</publisher-loc>: <publisher-name>Springer</publisher-name>).</mixed-citation>
</ref>
<ref id="B54">
<mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wachter</surname> <given-names>S.</given-names></name> <name><surname>Mittelstadt</surname> <given-names>B.</given-names></name> <name><surname>Russell</surname> <given-names>C.</given-names></name></person-group> (<year>2017</year>). <article-title>Counterfactual explanations without opening the black box: Automated decisions and the GDPR</article-title>. <source>Harv. J. Law</source> &#x00026; <italic>Tech</italic>. <volume>31</volume>:<fpage>841</fpage>. doi: <pub-id pub-id-type="doi">10.2139/ssrn.3063289</pub-id></mixed-citation>
</ref>
<ref id="B55">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Zhang</surname> <given-names>W.</given-names></name> <name><surname>Barr</surname> <given-names>B.</given-names></name> <name><surname>Paisley</surname> <given-names>J.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;An interpretable deep classifier for counterfactual generation,&#x0201D;</article-title> in <source>Proceedings of the Third ACM International Conference on AI in Finance</source> (<publisher-loc>New York, NY</publisher-loc>), <fpage>36</fpage>&#x02013;<lpage>43</lpage>.</mixed-citation>
</ref>
<ref id="B56">
<mixed-citation publication-type="book"><person-group person-group-type="author"><name><surname>Zhang</surname> <given-names>W.</given-names></name> <name><surname>Barr</surname> <given-names>B.</given-names></name> <name><surname>Paisley</surname> <given-names>J.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;Gaussian process neural additive models,&#x0201D;</article-title> in <source>AAAI Conference on Artificial Intelligence</source> (<publisher-loc>Washington, DC</publisher-loc>).</mixed-citation>
</ref>
</ref-list>
<fn-group>
<fn fn-type="custom" custom-type="edited-by" id="fn0001">
<p>Edited by: <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/1839967/overview">Kesheng Wu</ext-link>, Berkeley Lab (DOE), United States</p>
</fn>
<fn fn-type="custom" custom-type="reviewed-by" id="fn0002">
<p>Reviewed by: <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/3288436/overview">Jacob Sanderson</ext-link>, Northumbria University, United Kingdom</p>
<p><ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/3320715/overview">Tang Li</ext-link>, University of Delaware, United States</p>
</fn>
</fn-group>
</back>
</article>