Papers
Topics
Authors
Recent
Search
2000 character limit reached

Counterfactual Evaluation (CFE)

Updated 7 July 2026
  • Counterfactual Evaluation (CFE) is a family of methods that assess systems by replacing factual conditions with controlled alternatives.
  • It applies to various domains—from measuring explanation faithfulness and recourse quality to evaluating policy impacts and LLM security—using metrics like validity and proximity.
  • The approach highlights both practical benefits and challenges, such as aligning designer metrics with user preferences and managing underlying assumptions.

Searching arXiv for papers on “counterfactual evaluation” and closely related usages. Search query 1: "counterfactual evaluation" arXiv papers. Counterfactual Evaluation (CFE) denotes a family of evaluation procedures in which a model, an explanation, a policy, or an evaluator is assessed by comparing its behavior in the factual setting with its behavior under deliberately altered alternatives. Across recent machine-learning literature, the term appears in several distinct but structurally related senses: faithfulness evaluation of feature attributions by counterfactual editing, evaluation of counterfactual explanations themselves by automatic or human-centered criteria, counterfactual assessment of decision-support systems and policies under alternative interventions, and auditing of LLM-based evaluators by re-running them under false ground truths (Ge et al., 2021, Choudhury et al., 20 Jul 2025, Coston et al., 2019, Liu et al., 31 Jul 2025). This suggests that CFE is less a single metric than a recurring evaluation pattern: change the relevant “world,” then test whether the observed judgment, prediction, or recommendation still holds.

1. Conceptual scope

Different literatures use “Counterfactual Evaluation” for different objects, but all of them replace an observed condition with a carefully defined alternative and inspect the induced behavioral change.

Setting Object being evaluated Counterfactual mechanism
Faithfulness of explanations Feature-attribution explanation Edit the explained features and test whether the model output changes (Ge et al., 2021)
Quality of CFEs Counterfactual explanation itself Compare recourses by proximity, sparsity, plausibility, diversity, or user preference (Choudhury et al., 20 Jul 2025)
Decision-support and policy assessment Risk model or treatment assignment function Replace observed outcomes with potential outcomes or alternative assignments (Coston et al., 2019)
Robustness to deployment change Counterfactual explanation under retraining Evaluate whether the CFE remains valid across admissible model changes (Stępka et al., 2024)
LLM evaluation-system security Evaluator LLM Re-evaluate a submission under a deliberately false ground truth (Liu et al., 31 Jul 2025)

This range is important because identical terminology can otherwise obscure different targets. In one line of work, the evaluated object is the explanation method; in another, it is the downstream decision rule; in another, it is the evaluator itself. A plausible implication is that CFE should be read in context as a relation between an evaluated object and a chosen family of counterfactual worlds, rather than as a fixed benchmark name.

2. Faithfulness via counterfactual intervention

A canonical formalization appears in “Counterfactual Evaluation for Explainable AI” (Ge et al., 2021). There, the central question is whether an explanation identifies features that the model truly relied on. The paper argues that common erasure-based criteria are biased because deletion can collapse distinct originals into the same corrupted input and can move examples outside the data distribution. The proposed alternative is to change only the features selected by the explanation and ask whether the model output changes under a proper counterfactual edit.

For input xi\mathbf{x}_i, prediction y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i), and explanation feature set eki\mathbf{e}_k^i, the method generates a counterfactual xicf\mathbf{x}_i^{\mathrm{cf}} by editing only eki\mathbf{e}_k^i. It then evaluates two quantities: Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}}) and

Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).

These are combined as

C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.

When probabilities are available, the paper also defines soft versions using the drop in original-class confidence.

The method distinguishes discrete and continuous settings. For categorical features it uses exhaustive search over the selected-feature subspace; for continuous settings it optimizes a relaxed objective in embedding space, minimizing perturbation while penalizing retention of the original class. In both cases, the evaluation is local to the explanation under test: the rest of the input is held fixed, so the measured output change is attributed specifically to the claimed important features.

The reported empirical result is that this counterfactual faithfulness criterion aligned more closely with white-box ground truth than erasure-based baselines. On Adults, C(disc.)\mathcal{C}(\mathrm{disc.}) matched the ground-truth ranking exactly with Kendall’s τ=1.0\tau=1.0 and Spearman’s y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)0, whereas Decision Flip Ratio achieved y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)1 and y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)2 (Ge et al., 2021). On Movie Reviews, both y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)3 and y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)4 reached y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)5 and y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)6. In this formulation, CFE is therefore a test of explanation faithfulness by behavioral intervention rather than by deletion.

