Why This, Not That? Mining User Profiles for Pair-wise Counterfactuals

Meysam Varasteh, Veronika Bogina, Noam Koenigstein, Robin BurkearXiv 2026

TL;DR

Traditional recommender system explanations focus on why a single item was suggested, but humans naturally reason using contrasts ("Why X and not Y?"). This paper introduces a counterfactual learning framework that mines a user's interaction history to find the minimal profile changes required to flip a pairwise item ranking. By optimizing directly for contrastive objectives, their proposed model generates highly accurate and succinct explanations for personalized recommendations.

What Problem Does This Paper Address?

When a recommender system places Item A above Item B, a user might naturally wonder what specific aspect of their past behavior caused that preference. Most current Explainable AI (XAI) methods for recommenders focus on single items in isolation (e.g., "You were recommended Alien because you watched Forbidden Planet").

However, psychological research shows that humans prefer contrastive explanations. Explaining why Item A beat Item B requires identifying the causal relationships between the user's history and the relative ranking outcomes. The authors address this by framing pairwise ranking explanation as a counterfactual problem: What is the smallest set of items a user could remove from their profile to make the system rank Item B higher than Item A?

Methods

The authors build upon the LXR (Learning to Explain Recommendations) framework, which uses a learning-based explainer to apply a mask over user profiles. They extend this to the pairwise setting by introducing CLXR (Comparative LXR) and evaluating three distinct strategies:

  1. CLXR-score: A naive baseline that generates independent LXR masks for both the target and comparative items, combining them multiplicatively.
  2. CLXR-joint: A novel Siamese network architecture that jointly optimizes a four-part contrastive loss function. It balances maximizing the score gap between the two items, preserving the target's top rank before perturbation, suppressing the target when key items are removed, and enforcing mask sparsity.
  3. CLXR-tdlr: An implementation that adapts the Targeted Deviation - Logit Ranking (TDLR) loss—traditionally used in adversarial attacks—to directly learn a comparative mask without intermediate networks.

These explainers are model-agnostic and were tested against two common recommendation backends: Matrix Factorization (MF) and a Variational Autoencoder (VAE).

Datasets

The framework was evaluated using three standard recommendation datasets, binarized to simulate implicit feedback:

  • MovieLens 1M (ML-1M): 575,128 ratings from 6,037 users across 3,381 items (ratings $\ge$ 3.5 retained).
  • Yahoo Music: A sampled subset containing 365,750 ratings from 13,797 users across 4,604 items.
  • Pinterest: 486,744 ratings from 19,155 users covering 9,362 items.

The baseline performance metrics (Hit Rate and Catalog Coverage) for the underlying recommendation models on these datasets are outlined in the paper:

Base recommendation model performance across datasets

Key Insights and Ideas

  • The Power of Joint Optimization: Simply combining two separate single-item explanations (CLXR-score) yields poor results. Because recommendation algorithms map items to highly non-linear latent spaces, explainers must explicitly optimize for the contrastive relationship between the item pair to be effective.
  • The Popularity Paradox: Recommender systems suffer heavily from popularity bias. The explainers frequently found that the easiest way to flip a ranking was to remove highly popular items (e.g., Star Wars or Titanic) from a user's profile. While mathematically correct, telling a user "If you hadn't liked Titanic, we would have ranked this niche indie movie higher" makes for a poor, uninformative human explanation.
  • Adversarial Tools for Good: Borrowing optimization techniques from adversarial machine learning (like TDLR loss) proves to be an effective strategy for generating benign, interpretable counterfactuals.

Key Results

The performance was measured using Coverage (how often a valid profile perturbation could be found) and MPRR# (Minimal Perturbation for Ranking Reversal in absolute item counts).

  • CLXR-joint consistently outperformed standard XAI baselines (like LIME and SHAP). For instance, on the MovieLens dataset using a VAE recommender, CLXR-joint achieved 92% Coverage with an average perturbation size of just 21 items.
  • To test the impact of popularity bias, the authors created CLXR-filter, which blocked the top 15% most popular items from being used as explanations. While this forced the model to find more niche, personalized explanations, it caused a massive drop in Coverage (e.g., falling from 87.3% to 24% on the MF/Yahoo configuration), highlighting how deeply dependent modern recommenders are on popular anchor items.

Limitations and Future Work

  • Human-Centered Evaluation: The metrics used in this study (MPRR and Coverage) are purely algorithmic. The authors acknowledge the critical need for future user studies to verify if human subjects find these profile-based counterfactuals intuitive and actionable.
  • The Scale of Explanations: In some cases, reversing a ranking requires removing dozens of items, creating an overwhelming explanation for an end-user. The authors propose integrating clustering or summarization techniques in future iterations (e.g., "If you hadn't watched 25 Marvel action films, we would have recommended Batman Returns over Aquaman").
  • Optimality Gap: The current framework uses a learning-based approximation to find perturbations efficiently. Determining the truly minimal explanation remains a computationally expensive open challenge.

Summary updated

BibTeX
@misc{varasteh2026why,
  author = {Meysam Varasteh and Veronika Bogina and Noam Koenigstein and Robin Burke},
  title = {{Why This, Not That? Mining User Profiles for Pair-wise Counterfactuals}},
  year = {2026},
  eprint = {2608.21662},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.21662},
}
Figure