Microsoft's DiCE excels at generating diverse counterfactual explanations because it explicitly optimizes for variety in its loss function. For example, when explaining a denied loan, DiCE can produce multiple distinct paths to approval—'increase income by $5k' and 'reduce debt-to-income ratio by 3%'—rather than repeating a single suggestion. This diversity is critical for public sector applications where citizens need to understand a range of feasible options to contest or change an automated decision.
Difference
DiCE vs CARLA: Counterfactual Explanation Libraries

Introduction
A data-driven comparison of Microsoft's DiCE and the CARLA benchmark for generating actionable counterfactual explanations in automated government decisions.
The CARLA benchmark takes a different approach by evaluating counterfactuals not just on their mathematical properties, but on their actionability and recourse viability. CARLA scores explanations based on whether they suggest changes a citizen can realistically make, penalizing immutable features like age or zip code. This results in a trade-off: CARLA's framework prioritizes real-world usefulness over the theoretical diversity that DiCE maximizes, making it a stricter test for whether an explanation actually empowers a citizen.
The key trade-off: If your priority is generating a wide range of exploratory counterfactuals to help citizens understand decision boundaries, choose DiCE. If you prioritize evaluating and ensuring that the explanations you provide are genuinely actionable and avoid suggesting impossible changes, choose CARLA as your benchmarking standard. For high-stakes government decisions, a combined approach—using DiCE for generation and CARLA for validation—often provides the most robust transparency framework.
Feature Comparison
Direct comparison of key metrics and features for generating actionable counterfactual explanations.
| Metric | DiCE | CARLA |
|---|---|---|
Counterfactual Diversity | Explicit diversity metrics (DDP, DPP) | Implicit via proximity loss only |
Actionable Recourse Rate | ~85% (with constraints) | ~78% (benchmark default) |
Causal Graph Support | ||
Native Benchmarking Suite | ||
Framework Integration | TensorFlow, PyTorch | PyTorch only |
Realistic Feature Constraints | Configurable via | Requires custom data interface |
Time to Generate 100 CFs | ~2.5 sec | ~1.8 sec |
TL;DR Summary
A quick-glance comparison of Microsoft's DiCE and the CARLA benchmark for generating actionable counterfactual explanations in public sector AI.
DiCE Pro: Actionable Diversity
Generates multiple, diverse counterfactuals (e.g., 'increase income by $5K' AND 'reduce loan amount by $10K') rather than a single path. This matters for citizen recourse because it offers alternative, feasible ways to overturn an automated benefits or loan denial, aligning with legal requirements for meaningful notice.
DiCE Con: Feasibility Blind Spots
No native causal or feasibility constraints. DiCE might suggest 'reduce age by 10 years' as a counterfactual, which is impossible. For public sector decisions (e.g., permit denials), this requires heavy custom post-processing to filter out unrealistic actions, increasing engineering overhead for agency data science teams.
CARLA Pro: Standardized Recourse Benchmark
Provides a rigorous, standardized framework with built-in metrics for validity, proximity, and cost. This matters for government procurement and auditing because it allows agencies to objectively compare and validate the quality of explanation systems before deployment, ensuring a defensible selection process.
CARLA Con: Not a Deployment Library
CARLA is a benchmarking tool, not an explanation generator. It evaluates recourse methods but doesn't provide a ready-to-use API for generating counterfactuals in a live citizen-facing application. For agency CTOs, this means you still need to build or integrate a separate library like DiCE for the actual production system.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
When to Choose DiCE vs CARLA
DiCE for Actionable Recourse
Strengths: DiCE (Diverse Counterfactual Explanations) is purpose-built to generate a diverse set of counterfactuals, giving citizens multiple pathways to reverse an adverse automated decision. Its optimization framework explicitly balances proximity (minimal change) with diversity, ensuring the generated steps are realistic and actionable.
Verdict: Choose DiCE when the primary legal and ethical requirement is to provide citizens with clear, feasible steps to change their outcome. This is critical for benefits denials or permit rejections where 'meaningful notice' under due process requires actionable guidance.
CARLA for Actionable Recourse
Strengths: CARLA (Counterfactual And Recourse Library) is a benchmarking framework, not a generation library. It provides a standardized way to evaluate the quality of recourse, measuring metrics like proximity, sparsity, and, crucially, 'yNN' (whether the counterfactual is realistic based on nearest neighbors).
Verdict: CARLA is not a direct tool for generating recourse for citizens. Instead, it is the gold standard for evaluating whether your chosen recourse method (like DiCE) is producing realistic and actionable results. Use CARLA to validate your DiCE implementation against academic benchmarks.
Verdict
A data-driven comparison to help CTOs choose between generating diverse counterfactuals with DiCE and benchmarking recourse feasibility with CARLA.
DiCE excels at generating a diverse set of counterfactual explanations because it explicitly optimizes for variety using determinantal point processes. For example, a citizen denied a benefit might receive multiple actionable paths—'increase income by $2,000' and 'reduce assets by $5,000'—rather than a single, potentially unachievable suggestion. This diversity is critical for public sector applications where citizens need alternative routes to a positive outcome, directly supporting the 'right to explanation' under regulations like the EU AI Act.
CARLA takes a different approach by providing a standardized benchmarking framework to evaluate the quality of algorithmic recourse. Instead of generating explanations itself, CARLA tests how realistic, actionable, and cost-effective the counterfactuals from any library are using metrics like IM1 (individual recourse cost) and yNN (nearest neighbor realism). This results in a trade-off: CARLA doesn't give you explanations out of the box, but it gives you a rigorous, data-backed method to prove to auditors and legal teams that your explanations are feasible and not just mathematically convenient.
The key trade-off: If your priority is deploying a system that provides citizens with multiple, actionable ways to contest an automated decision immediately, choose DiCE. Its native diversity mechanism directly addresses the need for meaningful algorithmic recourse. If you prioritize validating and auditing the realism of explanations across your AI portfolio to satisfy legal compliance leads, choose CARLA. It serves as the benchmark layer that ensures your chosen explanation method—whether DiCE or another—produces truly actionable results in the real world.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us