SLSREC: Self-Supervised Contrastive Learning for Adaptive Fusion of Long- and Short-Term User Interests

Wei Zhou, Yue Shen, Junkai Ji, Yinglan Feng, Xing Tang, Xiuqiang He, Liang Feng, Zexuan ZhuarXiv 2026

TL;DR

SLSRec is a novel sequential recommendation framework that explicitly disentangles a user's long-term stable preferences from their short-term transient intentions. By combining time-aware session segmentation, category-masked encoders, and self-supervised contrastive learning, it adaptively fuses multi-scale user interests to achieve state-of-the-art recommendation accuracy.

What Problem Does This Paper Address?

Modern recommender systems must navigate a complex duality in user behavior: stable, long-term preferences (e.g., a persistent interest in digital electronics) and highly dynamic, short-term intentions (e.g., temporarily shopping for a suitcase before a trip).

Existing sequential recommendation (SR) models struggle to balance these two temporal scales. Many approaches either compress a user's entire interaction history into a single unified representation or focus too narrowly on local, recent behaviors. This causes "representation entanglement," where transient short-term needs pollute long-term preference profiles, or vice versa. Furthermore, without explicit supervisory signals, it is incredibly difficult for deep learning models to accurately calibrate and separate these multi-scale interest dynamics.

Methods

SLSRec addresses these challenges through a modular, session-based architecture designed to isolate, calibrate, and adaptively combine long- and short-term (LS-term) interests.

Figure 1: The overall architecture of SLSRec

The framework consists of four key components:

  1. Time-aware Session Segmentation: Instead of treating history as a uniform sequence, SLSRec partitions user interactions into distinct sessions based on a time-interval threshold ($\omega$). Proximate interactions form a session, capturing high intra-session coherence.
  2. Short-term Interest Encoder: Operating on the most recent session, this encoder utilizes self-attention paired with a novel category mask matrix. This mask prioritizes the dominant product category within the current session, allowing the model to filter out noise and focus on immediate intent.
  3. Long-term Interest Encoder: This module extracts interest representations from all historical sessions ($1$ to $k-1$). It passes these session embeddings through a Gated Recurrent Unit (GRU) to capture preference evolution over time. A Weighted Aggregation Attention Mechanism (WAAM) then quantifies how much each historical session aligns with the current target item.
  4. Self-Supervised Contrastive Learning: To enforce explicit disentanglement without manual labels, the authors introduce a contrastive learning strategy using Triplet Loss. It uses the average item embeddings of historical and current sessions as proxy ground truths, forcing the long-term and short-term encoders to align with their respective targets while pushing opposing representations apart.
  5. Adaptive Fusion: Rather than a static combination, a gating network dynamically weights the importance of long- vs. short-term interests based on the specific target item being evaluated.

Datasets

The authors evaluated SLSRec on three public, real-world e-commerce datasets encompassing user behaviors like clicks, adds-to-cart, and purchases:

  • Taobao: User-item interaction data spanning November 25 to December 4, 2017.
  • Tmall: A large-scale e-commerce dataset featuring highly diverse user action sequences.
  • Cosmetics: E-commerce event history from an online cosmetics shop, characterized by shorter average sequence lengths.

Key Insights and Ideas

  • Explicit Supervision via Triplet Loss: Relying on a recommendation loss alone isn't enough to separate long- and short-term interests. By introducing four distinct triplet objectives, SLSRec explicitly forces semantic separation between stable preferences and transient goals.
  • The Power of Category Masking: Short-term shopping bursts are usually highly category-focused. Masking out irrelevant categories within the active session prevents accidental noise from distorting the immediate intent vector.
  • Target-Aware Fusion Dynamics: The balance between long- and short-term influence shouldn't be fixed. When a user explores a completely novel item, the model dynamically relies more heavily on long-term preferences; when interacting with familiar items, short-term intent dominates.

Key Results

SLSRec was compared against a wide array of baselines, including holistic models (DIN, DIEN), Transformer-based models (SASRec, BERT4Rec), and existing LS-term models (SLi-Rec, CLSR, LSDIN).

  • State-of-the-Art Performance: SLSRec consistently outperformed all baselines across all datasets. On the Taobao dataset, it achieved a +6.43% relative improvement in MRR and a +7.94% improvement in NDCG@2 over the strongest baseline.
  • Ablation Cruciality: Removing the short-term interest encoder caused the most drastic performance drops (e.g., an AUC drop of up to 39.9% on Cosmetics), proving that capturing immediate intent is paramount for next-item prediction.
  • Hyperparameter Sensitivity: The model performs optimally when the session segmentation threshold ($\omega$) is tightly tuned to the dataset's natural cadence (e.g., 90 minutes for Taobao vs. 30 minutes for Cosmetics).

Limitations and Future Work

Not discussed in the paper.

Summary updated

BibTeX
@misc{zhou2026slsrec,
  author = {Wei Zhou and Yue Shen and Junkai Ji and Yinglan Feng and Xing Tang and Xiuqiang He and Liang Feng and Zexuan Zhu},
  title = {{SLSREC: Self-Supervised Contrastive Learning for Adaptive Fusion of Long- and Short-Term User Interests}},
  year = {2026},
  eprint = {2604.04530},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.04530},
}
Figure