NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Counterfactual Explainable Recommendation

Juntao Tan, Shuyuan Xu, Yingqiang Ge, Yunqi Li, Xu Chen, Yongfeng Zhang · DOI

TL;DR

CountER introduces a counterfactual reasoning framework for explainable recommender systems by finding the minimal changes to an item's features that would cause it to drop out of a user's top-$K$ recommendations. This approach balances explanation complexity and strength, providing a robust, model-agnostic method to generate and quantitatively evaluate aspect-based explanations.

What Problem Does This Paper Address?

To build user trust and help system designers debug algorithms, recommender systems need to explain * why* an item was suggested. Traditional "aspect-aware" explainers rely on matching algorithms or associative signals (e.g., "you like large screens, and this phone has a large screen"). However, correlation does not equal causation; an item might be recommended for an entirely different reason, rendering matching-based explanations ungrounded or misleading.

Furthermore, existing explainability methods suffer from three major flaws:

  1. They are often intrinsic to a specific model architecture, making them unusable for external black-box recommenders.
  2. They fail to regulate explanation complexity, usually defaulting to a single aspect when a recommendation might actually be triggered by a combination of features.
  3. Offline evaluation is notoriously difficult, frequently forcing researchers to rely on expensive and unscalable human user studies.

Methods

The authors propose CountER (Counterfactual Explainable Recommendation). Instead of asking what features match, CountER adopts a counterfactual approach: What is the smallest change we can make to this item's quality scores so that the system stops recommending it? The features that must be altered to reverse the decision become the explanation.

Fact: Item is recommended.
Counterfactual: If the item had been slightly worse on [Aspect X], it would not have been recommended.
Explanation: [Aspect X] is the reason for the recommendation.

The Optimization Framework

CountER formulates this as a constrained optimization problem designed to satisfy two core principles inspired by Occam's Razor:

  • Explanation Complexity: Measures how many aspects are changed and by how much. CountER minimizes this using a combination of $\ell_1$-norm (for sparsity/fewer aspects) and $\ell_2$-norm (for smaller changes).
  • Explanation Strength: Measures the drop in the item's ranking score. The framework uses a relaxed hinge loss to ensure the counterfactual item's score falls below the top-$K$ recommendation threshold.

Quantitative Evaluation Metrics

To solve the offline evaluation bottleneck, the paper introduces two evaluation paradigms:

  1. User-oriented: Compares the generated explanation against the positive aspects the user actually mentioned in their historical reviews (measured via Precision, Recall, and $F_1$).
  2. Model-oriented: Uses causal inference concepts to measure the Probability of Necessity (PN) (does removing the aspect kill the recommendation?) and Probability of Sufficiency (PS) (is the aspect alone enough to keep the recommendation?).

Datasets

The authors evaluated CountER on five real-world datasets of varying scales:

  • Yelp: User reviews on local businesses (restaurants, salons, etc.).
  • Amazon: Four distinct product categories: Electronic, Cell Phones and Accessories, Kindle Store, and CDs and Vinyl.

The dataset statistics are outlined below:

Table 1: Statistics of the datasets

Key Insights and Ideas

  • The Danger of Matching Scores: As illustrated in Figure 1, traditional matching methods can fail spectacularly. If a user highly values a "good screen," a matching model might explain a recommendation using the screen aspect, even if the recommended phone actually has the worst screen on the market. Counterfactuals bypass this by probing the model's actual decision boundaries.
Figure 1: Matching-based vs. counterfactual reasoning. The numbers beside the three aspects (screen, battery, and price) show how much the user cares about an aspect and how well the item performs on an aspect. In this example, matching- based explanation methods would use “screen” to construct an explanation, while counterfactual reasoning method will use “battery” to construct the explanation.
  • The Position-Complexity Tradeoff: CountER reveals that items ranked at the very top of a recommendation list require more complex explanations (more aspects or larger changes) to be dislodged than items lower on the list. This matches our intuition: the system's strongest recommendations should be backed by multiple robust reasons.
  • Orthogonality of Complexity and Strength: The ablation studies demonstrate that explanation complexity and strength are independent dimensions. An explanation can be complex but weak, or simple but strong. CountER successfully optimizes for the ideal quadrant: simple yet highly effective explanations.

Key Results

  • High Explanation Fidelity: When allowed to generate multi-aspect explanations, CountER achieved a fidelity of 80% to 100% across all datasets, meaning it successfully found valid counterfactual explanations for almost every recommendation.
Table 2: Explanation Fidelity
  • Superior User Alignment: In user-oriented evaluations, an adjusted version of CountER (using an aspect mask to account for personal linguistic biases) consistently outperformed state-of-the-art explainable models (EFM, MTER, A2CF) in $F_1$ score across all five datasets.
  • Faithful Model Justification: CountER dominated baselines in model-oriented metrics ($F_{NS}$, the harmonic mean of PN and PS). On the Electronic dataset, multi-aspect CountER achieved an $F_{NS}$ score of 96.66%, compared to A2CF's 68.82% and EFM's 43.92%. This proves that CountER's explanations accurately capture the true underlying mechanics of the black-box recommendation engine.

Limitations and Future Work

While CountER provides a powerful framework for text-extracted item aspects, it currently has a few limitations:

  • Aspect Extraction Dependency: It relies entirely on explicit item aspects extracted from textual reviews via sentiment analysis toolkits.
  • Single Modality: It only explores perturbations on tabular aspect data.

The authors note that the underlying counterfactual framework is highly adaptable. Future work will focus on expanding CountER to handle other modalities—such as generating counterfactual changes on images or raw natural language descriptions—and applying it to decision-making over knowledge graphs and graph neural networks (GNNs).

Summary updated

BibTeX
@inproceedings{tan2021counterfactual,
  author = {Juntao Tan and Shuyuan Xu and Yingqiang Ge and Yunqi Li and Xu Chen and Yongfeng Zhang},
  title = {{Counterfactual Explainable Recommendation}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2021},
  url = {https://openreview.net/forum?id=azx15rLuK1d},
}
Figure