Abstract
Session-based recommendation (SBR) aims to predict a user's next action based on a sequence of interactions within a single session. Traditional models often rely on the "last-click" heuristic, assuming the final item represents the user's current intent, and use dense attention mechanisms (softmax) that assign weight to every item, including noise. We present the Dual Sparse Attention Network (DSAN), which addresses these issues by learning a target embedding to represent true user intent and employing an adaptive $\alpha$-entmax transformation to filter out irrelevant interactions. Experimental results on real-world datasets demonstrate that DSAN significantly outperforms state-of-the-art baselines.
Introduction: Beyond the Last-Click Heuristic
Session-based recommendation is challenging because it relies on short, anonymous sequences of clicks. Most existing approaches suffer from two primary weaknesses:
- The Last-Click Assumption: Models often treat the most recent click as the definitive query for the user's intent. However, in real-world scenarios, the last click might be a distraction or an accidental tap.
- The "All Items Matter" Assumption: Standard attention mechanisms utilize the softmax function, which distributes probability mass across all items in a session. This "dense" approach forces the model to consider every click, even "spurious behaviors" that are unrelated to the user's actual goal.
As shown in Figure 1, the last click (e.g., an iWatch) may not accurately reflect the user's primary interest (e.g., an iPhone). DSAN aims to identify the "Real Target Item" by looking at the entire session context rather than just the final action.
The DSAN Architecture
The Dual Sparse Attention Network (DSAN) introduces a dual-layer sparse attention mechanism designed to capture intent while muting noise.
The model consists of four key components:
- Embedding Layer: Item and positional embeddings are combined to preserve the sequential order of user actions.
- Target Embedding Learning: Instead of relying on the last click, DSAN appends a special index to the session. A Sparse Self-Attention network allows all items to interact, generating a "target embedding" that represents the user's latent goal.
- Target Attention Layer: This layer uses the learned target embedding as a query to re-evaluate original session items, identifying which historical clicks are most relevant to the predicted target.
- $\alpha$-entmax Transformation: This is the core innovation. Unlike softmax, $\alpha$-entmax can assign exactly zero weight to irrelevant items. The $\alpha$ parameter is learned adaptively for each session, allowing the model to be highly selective in noisy sessions and more inclusive in focused ones.
Experimental Evaluation
DSAN was evaluated on two benchmark e-commerce datasets: Diginetica (DN) and Retailrocket (RR). Standard preprocessing was applied, filtering out sessions with fewer than three items and items appearing fewer than five times.
Key Results
DSAN consistently outperformed state-of-the-art baselines like SR-GNN, GC-SAN, and STAMP:
- Diginetica: Achieved a 5.47% improvement in Hit Rate (HR@10) and a 6.87% improvement in Mean Reciprocal Rank (MRR@10).
- Retailrocket: Demonstrated even more significant gains, with a 10.70% improvement in MRR@10 over the best baseline.
Ablation studies confirmed that both the target embedding learning and the sparse $\alpha$-entmax transformation are critical. Removing either component or reverting to standard softmax led to a significant drop in performance, highlighting the importance of filtering "spurious" clicks.
Conclusion and Future Work
DSAN effectively mitigates the impact of noisy user behavior in session-based recommendations by moving away from the last-click assumption and adopting sparse attention. By mathematically "zeroing out" irrelevant interactions, the model maintains a pure representation of user intent.
Future research may explore Automated Machine Learning (AutoML) to identify and prune unrelated items before they enter the neural network, potentially improving both computational efficiency and recommendation accuracy.
Summary updated