Lune

ICML2022Top-tier venue

A query-optimal algorithm for finding counterfactuals

Guy Blanc, Caleb Koch, Jane Lange, Li-Yang Tan

Abstract

We design an algorithm for finding counterfactuals with strong theoretical guarantees on its performance. For any monotone model f : X d → 0, 1 and instance x ⋆ , our algorithm makes queries to f and returns an optimal counterfactual for x ⋆ : a nearest instance x ′ to x ⋆ for which f (x ′ ) = f (x ⋆ ). Here S(f ) is the sensitivity of f , a discrete analogue of the Lipschitz constant, and ∆ f (x ⋆ ) is the distance from x ⋆ to its nearest counterfactuals. The previous best known query complexity was d O(∆ f (x ⋆ )) , achievable by brute-force local search. We further prove a lower bound of S(f ) Ω(∆ f (x ⋆ )) + Ω(log d) on the query complexity of any algorithm, thereby showing that the guarantees of our algorithm are essentially optimal. Theorem 2. Given queries to a monotone model f : X d → 0, 1 with sensitivity S(f ) and an instance x ⋆ , our algorithm makes queries to f and w.h.p. returns the collection C f (x ⋆ ) = ∆(x ⋆ , x ′ ) : x ′ is an optimal counterfactual for x ⋆ . Theorems 1 and 2 give the first algorithms with query complexity that evades the curse of dimensionality, and indeed, strongly so. We contrast our query complexity to that of ball search, a simple and natural algorithm for finding counterfactuals: first query f on x ⋆ and all instances that differ from x ⋆ by a single feature. (By the monotonicity of f , for any feature, it suffices to query f on the instance that differs maximally from x ⋆ on that feature.) Next, query f on the instances that differ by two features, and so on, until a counterfactual is found. This algorithm has query complexity d O(∆ f (x ⋆ )) , an exponentially worse dependence on d than ours. Prior to our work, this was the best known query complexity even just to return a single optimal counterfactual.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Robust Explanation Constraints for Neural Networks cites Robust and Stable Black Box Explanations
  • Robust Explanation Constraints for Neural Networks cites Provably efficient, succinct, and precise explanations
  • Provably Explaining Neural Additive Models cites Formal Mechanistic Interpretability: Automated Circuit Discovery with Provable Guarantees
  • Formal Mechanistic Interpretability: Automated Circuit Discovery with Provable Guarantees cites Provably Explaining Neural Additive Models
  • Provably Explaining Neural Additive Models cites Additive Models Explained: A Computational Complexity Approach
  • Additive Models Explained: A Computational Complexity Approach cites Provably Explaining Neural Additive Models
  • Provably Explaining Neural Additive Models cites Provably efficient, succinct, and precise explanations
  • Provably Explaining Neural Additive Models cites Local vs. Global Interpretability: A Computational Complexity Perspective
  • Formal Mechanistic Interpretability: Automated Circuit Discovery with Provable Guarantees cites Additive Models Explained: A Computational Complexity Approach
  • Formal Mechanistic Interpretability: Automated Circuit Discovery with Provable Guarantees cites Provably efficient, succinct, and precise explanations
  • Formal Mechanistic Interpretability: Automated Circuit Discovery with Provable Guarantees cites Local vs. Global Interpretability: A Computational Complexity Perspective
  • The query complexity of certification cites Provably efficient, succinct, and precise explanations
  • Additive Models Explained: A Computational Complexity Approach cites Provably efficient, succinct, and precise explanations
  • Additive Models Explained: A Computational Complexity Approach cites Local vs. Global Interpretability: A Computational Complexity Perspective
  • Provably efficient, succinct, and precise explanations cites Robust and Stable Black Box Explanations
  • Provably efficient, succinct, and precise explanations cites Born-Again Tree Ensembles
  • Local vs. Global Interpretability: A Computational Complexity Perspective cites Provably efficient, succinct, and precise explanations
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Local vs. Global Interpretability: A Computational Complexity PerspectiveShahaf Bassan, Guy Amir, Guy KatzICML 2024 · 28 citations
  2. Formal Mechanistic Interpretability: Automated Circuit Discovery with Provable GuaranteesItamar Hadad, Guy Katz, Shahaf BassanICLR 2026 · 10 citations
  3. Additive Models Explained: A Computational Complexity ApproachShahaf Bassan, Michal Moshkovitz, Guy KatzNeurIPS 2025 · 4 citations
  4. Robust Explanation Constraints for Neural NetworksMatthew Wicker, Juyeon Heo, Luca Costabello, Adrian WellerICLR 2023 · 3 citations
  5. Provably Explaining Neural Additive ModelsShahaf Bassan, Yizhak Yisrael Elboher, Tobias Ladner, Volkan Şahin et al.ICLR 2026 · 3 citations

Builds on4

  1. Robust and Stable Black Box ExplanationsHimabindu Lakkaraju, Nino Arsov, Osbert BastaniICML 2020 · 93 citations
  2. Born-Again Tree EnsemblesThibaut Vidal, Maximilian SchifferICML 2020 · 62 citations
  3. Provably efficient, succinct, and precise explanationsGuy Blanc, Jane Lange, Li-Yang TanNeurIPS 2021 · 45 citations
  4. The query complexity of certificationGuy Blanc, Caleb Koch, Jane Lange, Li-Yang TanSTOC 2022 · 1 citation

Related papers

  1. Black-Box Methods for Restoring MonotonicityEvangelia Gergatsouli, Brendan Lucier, Christos TzamosICML 2020 · 3 citations
  2. Near-optimal Active Regression of Single-Index ModelsYi Li, Wai Ming TaiICLR 2025
  3. Boolean Function Monotonicity Testing Requires (Almost) n1/2 QueriesMark Chen, Xi Chen, Hao Cui, William Pires et al.STOC 2026
  4. The Adaptive Complexity of Maximizing a Gross Substitutes ValuationRon Kupfer, Sharon Qian, Eric Balkanski, Yaron SingerNeurIPS 2020 · 4 citations
  5. Memory-Query Tradeoffs for Randomized Convex OptimizationXi Chen, Binghui PengFOCS 2023 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines