Papers
Topics
Authors
Recent
Search
2000 character limit reached

SPINRec: Stochastic Path Integration Explanations

Updated 29 November 2025
  • The paper introduces SPINRec, a model-agnostic framework that uses stochastic baseline sampling and path integration to generate more faithful explanations than fixed baseline methods.
  • The approach is rigorously evaluated on MF, VAE, and NCF models across datasets like MovieLens-1M, Yahoo! Music, and Pinterest, showing significant improvements on counterfactual metrics such as DEL@K and POS@K.
  • SPINRec offers scalable computation through parallel stochastic paths, paving the way for enhanced interpretability of recommender systems and potential extensions to multi-modal and sequential models.

SPINRec (Stochastic Path Integration for Neural Recommender Explanations) is a model-agnostic framework designed to generate fidelity-aware explanations for neural recommender systems operating on sparse, implicit feedback data. Unlike classical attribution methods, which often rely on fixed or unrealistic baselines, SPINRec utilizes stochastic baseline sampling and path integration to maximize the faithfulness of feature relevance scores with respect to actual model reasoning, as assessed by counterfactual metrics. The approach is evaluated extensively across matrix factorization (MF), variational autoencoder (VAE), and neural collaborative filtering (NCF) models using MovieLens-1M, Yahoo! Music, and Pinterest datasets, and establishes new benchmarks for explanation fidelity (Barkan et al., 22 Nov 2025).

1. Formal Problem Statement and Key Notation

Let U\mathcal{U} denote the set of users and V\mathcal{V} the set of items. Each user u∈Uu \in \mathcal{U} is associated with a binary interaction vector x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}, recording whether uu has interacted with item ii (xi=1)(x_i = 1) or not (xi=0)(x_i = 0). A trained recommender fθ:{0,1}∣V∣→[0,1]∣V∣f_\theta: \{0,1\}^{|\mathcal{V}|} \to [0,1]^{|\mathcal{V}|} outputs affinity scores fy(x)f^y(x) for a target item V\mathcal{V}0 conditioned on history V\mathcal{V}1. An explanation assigns each input feature V\mathcal{V}2 an attribution score V\mathcal{V}3, quantifying its contribution to V\mathcal{V}4.

Fidelity is defined as the degree to which the explanation map accurately reflects the model's decision process under feature perturbation. Measuring fidelity involves masking the top-V\mathcal{V}5 explanatory features and computing counterfactual metrics, such as:

  • V\mathcal{V}6: Binary indicator of whether V\mathcal{V}7 remains ranked in the top-V\mathcal{V}8 after removing V\mathcal{V}9 features.
  • u∈Uu \in \mathcal{U}0: Score ratio after masking (u∈Uu \in \mathcal{U}1) vs. original.
  • u∈Uu \in \mathcal{U}2K_eu∈Uu \in \mathcal{U}3: Score when only top features are present.
  • u∈Uu \in \mathcal{U}4.

Prevailing methods suffer from low fidelity when applied to sparse binary inputs, particularly those using fixed "zero" baselines or non-counterfactual heuristics, due to vanishing gradients and a failure to capture absence signals.

2. Stochastic Path Integration Framework

Integrated Gradients (IG) formalizes feature attribution for u∈Uu \in \mathcal{U}5 relative to a baseline u∈Uu \in \mathcal{U}6: u∈Uu \in \mathcal{U}7 In practice, the integral is discretized with u∈Uu \in \mathcal{U}8 steps of linear interpolation.

SPINRec replaces the fixed u∈Uu \in \mathcal{U}9 with a set of x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}0 plausible baselines x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}1 sampled from the empirical distribution of user profiles. For each x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}2, IG is computed to produce a candidate map x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}3. A fidelity score x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}4 (e.g., AUC of x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}5 or x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}6 curves) is then evaluated per map, and the final explanation x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}7 is selected from the set x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}8 of candidate maps. Optionally, the average map x∈{0,1}∣V∣x \in \{0,1\}^{|\mathcal{V}|}9 may be considered as an "expected paths" variant.

3. Algorithmic Details and Computational Complexity

Pseudocode for SPINRec is as follows:

ii4

Each baseline requires uu0 gradient computations uu1, uu2 model parameter count) and a fidelity test uu3 for uu4 perturbations). Total cost is uu5, but in practice uu6 and all uu7 paths can be computed in parallel. Sparse storage and vectorization are used for efficiency.

4. Empirical Evaluation Protocol

SPINRec is benchmarked using three binarized implicit feedback datasets:

Dataset Recommendation Models User Split / Setup
ML-1M MF, VAE, NCF 80/20 split, 10% holdout
Yahoo! Music MF, VAE, NCF 80/20 split, 10% holdout
Pinterest MF, VAE, NCF 80/20 split, 10% holdout

Counterfactual fidelity metrics include AUC-style perturbation curves and fixed-length diagnostics (POS, DEL, INS, CDCG), aligning with Baklanov et al. and LXR protocols.

Baselines tested:

  • Cosine-Similarity heuristic
  • SHAP4Rec (Shapley approximation)
  • DeepSHAP
  • LIME-RS, LIRE (importance-sampling LIME)
  • FIA, ACCENT (influence-function)
  • LXR (learned explainer)
  • PI (plain IG with zero baseline)
  • SPINRec

5. Quantitative Results and Qualitative Insights

SPINRec consistently achieves superior fidelity on all tested models and datasets, with statistically significant improvements (uu8 vs. LXR and other strong baselines):

  • 3–10% lower uu9 and ii0 (better rank collapse under feature removal)
  • 4–8% lower ii1 (greater score drops)
  • 1–3% higher ii2 (better restoration using top features)

Ablation reveals that plain IG (zero baseline) is competitive but always outperformed when assessed by counterfactual metrics, especially for VAE and NCF models, where the absence of interaction embeds additional signal. Performance gains saturate at ii3 baselines.

Qualitative analysis demonstrates that classical IG with zero baselines isolates only present (nonzero) items, overlooking how the lack of interaction on others influences recommendations. SPINRec's stochastic baselines capture this effect, yielding more nuanced and stable attribution maps. The maps produced by selecting the highest-fidelity path align more closely with observed rank collapses when top explanatory items are removed.

6. Significance and Future Directions

SPINRec represents the first model-agnostic stochastic path integration approach tailored for recommender systems with sparse, binary inputs. By sampling empirically plausible baselines and selecting explanations by their fidelity under counterfactual evaluation, SPINRec addresses key limitations with prior approaches and sets new benchmarks for MF, VAE, and NCF models across standard datasets.

Planned directions include extension to multi-modal and sequential recommenders, acceleration via learned baseline samplers or direct fidelity approximations, and the integration of human-in-the-loop feedback to iteratively refine baseline distributions. All code, masking and evaluation pipelines are publicly available at https://github.com/DeltaLabTLV/SPINRec (Barkan et al., 22 Nov 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to SPINRec (Stochastic Path Integration for Neural Recommender Explanations).