3. Evaluating counterfactual explanations as artifacts

A second major usage evaluates counterfactual explanations themselves. “Designing User-Centric Metrics for Evaluation of Counterfactual Explanations” argues that designer-centric criteria such as proximity and sparsity are often only imperfect proxies for what affected users actually prefer (Choudhury et al., 20 Jul 2025). In its pilot study, user-preferred CFEs matched proximity in only y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)7 of cases and matched sparsity in only y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)8 of cases. In the main two-day study, participants selected recourses optimized on personalized weighted proximity y^i=F(xi)\hat{y}_i=\mathcal{F}(\mathbf{x}_i)9 of the time, and the proposed Acceptability Weighted Proximity (AWP) model predicted user-preferred CFEs with eki\mathbf{e}_k^i0 accuracy on the subset of cases where both alternatives passed the acceptability filter. The AWP rule is two-stage: first reject any recourse whose feature change exceeds the user’s threshold eki\mathbf{e}_k^i1; then choose the acceptable recourse minimizing personalized weighted proximity,

eki\mathbf{e}_k^i2

This human-centered perspective is reinforced by “For Better or Worse: The Impact of Counterfactual Explanations’ Directionality on User Behavior in xAI,” which evaluates CFEs by behavioral outcomes rather than geometry alone (Kuhl et al., 2023). In an interactive learning task, upward CFEs yielded a significant performance advantage over downward CFEs and no-explanation control. The group-by-trial interaction was

eki\mathbf{e}_k^i3

and upward CFEs significantly outperformed downward CFEs from trial 7 onward. Yet subjective explanation ratings did not show a significant group effect, indicating that perceived quality and actual utility can diverge.

Benchmarking work extends this evaluation logic to textual CFEs. “CEval: A Benchmark for Evaluating Counterfactual Text Generation” standardizes datasets, baselines, and metrics for counterfactual text generation (Nguyen et al., 2024). It separates counterfactual-specific metrics—Flip Rate, Probability Change eki\mathbf{e}_k^i4, Token Distance, Perplexity, Diversity—from text-quality dimensions—fluency, cohesiveness, likability, and grammar. Its central empirical conclusion is that no single method dominates: methods strong on counterfactual criteria often degrade linguistic quality, while simple LLM prompting can yield strong text quality but weak label flipping.

Taken together, these papers shift CFE away from purely geometric minimality. In this literature, an explanation can be valid yet still score poorly because it misaligns with user thresholds, impairs task performance, or produces low-quality text.

4. Task-specific and robustness-oriented extensions

As CFE moved into specialized modalities, its evaluation criteria became increasingly task-dependent. In search-result explanation, “Counterfactual Editing for Search Result Explanation” defines a counterfactual explanation as a modified query eki\mathbf{e}_k^i5 such that for an original query–document pair eki\mathbf{e}_k^i6 with eki\mathbf{e}_k^i7, the counterfactual satisfies eki\mathbf{e}_k^i8 (Xu et al., 2023). Evaluation is then organized around FlipRate, CosSim, BERTScore-F1, RelFluency, and Runtime. Here, CFE measures the quality of actionable query reformulations rather than the faithfulness of a classifier explanation.

In agronomic zoning, “Counterfactual Analysis of Neural Networks Used to Create Fertilizer Management Zones” evaluates CFEs over cluster assignments induced by CNN-generated nitrogen response curves (Morales et al., 2024). For a local window eki\mathbf{e}_k^i9, the counterfactual window xicf\mathbf{x}_i^{\mathrm{cf}}0 is optimized with three objectives: a validity term xicf\mathbf{x}_i^{\mathrm{cf}}1 requiring changed cluster assignment with membership above threshold xicf\mathbf{x}_i^{\mathrm{cf}}2, a sparsity term

xicf\mathbf{x}_i^{\mathrm{cf}}3

and a proximity term

xicf\mathbf{x}_i^{\mathrm{cf}}4

The reported analysis identified slope, aspect, topographic position index, and xicf\mathbf{x}_i^{\mathrm{cf}}5 as the dominant variables for altering management-zone membership.

