Abstract
Session-based recommendation systems (SBRS) aim to predict a user's next action based on a short, anonymous sequence of interactions. A key challenge in SBRS is capturing the evolution of user intent, which often shifts from an initial goal to a refined preference. This paper introduces PosRec, a novel architecture that explicitly exploits positional information through Dual Positional Encoding (DPE). By tracking both forward-awareness (distance from the start) and backward-awareness (distance from the end), PosRec provides a more nuanced representation of item importance. Combined with a Position-aware Gated Graph Neural Network (PGGNN), the model achieves state-of-the-art performance on major e-commerce benchmarks, including Yoochoose and Diginetica.
Introduction
In session-based recommendation, systems must infer user preferences from a limited set of clicks within a single session. Unlike traditional recommendation systems that rely on long-term user history, SBRS must handle highly dynamic and short-term "intentions." Existing approaches, such as Recurrent Neural Networks (RNNs) and Graph Neural Networks (GNNs), often suffer from a "positional blind spot." RNNs tend to lose information from the beginning of a session, while attention-based models often over-emphasize the most recent item without considering the relative position of intermediate items.
Standard positional encodings, like the sinusoidal encodings (SPE) used in Transformers, are typically "forward-aware"—they identify an item's index from the start. However, the authors mathematically prove that SPE is insufficient for recommendation because it cannot determine if an item is near the "latest intention" unless the session length is fixed. This necessitates a "backward-aware" approach.
Positional Awareness in SBRS
The core thesis of PosRec is that effective session modeling requires both forward and backward awareness. Forward-awareness captures the initial intent, while backward-awareness captures the latest intent.
As illustrated in the figure above, an item $v_6$ appearing at the fourth position in two different sessions ($S_1$ and $S_2$) may have vastly different significance. In a long session ($S_1$), it is five steps from the end, whereas in a short session ($S_2$), it is the penultimate item. Standard forward-only encoding would treat these instances identically, missing the critical context of the item's proximity to the session's conclusion.
The PosRec Architecture
PosRec addresses these limitations through a three-pronged methodological approach:
1. Dual Positional Encoding (DPE & LDPE)
The model employs a Dual Positional Encoding (DPE) scheme that concatenates two signals: one counting from the session start and another counting from the session end. The authors also introduce a Learnable Dual Positional Encoding (LDPE) variant, allowing the model to adapt these embeddings during training to better fit the data distribution.
2. Position-aware Gated Graph Neural Network (PGGNN)
To inject positional bias directly into item representations, PosRec uses a PGGNN. This component treats the first item, the last item, and repeated items as "anchor nodes." By creating additional edges between these anchors and other nodes in the session graph, the model forces the learning process to account for an item's relationship to the session's boundaries, mitigating the issues of graph sparsity.
3. Bidirectional Transformer Readout
Finally, a bidirectional Transformer acts as a readout function. It utilizes the (L)DPE to synthesize the final session representation, ensuring that the global context of the session is captured with full positional awareness before making a prediction.
Experimental Evaluation
The model was evaluated on two gold-standard e-commerce benchmarks:
- Yoochoose: A large-scale dataset of click-streams (tested on 1/64 and 1/4 fractions).
- Diginetica: Transaction data from the CIKM Cup 2016.
Standard preprocessing was applied to remove sessions shorter than two items and items appearing fewer than five times.
Key Results
PosRec consistently outperformed strong baselines, including SR-GNN, GC-SAN, and STAMP, across all evaluated metrics. On the Yoochoose 1/64 dataset, PosRec achieved a Recall@10 of 60.90%, compared to 60.04% for SR-GNN. The boost in Mean Reciprocal Rank (M@10) was even more notable, reaching 30.57% on Yoochoose 1/64 and 16.85% on Diginetica, indicating that the correct item is ranked significantly higher in the recommendation list.
Ablation studies and visualization of LDPE heatmaps confirmed that the model successfully learns distinct, complementary patterns for forward and backward positions, validating the dual-awareness theory.
Conclusion
PosRec demonstrates that positional information, specifically backward-awareness, is a critical yet often overlooked component in session-based recommendation. By integrating Dual Positional Encoding with a position-aware graph architecture, PosRec effectively captures the shifting dynamics of user intent. Future work may explore incorporating cross-session historical data and refining the hyper-parameter sensitivity of the anchor node weights.
Summary updated