ExplainabilityTransparencyTrustworthinesscs.LG
xai-cola: A Python library for sparsifying counterfactual explanations
Lin Zhu, Lei You
February 25, 2026
arXiv.org
Key Takeaways
-
Counterfactual explanations often contain unnecessary information: The paper identifies that current AI explanation methods produce redundant counterfactuals—explanations showing what would need to change for a different outcome—with many irrelevant feature modifications included alongside the essential ones.
-
A new tool makes explanations simpler and more useful: xai-cola is an open-source library that removes superfluous details from counterfactual explanations while keeping them valid, reducing the number of modified features by up to 50% across different explanation generators, making AI decisions easier for non-experts to understand.
-
Simpler explanations maintain their accuracy: The sparsification process doesn't compromise the validity of explanations—the simplified counterfactuals still correctly show what would need to change for an AI system to reach a different decision, just with less clutter.
-
The tool is designed for practical accessibility: xai-cola works with common data formats (pandas DataFrames) and popular machine learning frameworks (scikit-learn and PyTorch), making it accessible to practitioners without requiring specialized expertise in explainability research.
-
Visualization helps compare different explanations: The library includes tools to analyze and visually compare sparsified counterfactuals, helping stakeholders better understand and evaluate AI decision-making across different scenarios.