For continuous biomedical time series, “EvoMorph” reformulates validity itself (Ceylan et al., 15 Jan 2026). Instead of a class flip, a counterfactual for time-series extrinsic regression must place the model output inside a target interval

xicf\mathbf{x}_i^{\mathrm{cf}}6

Evaluation uses normalized DTW proximity, xicf\mathbf{x}_i^{\mathrm{cf}}7-NN plausibility, temporal sparsity, frequency sparsity, maximum-gradient smoothness, and diversity. The paper reports, for example, EvoMorph validity of xicf\mathbf{x}_i^{\mathrm{cf}}8 on BIDMCHR, with diversity xicf\mathbf{x}_i^{\mathrm{cf}}9, and argues that morphology-aware evaluation is required because small raw-domain changes can still be physiologically implausible.

Robustness to model change constitutes another extension. “Counterfactual Explanations with Probabilistic Guarantees on their Robustness to Model Change” defines a CFE as eki\mathbf{e}_k^i0-robust if

eki\mathbf{e}_k^i1

and as eki\mathbf{e}_k^i2-robust if

eki\mathbf{e}_k^i3

under a Beta posterior over the unknown robustness probability (Stępka et al., 2024). The post-hoc BetaRCE method then searches for the nearest robust valid CFE to a base explanation. This makes robustness itself an evaluation target, alongside proximity, plausibility, and distance to base.

A broader pattern also appears in optimization-centric work. “Scaling Guarantees for Nearest Counterfactual Explanations” treats validity, proximity, coverage, and diversity as first-class evaluation axes and strengthens them by exact mixed-integer optimization (Mohammadi et al., 2020). “ACE” emphasizes sample efficiency under label-only black-box access and makes the number of black-box evaluations eki\mathbf{e}_k^i4 the most heavily weighted quantity in its aggregate score (Guerrero et al., 30 Sep 2025). These papers suggest that, in some subfields, evaluation criteria are increasingly built into the generation procedure itself.

5. Counterfactual evaluation in decision-support and policy assessment

A different lineage uses CFE to evaluate predictive systems whose observed outcomes are already affected by past interventions. “Counterfactual Risk Assessments, Evaluation, and Fairness” argues that risk assessment instruments should be evaluated against the counterfactual outcome under a specified decision option, typically baseline treatment eki\mathbf{e}_k^i5, rather than against the observed outcome eki\mathbf{e}_k^i6 (Coston et al., 2019). The target quantity is

eki\mathbf{e}_k^i7

not eki\mathbf{e}_k^i8. On this basis, the paper defines counterfactual analogues of common predictive metrics, including counterfactual TPR,

eki\mathbf{e}_k^i9

counterfactual precision,

Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})0

counterfactual FPR,

Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})1

and counterfactual calibration. Estimation is performed with doubly robust estimators, such as

Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})2

The paper further defines counterfactual fairness notions such as counterfactual predictive parity and counterfactual equalized odds, and shows that these generally do not coincide with standard observational fairness except under strong conditions.

When observational data are networked and hidden confounding is suspected, “Counterfactual Evaluation of Treatment Assignment Functions with Networked Observational Data” introduces CONE (Guo et al., 2019). It learns two graph-attention representations, one treatment-supervised and one outcome-supervised, aligns them through mutual information, concatenates them into a proxy confounder representation, and plugs that representation into a doubly robust evaluator. The target policy value is

Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})3

Empirically, CONE achieved lower RMSE and MAE than feature-only baselines on BlogCatalog and Flickr, especially when network-driven hidden confounding was stronger.

In autonomous driving, the term appears in a simulator-based operational form. “Counterfactual Policy Evaluation for Decision-Making in Autonomous Driving” constructs counterfactual worlds by replacing one nearby vehicle’s policy at a time and simulating forward over horizon Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})4s (Hart et al., 2020). For each perturbed vehicle, collision probability is estimated as

Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})5

and averaged into

Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})6

The learned ego policy is executed only if Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})7; otherwise a fallback controller is used. With Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})8, the paper reports that the learned policy was executed Validity=1Ni=1NI(y^iy^icf)Validity = \frac{1}{N} \sum_{i=1}^{N} I(\hat{y}_{i} \neq \hat{y}_{i}^{\mathrm{cf}})9 of the time, with success rate Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).0 and collision rate Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).1. Here, CFE functions as a runtime safety gate under alternative behaviors of other agents.

