Abstract
Sequential Recommendation (SeRec) models often struggle with evolving user preferences ("preference drift") and the inherent sparsity of long-tail interaction data. We present RaSeRec, a framework that integrates Retrieval-Augmented Generation (RAG) principles into sequential recommendation. By decoupling recommendation into a collaborative pre-training stage and a retrieval-augmented fine-tuning stage, RaSeRec leverages a dynamic memory bank to retrieve similar historical patterns. This "open-book" approach significantly enhances model robustness and accuracy, particularly for rare items, outperforming state-of-the-art self-supervised learning models across multiple benchmark datasets.
Introduction
Sequential Recommendation (SeRec) aims to predict a user's next interaction by modeling their historical behavior. Despite the success of Transformer-based architectures and self-supervised learning (SSL) techniques, two primary challenges persist:
- Preference Drift: User tastes are dynamic, influenced by life changes or external trends. Traditional models store behavioral patterns in static parameters (implicit memory), making them slow to adapt to rapid shifts in user intent.
- Implicit Memory & Long-Tail Sparsity: Interaction data typically follows a power-law distribution. Models tend to over-memorize "head" patterns (popular behaviors) while failing to capture rare, long-tail signals due to insufficient supervised data.
RaSeRec addresses these issues by introducing an explicit, dynamic memory bank. Instead of relying solely on internal weights, the model can "look up" relevant collaborative behaviors from external data, effectively treating recommendation as an "open-book exam."
Methodology
The RaSeRec framework operates in two distinct stages: Collaborative-based Pre-training and Retrieval-Augmented Fine-Tuning (RAFT).
Stage 1: Collaborative-based Pre-training
The model utilizes a Transformer backbone (e.g., SASRec) and is trained with dual objectives. In addition to standard next-item prediction, a retrieval-specific objective using InfoNCE loss is employed. This aligns the representations of different user sequences that culminate in the same target item, ensuring the model learns "collaborative semantics"—identifying users with similar behavioral trajectories.
Stage 2: Retrieval-Augmented Fine-Tuning (RAFT)
Following pre-training, the backbone is frozen, and a dynamic Memory Bank ($\mathcal{M}$) is constructed using <user sequence, target item> pairs from the training set.
- Retrieval: For any given input sequence, the system retrieves the top-$K$ most similar sequences from the memory bank based on the learned collaborative embeddings.
- Representation Augmentation: The Retrieval-Augmented Module (RAM) processes these memories. It employs a dual-channel multi-head cross-attention mechanism: one channel weights retrieved user representations, while the other weights retrieved target item embeddings. These signals are fused with the original user representation to produce a final, augmented view for prediction.
Experimental Evaluation
RaSeRec was evaluated on three Amazon benchmark datasets: Beauty, Sports, and Clothing. These datasets provide a range of sequence lengths and sparsity levels to test the model's generalization.
Key Results
RaSeRec consistently outperformed leading SSL-augmented baselines such as DuoRec and MCLRec.
- Overall Performance: The model achieved an average improvement of 4.58% in HR@5 and 8.37% in NDCG@5 over the strongest baselines.
- Long-Tail Robustness: A critical finding was the model's superior performance on long-tail items. By explicitly retrieving similar niche patterns, RaSeRec compensates for the lack of direct supervised signals for rare items.
- Mitigating Drift: Simulations involving the removal of recent data from the memory bank confirmed that a dynamic, up-to-date external memory is essential for handling evolving user preferences.
Discussion and Conclusion
RaSeRec demonstrates that retrieval-augmented architectures are highly effective for sequential recommendation. By shifting the burden of pattern storage from static parameters to a dynamic memory bank, the model becomes more adaptable and better at handling data sparsity. Unlike RAG in NLP, which retrieves text based on semantic meaning, RaSeRec retrieves based on behavioral similarity—identifying users who "acted like you" to predict future actions.
Future work includes exploring "active retrieval" to dynamically determine the optimal number of memories ($K$) based on query difficulty and optimizing the computational overhead of maintaining large-scale real-time memory banks. Additionally, refining the filtering mechanisms within the RAM to better handle noisy or irrelevant retrieved signals remains a key area for improvement.
Summary updated