Inferensys

Difference

DiCE vs CARLA: Counterfactual Explanation Libraries

A technical comparison of Microsoft's DiCE and the CARLA benchmark for generating actionable counterfactual explanations in automated government decision-making. Evaluates diversity, feasibility, and citizen recourse.
Cinematic overhead of a WeWork creative suite room with multiple curved monitors showing AI decision dashboards, executives in casual attire reviewing data, dramatic pendant lighting.
THE ANALYSIS

Introduction

A data-driven comparison of Microsoft's DiCE and the CARLA benchmark for generating actionable counterfactual explanations in automated government decisions.

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.

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.

HEAD-TO-HEAD COMPARISON

Feature Comparison

Direct comparison of key metrics and features for generating actionable counterfactual explanations.

MetricDiCECARLA

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 features_to_vary

Requires custom data interface

Time to Generate 100 CFs

~2.5 sec

~1.8 sec

DiCE vs CARLA: Pros & Cons

TL;DR Summary

A quick-glance comparison of Microsoft's DiCE and the CARLA benchmark for generating actionable counterfactual explanations in public sector AI.

01

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.

02

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.

03

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.

04

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.

CHOOSE YOUR PRIORITY

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.

THE ANALYSIS

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.

Prasad Kumkar

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.