6. Counterfactual evaluation for LLM-based evaluation systems

A recent usage applies CFE to the evaluator rather than to the task model. “Counterfactual Evaluation for Blind Attack Detection in LLM-based Evaluation Systems” studies LLM-based question-answering evaluators that receive a question Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).2, true answer Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).3, and submitted answer Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).4, and output a binary judgment (Liu et al., 31 Jul 2025). The paper formalizes a blind attack as a response strategy Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).5 such that the evaluator output is conditionally independent of the true answer: Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).6 This yields the invariance relation

Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).7

The proposed defense augments Standard Evaluation (SE) with Counterfactual Evaluation (CFE). After ordinary evaluation against the real answer Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).8, the system generates a fake answer Proximity=1Ni=1Ndist(xi,xicf).Proximity = \frac{1}{N} \sum_{i=1}^{N} \mathrm{dist}(x_{i},x_{i}^{\mathrm{cf}}).9 and re-evaluates the same submission under the assumption that C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.0 is the only correct answer. The decision table is:

  • SE = 1, CFE = 0 C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.1 Correct answer
  • SE = 1, CFE = 1 C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.2 Attack detected
  • SE = 0, CFE = * C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.3 Wrong answer

The intuition is that a legitimate answer should pass in the true world and fail in the fake world, whereas a blind attack designed to make the evaluator say “correct” regardless of C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.4 will often pass in both worlds. The experiments focus primarily on reworded-question attacks. Under SE alone, attack success rates were extremely high, including C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.5 for GPT-4o-mini, C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.6 for GPT-4o, and C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.7 for o1. Under SE+CFE, these same models detected attacks with very high accuracy; for o1, attack precision was C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.8, attack F1 was C=ValidityProximity.\mathcal{C} = \frac{\text{Validity}}{\text{Proximity}}.9, and overall accuracy was C(disc.)\mathcal{C}(\mathrm{disc.})0. The paper also states clear scope limits: CFE is designed for blind attacks and does not guarantee protection against adaptive answer-aware attacks.

7. Recurring structure and unresolved issues

Across these literatures, several recurring evaluation dimensions appear: validity, proximity, sparsity, plausibility, diversity, coverage, robustness, and cost. What differs is the meaning of “validity.” In explanation faithfulness, validity is whether editing the explained features changes the model output (Ge et al., 2021). In recourse evaluation, it is whether a counterfactual is acceptable to users or remains robust under model change (Choudhury et al., 20 Jul 2025, Stępka et al., 2024). In policy evaluation, it is whether the assessed quantity targets the relevant potential outcome rather than the historically observed one (Coston et al., 2019). In LLM evaluator security, it is whether a submission’s acceptance depends on the real answer rather than surviving a counterfactual false-answer world (Liu et al., 31 Jul 2025).

The literature also repeatedly identifies limitations of purely designer-centric metrics. User-preferred recourses do not reliably coincide with standard proximity or sparsity (Choudhury et al., 20 Jul 2025); subjective explanation ratings may fail to track behavioral utility (Kuhl et al., 2023); static validity can break under model retraining (Stępka et al., 2024); and observed predictive performance can mis-evaluate models meant to predict risk under intervention rather than under historical policy (Coston et al., 2019). This suggests that CFE often functions as a corrective to evaluations that are internally consistent but externally misaligned.

A second recurring issue is the role of assumptions. Counterfactual fairness metrics depend on exchangeability and positivity assumptions (Coston et al., 2019). Network-based CFE depends on the network being informative about latent confounders (Guo et al., 2019). BetaRCE’s guarantees depend on the specified admissible model space (Stępka et al., 2024). LLM-based evaluator CFE assumes that the fake answer is unrelated to the true one and that the evaluator follows the counterfactual prompt reliably (Liu et al., 31 Jul 2025). In this sense, CFE rarely removes assumptions; it relocates them into the definition of the alternative world.

A final implication is that CFE has become a general methodology for testing whether a system’s behavior is genuinely grounded in the factor it is supposed to depend on. Whether the object is a feature attribution, a recourse recommendation, a risk score, a treatment policy, or an evaluator LLM, the core question is structurally similar: if the relevant condition were changed while other structure were preserved, would the judgment still behave as claimed?

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Counterfactual Evaluation (CFE).