Graph Spring Network and Informative Anchor Selection for Session-based Recommendation

Zizhuo Zhang, Bang Wang

Abstract

Session-based recommendation (SBR) aims at predicting the next item for an ongoing anonymous session. The major challenge of SBR is how to capture richer relations in between items and learn ID-based item embeddings to capture such relations. Recent studies propose to first construct an item graph from sessions and employ a Graph Neural Network (GNN) to encode item embedding from the graph. Although such graph-based approaches have achieved performance improvements, their GNNs are not suitable for ID-based embedding learning for the SBR task. In this paper, we argue that the objective of such ID-based embedding learning is to capture a kind of neighborhood affinity in that the embedding of a node is similar to that of its neighbors' in the embedding space. We propose a new graph neural network, called Graph Spring Network (GSN), for learning ID-based item embedding on an item graph to optimize neighborhood affinity in the embedding space. Furthermore, we argue that even stacking multiple GNN layers may not be enough to encode potential relations for two item nodes far-apart in a graph. In this paper, we propose a strategy that first selects some informative item anchors and then encode items' potential relations to such anchors. In summary, we propose a GSN-IAS model (Graph Spring Network and Informative Anchor Selection) for the SBR task. We first construct an item graph to describe items' co-occurrences in all sessions. We design the GSN for ID-based item embedding learning and propose an item entropy measure to select informative anchors. We then design an unsupervised learning mechanism to encode items' relations to anchors. We next employ a shared gated recurrent unit (GRU) network to learn two session representations and make two next item predictions. Finally, we design an adaptive decision fusion strategy to fuse two predictions to make the final recommendation.

Introduction

Session-based recommendation (SBR) is a critical task in e-commerce, focusing on predicting the next item a user will interact with based on their current anonymous session. The primary challenge lies in the lack of long-term user profiles, forcing models to rely entirely on item IDs and their transition patterns. While Graph Neural Networks (GNNs) have become the standard for modeling these transitions, they often fail to preserve "neighborhood affinity"—the principle that an item's embedding should naturally resemble its neighbors. Standard GNNs often use global transformation kernels that can disrupt this local structure, and stacking layers to capture long-range dependencies frequently leads to over-smoothing.

The GSN-IAS Framework

To address these limitations, we introduce GSN-IAS, a dual-branch architecture that captures both local neighborhood affinity and global topological context.

The overall architecture of the GSN-IAS model, featuring graph construction, the GSN, anchor selection, and dual-branch session learning.

Graph Spring Network (GSN)

The GSN branch focuses on local relationships by treating item embeddings as points in space connected by virtual "springs." Instead of standard message passing with global weights, neighbors exert forces on a node, and the embedding is updated iteratively to reach a balance point. This iterative process is theoretically grounded in the Expectation-Maximization (EM) algorithm, ensuring that the learned embeddings stay true to the co-occurrence signals in the raw data without the distortion of global transformation kernels.

Informative Anchor Selection (IAS)

To capture global relationships between items that may be distant in the graph, the IAS branch identifies "anchors"—representative items selected based on an item entropy measure. The model learns a soft-assignment distribution for every item relative to these anchors, effectively creating a global coordinate system. This allows the model to recognize similarities between items that share similar roles in the overall graph, even if they have never appeared in the same session.

Session Learning and Adaptive Fusion

The model utilizes a shared Gated Recurrent Unit (GRU) to process the session sequence twice: once using the local GSN embeddings and once using the global anchor-based encodings. An adaptive fusion layer then learns how to weight these two perspectives to generate the final recommendation.

Experimental Evaluation

We evaluated GSN-IAS on three standard benchmarks: Yoochoose 1/64, RetailRocket, and Diginetica. The model consistently outperformed traditional, neural, and graph-based baselines.

Overall performance comparison showing GSN-IAS achieving the highest HR@20 and MRR@20 against state-of-the-art baselines.

As shown in the results table, GSN-IAS achieved significant gains, particularly on the RetailRocket dataset, where it improved HR@20 by 5.25% and MRR@20 by 9.38% over the second-best model. Ablation studies confirmed that both the GSN (local) and IAS (global) components are vital for these performance improvements.

Conclusion

GSN-IAS provides a robust solution for session-based recommendation by balancing local transition logic with global topological patterns. By optimizing neighborhood affinity through a spring-inspired iterative process and utilizing informative anchors for global context, the model overcomes the inherent limitations of standard GNNs in ID-based embedding learning. Future work will explore incorporating item features and deeper latent transition knowledge into the framework.

Summary updated

Abstract

Session-based recommendation (SBR) aims at predicting the next item for an ongoing anonymous session. The major challenge of SBR is how to capture richer relations in between items and learn ID-based item embeddings to capture such relations. Recent studies propose to first construct an item graph from sessions and employ a Graph Neural Network (GNN) to encode item embedding from the graph. Although such graph-based approaches have achieved performance improvements, their GNNs are not suitable for ID-based embedding learning for the SBR task. In this paper, we argue that the objective of such ID-based embedding learning is to capture a kind of \textit{neighborhood affinity} in that the embedding of a node is similar to that of its neighbors' in the embedding space. We propose a new graph neural network, called Graph Spring Network (GSN), for learning ID-based item embedding on an item graph to optimize neighborhood affinity in the embedding space. Furthermore, we argue that even stacking multiple GNN layers may not be enough to encode potential relations for two item nodes far-apart in a graph. In this paper, we propose a strategy that first selects some informative item anchors and then encode items' potential relations to such anchors. In summary, we propose a GSN-IAS model (Graph Spring Network and Informative Anchor Selection) for the SBR task. We first construct an item graph to describe items' co-occurrences in all sessions. We design the GSN for ID-based item embedding learning and propose an \textit{item entropy} measure to select informative anchors. We then design an unsupervised learning mechanism to encode items' relations to anchors. We next employ a shared gated recurrent unit (GRU) network to learn two session representations and make two next item predictions. Finally, we design an adaptive decision fusion strategy to fuse two predictions to make the final recommendation.
BibTeX
@inproceedings{zhang2023graph,
  author = {Zizhuo Zhang and Bang Wang},
  title = {{Graph Spring Network and Informative Anchor Selection for Session-based Recommendation}},
  booktitle = {Neural Networks},
  year = {2023},
  url = {https://openreview.net/forum?id=nHyHhD3fXF},
}
Figure