What If, But Privately: Private Counterfactual Retrieval

Shreya Meel, Mohamed W. Nomeir, Pasan Dissanayake, Sanghamitra Dutta, Sennur UlukusarXiv 2025 · DOI

Introduction

As machine learning models increasingly influence critical life decisions—such as loan approvals or criminal sentencing—the demand for transparency has grown. Counterfactual explanations (CFEs) have emerged as a gold standard for AI interpretability, answering the question: "What is the smallest change I could make to my data to receive a different outcome?" For instance, a rejected loan applicant might be told, "If your income were $5,000 higher, your loan would have been approved."

Despite their utility, CFEs introduce a significant "privacy tax." To receive an explanation, a user must typically transmit their entire feature vector to the institution's server. This reveals sensitive information, including features the user might prefer to keep private or those they are unable to change. This paper addresses this gap by proposing a framework for Private Counterfactual Retrieval (PCR), ensuring that the institution learns nothing about the user's state or their specific constraints.

Methodology

The core objective of PCR is to allow a user with a private feature vector $x$ to identify the nearest neighbor in a database $\mathcal{D}$ of "accepted" instances, without revealing $x$ to the database owners. To achieve information-theoretic privacy—privacy that holds regardless of the adversary's computational power—the authors propose a multi-server framework where the database is replicated across $N$ non-colluding servers.

The PCR Framework

The retrieval process involves two main steps. First, the user privately identifies the index of the nearest counterfactual. Second, they use Symmetric Private Information Retrieval (SPIR) to fetch the actual record. This ensures the server never learns which specific record was retrieved.

The basic PCR framework involves a user querying multiple non-colluding servers to find the nearest counterfactual index without revealing their input vector.

Key technical components include:

  • One-Time Padding: Queries are masked with random noise, ensuring individual servers cannot reconstruct the user's data.
  • Polynomial Encoding: Queries are structured as polynomials of the server index. By processing these against the database, the user can decode the distances to all points using a Vandermonde matrix.
  • Immutable Features (I-PCR): In many scenarios, certain features (e.g., age or race) are immutable. I-PCR allows users to find the nearest neighbor that matches their specific immutable values without revealing which features are fixed. This added complexity requires increasing the server count from $N=2$ to $N=3$.

Scheme Variants

The authors developed several variants to balance privacy, communication cost, and "database leakage" (the information the user learns about the institution's other data). These include Diff-PCR and Mask-PCR, which reduce leakage by only revealing differences between distances or adding controlled noise, and PCR+, which supports "actionability" by allowing weighted distances.

Evaluation and Results

The proposed schemes were evaluated using synthetic data, the Wine Quality dataset, and the COMPAS recidivism dataset.

Performance and Accuracy

The researchers found that quantization is a critical factor. Since the schemes operate over finite fields ($\mathbb{F}_q$), real-valued data must be converted to integers. On the Wine Quality dataset, retrieval accuracy reached nearly 100% once quantization levels ($R$) exceeded 250.

Communication and Complexity

The communication cost of these schemes scales linearly with the number of features ($d$) and the database size ($M$). As shown in the table below, different variants offer various trade-offs between communication overhead and field size requirements.

Comparison of communication costs and field size requirements across different PCR and I-PCR schemes.

Privacy and Leakage

All proposed schemes provide perfect information-theoretic privacy for the user. Furthermore, Mask-PCR was shown to reduce the information leaked to the user about the institution's database by over 70% compared to baseline approaches on synthetic data.

Conclusion

Private Counterfactual Retrieval offers a robust solution to the privacy-transparency trade-off in AI. By utilizing multi-server PIR techniques, it is possible to provide actionable explanations while keeping user data completely secret. Future work will focus on scaling these methods to massive databases and extending the framework to support non-Euclidean distance metrics like $\ell_1$ or Mahalanobis distance.

Summary updated

BibTeX
@misc{meel2025what,
  author = {Shreya Meel and Mohamed W. Nomeir and Pasan Dissanayake and Sanghamitra Dutta and Sennur Ulukus},
  title = {{What If, But Privately: Private Counterfactual Retrieval}},
  year = {2025},
  eprint = {2508.03681},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.03681},
}
Figure