Introduction
Session-based Recommender Systems (SBRSs) aim to predict a user's next interaction based on a short sequence of activities. However, most existing models focus solely on immediate session context, often conflating direct causal relationships with spurious correlations driven by external factors. This paper introduces COCO-SBRS, a framework that leverages counterfactual inference to distinguish between "inner-session" triggers and "outer-session" causes, filtering out misleading data patterns to improve recommendation accuracy.
The Challenge: Spurious Correlations
A fundamental issue in SBRS is the presence of Outer-Session Causes (OSCs), which act as confounders. For example, if a store offers a site-wide discount on both cameras and electric fans, a user might purchase both. A traditional model might assume the camera purchase caused the fan purchase (an Inner-Session Cause, or ISC). In reality, the discount is the true driver.
Without accounting for these confounders, models learn "spurious correlations" and may continue recommending fans to camera buyers even after the discount ends. Since the actual reason for a click is rarely labeled, untangling these latent causes is a significant challenge.
Methodology: The COCO-SBRS Framework
The authors propose the COunterfactual COllaborative Session-Based Recommender System (COCO-SBRS), which follows a three-phase causal inference process:
- Abduction (Identifying Causes): A Base Recommendation Model (BRM) uses attention-based neural networks to model both ISCs (session context) and OSCs (long-term user preferences). To overcome the lack of ground-truth labels, the system employs self-supervised learning with pseudo-labels. Interactions with previously seen items are labeled as OSC-driven, while new items related to the current session are labeled as ISC-driven.
- Action (Counterfactual Simulation): The model performs a "what-if" analysis. For a target session, it simulates how users with similar long-term preferences would behave if they were in the exact same session context. This is achieved by replacing the session contexts of similar users with that of the target user.
- Prediction (Aggregating Results): The outputs from these counterfactual simulations are combined, weighted by user similarity. A "Boost Factor" is also applied to emphasize recently interacted items, further refining the final recommendation list.
Experimental Evaluation
The framework was tested on three real-world datasets: Last.fm (music), Delicious (bookmarks), and Reddit (discussions). These datasets provide a variety of session lengths and user densities to test generalizability.
Key Results
COCO-SBRS consistently outperformed ten state-of-the-art baselines, including BERT4Rec.
- Performance Gains: On Last.fm, COCO-SBRS achieved a Recall@5 of 0.504, significantly higher than the next best model (0.364).
- Robustness in Short Sessions: The model maintained high accuracy even in sessions with only two interactions, where traditional models often struggle due to data sparsity.
- Ablation Success: Studies confirmed that both self-supervised pre-training and counterfactual inference are critical to the model's success.
Conclusion and Future Work
By treating factors outside the session as confounders, COCO-SBRS moves recommendation systems from simple pattern matching toward causal understanding. While the model excels in short sessions, its performance slightly decreases as sessions lengthen, likely due to the simple attention mechanism used for session encoding. Future work may involve integrating more complex architectures like Graph Neural Networks (GNNs) or explicitly modeling external signals like seasonal trends and marketing campaigns.
Summary updated