Exploring Applications of State Space Models and Advanced Training Techniques in Sequential Recommendations: A Comparative Study on Efficiency and Performance

Mark Obozov, Makar Baderko, Stepan Kulibaba, Nikolay Kutuzov, Alexander Gasnikov · DOI

Abstract

Recommender systems aim to estimate the dynamically changing user preferences and sequential dependencies between historical user behaviour and metadata. Although transformer-based models have proven to be effective in sequential recommendations, their state growth is proportional to the length of the sequence that is being processed, which makes them expensive in terms of memory and inference costs. Our research focused on three promising directions in sequential recommendations: enhancing speed through the use of State Space Models (SSM), as they can achieve SOTA results in the sequential recommendations domain with lower latency, memory, and inference costs, as proposed by arXiv:2403.03900 improving the quality of recommendations with Large Language Models (LLMs) via Monolithic Preference Optimization without Reference Model (ORPO); and implementing adaptive batch- and step-size algorithms to reduce costs and accelerate training processes.

Introduction

Sequential recommendation is a critical component of modern digital platforms, predicting user preferences based on interaction history. While Transformers have set the performance standard by capturing long-term dependencies, they suffer from a "quadratic bottleneck"—computational costs scale at $O(n^2)$ relative to sequence length. This makes real-time deployment expensive. Conversely, Recurrent Neural Networks (RNNs) offer linear scaling but struggle with long-term memory. This study explores a "middle way" using State Space Models (SSMs) to achieve the efficiency of RNNs with the expressive power of Transformers.

Methodology

The research investigates three primary avenues for optimizing the efficiency-performance trade-off:

  1. State Space Models (SSMs) & Hydra: We introduce Hydra4Rec, an architecture utilizing quasiseparable matrices as bidirectional sequence mixers. Hydra achieves $O(L)$ complexity, offering a more efficient alternative to standard Mamba blocks while maintaining high accuracy.
  2. Odds Ratio Preference Optimization (ORPO): To simplify LLM fine-tuning for recommendations, we apply ORPO. This monolithic approach eliminates the need for a reference model, using an odds-ratio-based penalty to distinguish between "winner" and "loser" items in a single training step.
  3. Adaptive Batching (USGM): We implement the Universal Stochastic Gradient Method (USGM) to dynamically adjust batch and step sizes. By sensing gradient noise, USGM optimizes resource allocation, increasing batch sizes only when beneficial for convergence.

Experimental Setup

The proposed models were evaluated against three industry-standard benchmarks:

  • Amazon Reviews '23 (Beauty and Personal Care): Characterized by high volume and sparse metadata.
  • Amazon Reviews '23 (Video Games): Featuring distinct sequential patterns.
  • MovieLens-1M: A classic dataset containing 1 million movie ratings.

Results and Discussion

The experimental results highlight the significant efficiency gains of SSM-based architectures compared to traditional attention-based models.

Performance on Amazon Beauty

In the Beauty dataset, Hydra4Rec demonstrated exceptional efficiency, achieving a latency of 0.0042s. This is significantly lower than the 0.117s recorded for the Transformer-based SASRec and the 0.0075s for Mamba4Rec.

Table 1: Performance comparison on the Amazon Beauty dataset, highlighting the latency advantages of Hydra4Rec.

Performance on MovieLens-1M

On the MovieLens-1M dataset, the 2Mamba4Rec model achieved state-of-the-art (SOTA) results with an NDCG@10 of 0.193. This outperformed the SASRec baseline (0.117) and even surpassed the 7B-parameter LlamaRec in this specific context.

Table 2: Performance comparison on the MovieLens-1M dataset, showing 2Mamba4Rec achieving SOTA results.

Key Insights

  • The Hydra Advantage: Hydra-based layers can be 4 to 5 times faster than Mamba layers, suggesting that sequence mixing strategies are as vital as the underlying SSM logic.
  • Efficiency vs. Scale: While massive models like LlamaRec offer high accuracy, SSMs like Hydra4Rec provide superior efficiency, achieving competitive results with significantly fewer parameters (e.g., 840k vs. 7B).
  • Preference Optimization: ORPO proved highly effective for recommendation tasks, allowing models to learn nuanced user preferences by contrasting preferred items against rejected alternatives.

Limitations and Future Work

Despite the promising results, several challenges remain:

  • Hardware Constraints: SSMs currently lack optimized performance on CPUs, potentially limiting edge device deployment.
  • Optimizer Sensitivity: The USGM method is sensitive to hyperparameter selection and hardware variations.
  • Resource Intensity of LLMs: While ORPO streamlines fine-tuning, the underlying LLMs still require substantial computational resources, posing a barrier for smaller organizations.

Summary updated

Abstract

Recommender systems aim to estimate the dynamically changing user preferences and sequential dependencies between historical user behaviour and metadata. Although transformer-based models have proven to be effective in sequential recommendations, their state growth is proportional to the length of the sequence that is being processed, which makes them expensive in terms of memory and inference costs. Our research focused on three promising directions in sequential recommendations: enhancing speed through the use of State Space Models (SSM), as they can achieve SOTA results in the sequential recommendations domain with lower latency, memory, and inference costs, as proposed by arXiv:2403.03900 improving the quality of recommendations with Large Language Models (LLMs) via Monolithic Preference Optimization without Reference Model (ORPO); and implementing adaptive batch- and step-size algorithms to reduce costs and accelerate training processes.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Amazon Reviews '23 Beauty and Personal careHydra4RecHT@100.070subset=Beauty and Personal care
Source quote
L247: Hydra4Rec │ {0.070} │ {0.043} │ {{0.035}} │ {0.0042} │ {840k}
Amazon Reviews '23 Beauty and Personal careHydra4RecLatency0.0042subset=Beauty and Personal care
Source quote
L247: Hydra4Rec │ {0.070} │ {0.043} │ {{0.035}} │ {0.0042} │ {840k}
Amazon Reviews '23 Video GamesHydra4RecHT@100.112subset=Video Games
Source quote
L267: Hydra4Rec │ {0.112} │ {0.059} │ {0.044} │ {0.0037} │ {750k}
Amazon Reviews '23 Video GamesHydra4RecLatency0.0037subset=Video Games
Source quote
L267: Hydra4Rec │ {0.112} │ {0.059} │ {0.044} │ {0.0037} │ {750k}
MovieLens 1M · MovieLens-1MHydra4RecHT@100.308params=1M
Source quote
L287: Hydra4Rec │ {0.308} │ {0.179} │ {0.140} │ {0.0005} │ {290k}
MovieLens 1M · MovieLens-1MHydra4RecLatency0.0005params=1M
Source quote
L287: Hydra4Rec │ {0.308} │ {0.179} │ {0.140} │ {0.0005} │ {290k}
BibTeX
@misc{obozov2024exploring,
  author = {Mark Obozov and Makar Baderko and Stepan Kulibaba and Nikolay Kutuzov and Alexander Gasnikov},
  title = {{Exploring Applications of State Space Models and Advanced Training Techniques in Sequential Recommendations: A Comparative Study on Efficiency and Performance}},
  year = {2024},
  eprint = {2408.05606},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.05606},
}
Figure