Counterfactual explanations play a pivotal role in explainable artificial intelligence (XAI) by offering intuitive, human-understandable alternatives that elucidate machine learning model decisions. Despite their significance, existing methods for generating counterfactuals often require constant access to the predictive model, involve computationally intensive optimization for each instance and lack the flexibility to adapt to new user-defined constraints without retraining. In this paper, we propose DiCoFlex, a novel model-agnostic, conditional generative framework that produces multiple diverse counterfactuals in a single forward pass. Leveraging conditional normalizing flows trained solely on labeled data, DiCoFlex addresses key limitations by enabling real-time user-driven customization of constraints such as sparsity and actionability at inference time. Extensive experiments on standard benchmark datasets show that DiCoFlex outperforms existing methods in terms of validity, diversity, proximity, and constraint adherence, making it a practical and scalable solution for counterfactual generation in sensitive decision-making domains.
翻译:反事实解释在可解释人工智能(XAI)中发挥着关键作用,通过提供直观、人类可理解的替代方案来阐明机器学习模型的决策。尽管其重要性显著,现有生成反事实的方法通常需要持续访问预测模型,涉及对每个实例进行计算密集的优化,并且缺乏在不重新训练的情况下适应新用户定义约束的灵活性。本文提出DiCoFlex,一种新颖的模型无关条件生成框架,可在单次前向传播中生成多个多样化的反事实。通过利用仅基于标注数据训练的条件归一化流,DiCoFlex解决了关键限制,支持在推理时实时根据用户需求定制稀疏性和可操作性等约束。在标准基准数据集上的大量实验表明,DiCoFlex在有效性、多样性、邻近性和约束遵循方面优于现有方法,使其成为敏感决策领域中反事实生成的实用且可扩展的解决方案。