Table of Contents
Fetching ...

Improving Counterfactual Truthfulness for Molecular Property Prediction through Uncertainty Quantification

Jonas Teufel, Annika Leinweber, Pascal Friederich

TL;DR

The paper tackles boosting the trustworthiness of counterfactual explanations for molecular property prediction by leveraging uncertainty quantification to filter high-uncertainty counterfactual candidates. It defines counterfactual truthfulness in regression via non-overlapping ground-truth error intervals and introduces UER-AUC as a threshold-agnostic measure of uncertainty-based error reduction. Through extensive experiments on deterministic and real-world molecular datasets, it demonstrates that ensembles, mean-variance estimation, and their combination substantially reduce predictive error and enhance counterfactual truthfulness, with pronounced gains under distributional shifts. The findings highlight uncertainty estimation as a practical and effective component for improving XAI in chemistry and materials science, suggesting simple ensemble approaches already yield meaningful improvements and that further gains can arise from combining UQ with counterfactual generation or extending to other explanation modalities.

Abstract

Explainable AI (xAI) interventions aim to improve interpretability for complex black-box models, not only to improve user trust but also as a means to extract scientific insights from high-performing predictive systems. In molecular property prediction, counterfactual explanations offer a way to understand predictive behavior by highlighting which minimal perturbations in the input molecular structure cause the greatest deviation in the predicted property. However, such explanations only allow for meaningful scientific insights if they reflect the distribution of the true underlying property -- a feature we define as counterfactual truthfulness. To increase this truthfulness, we propose the integration of uncertainty estimation techniques to filter counterfactual candidates with high predicted uncertainty. Through computational experiments with synthetic and real-world datasets, we demonstrate that traditional uncertainty estimation methods, such as ensembles and mean-variance estimation, can already substantially reduce the average prediction error and increase counterfactual truthfulness, especially for out-of-distribution settings. Our results highlight the importance and potential impact of incorporating uncertainty estimation into explainability methods, especially considering the relatively high effectiveness of low-effort interventions like model ensembles.

Improving Counterfactual Truthfulness for Molecular Property Prediction through Uncertainty Quantification

TL;DR

The paper tackles boosting the trustworthiness of counterfactual explanations for molecular property prediction by leveraging uncertainty quantification to filter high-uncertainty counterfactual candidates. It defines counterfactual truthfulness in regression via non-overlapping ground-truth error intervals and introduces UER-AUC as a threshold-agnostic measure of uncertainty-based error reduction. Through extensive experiments on deterministic and real-world molecular datasets, it demonstrates that ensembles, mean-variance estimation, and their combination substantially reduce predictive error and enhance counterfactual truthfulness, with pronounced gains under distributional shifts. The findings highlight uncertainty estimation as a practical and effective component for improving XAI in chemistry and materials science, suggesting simple ensemble approaches already yield meaningful improvements and that further gains can arise from combining UQ with counterfactual generation or extending to other explanation modalities.

Abstract

Explainable AI (xAI) interventions aim to improve interpretability for complex black-box models, not only to improve user trust but also as a means to extract scientific insights from high-performing predictive systems. In molecular property prediction, counterfactual explanations offer a way to understand predictive behavior by highlighting which minimal perturbations in the input molecular structure cause the greatest deviation in the predicted property. However, such explanations only allow for meaningful scientific insights if they reflect the distribution of the true underlying property -- a feature we define as counterfactual truthfulness. To increase this truthfulness, we propose the integration of uncertainty estimation techniques to filter counterfactual candidates with high predicted uncertainty. Through computational experiments with synthetic and real-world datasets, we demonstrate that traditional uncertainty estimation methods, such as ensembles and mean-variance estimation, can already substantially reduce the average prediction error and increase counterfactual truthfulness, especially for out-of-distribution settings. Our results highlight the importance and potential impact of incorporating uncertainty estimation into explainability methods, especially considering the relatively high effectiveness of low-effort interventions like model ensembles.

Paper Structure

This paper contains 34 sections, 17 equations, 5 figures, 4 tables.

Figures (5)

  • Figure 1: a Truthful explanations should not only reflect the model's behavior but also the properties of the underlying true data distribution. b Uncertainty quantification methods predict an additional uncertainty value as an approximation of the model's prediction error. By filtering high-uncertainty elements, it is possible to reduce the cumulative error and, by extension, the fraction of truthful counterfactuals of the remaining set.
  • Figure 2: a Evaluation of the uncertainty-based error reduction over many different thresholds yields characteristic error reduction curves. The Area under the uncertainty error reduction curve (UER-AUC) provides a generic metric for the error reduction potential independent of a specific threshold choice. b Truthful counterfactuals are defined as those whose prediction error interval does not overlap with that of its corresponding original element. Besides a reduction of the cumulative error, filtering by uncertainty thresholds may also increase the relative fraction of truthful counterfactuals.
  • Figure 3: Results for 5 independent repetitions of a GATv2 trained on the ClogP dataset and uncertainties estimated with a combination of ensembles and mean variance estimation in the OOD-Value scenario. Panels from left to right illustrate the correlation between the predicted uncertainty & model error, the mean error reduction potential, and the max error reduction potential through filtering by uncertainty thresholds. Faint lines represent the results of individual runs; bold lines represent the overall average.
  • Figure 4: Qualitative results of uncertainty-based counterfactual filtering for two example molecules. Predictions are made by a GATv2 graph neural network and uncertainties are estimated by a combination of ensembling and mean-variance estimation. The uncertainty threshold $\xi_{20}$ was chosen on the test set such that the 20% lowest uncertainty elements remain.
  • Figure 5: Results for 5 independent repetitions of computational experiment on the ClogP dataset to evaluate counterfactual truthfulness. Individual results are plotted transparently in the background, and average curves are indicated with bold lines. All plots are based on the set of counterfactuals and show from left to right: The relative mean error reduction, the Truthfulness, and the percentage of remaining counterfactuals for different uncertainty thresholds. Results are obtained by a GATv2 graph neural network, and uncertainties are estimated by an ensemble of mean variance estimators.