Abstract
Sequential Recommendation (SR) often suffers from data sparsity and noise. While Contrastive Learning (CL) has emerged as a powerful solution, traditional random augmentation techniques—such as masking or cropping—are often "blind" to the underlying semantics of user behavior. This paper introduces LACLRec, a framework featuring a learnable sequence augmenter and a triplet contrastive loss. By intelligently denoising and completing sequences, LACLRec establishes a hierarchy of similarity that significantly improves recommendation performance across multiple benchmarks.
Introduction
Sequential Recommendation (SR) aims to predict a user's next interaction by modeling their historical sequence of activities. However, real-world interaction data is frequently sparse and noisy, containing accidental clicks or missing critical transitions. Contrastive Learning (CL) addresses these challenges by generating augmented views of sequences and maximizing their mutual information. Yet, standard CL methods rely on random perturbations (e.g., random masking, reordering, or cropping) that can inadvertently destroy temporal correlations or remove essential items.
To overcome these limitations, we present LACLRec (Learnable sequence Augmentor for triplet Contrastive Learning in sequential Recommendation). LACLRec moves beyond random augmentation by employing a self-supervised Transformer-based augmenter. This model learns to "curate" sequences by identifying important items to keep, noisy items to delete, and missing items to insert.
The LACLRec Framework
The proposed architecture consists of three primary stages: training the learnable augmenter, performing triplet contrastive learning, and training the final recommender.
1. SSL Sequence Augmenter
The core innovation is a Transformer-based augmenter trained to restore sequences. Unlike random rules, this module learns three distinct operations:
- Keep: Preserving items that are central to the user's intent.
- Delete: Removing "noisy" interactions that deviate from established patterns.
- Insert: Filling gaps in sparse sequences using a reverse generator to strengthen transition signals.
By treating augmentation as a denoising and completion task, the augmenter provides the recommender with high-quality, semantically consistent "positive" samples.
2. Triplet Contrastive Module and Loss
Most CL models utilize a binary contrastive approach (positive vs. negative). LACLRec introduces a triplet contrastive module that considers three views of a user sequence: the raw sequence ($S_u$), the intelligently augmented sequence ($S_u^{aug1}$), and a traditionally random-augmented sequence ($S_u^{aug2}$).
The model employs a ranking-based triplet loss designed to enforce a hierarchy of similarity. It maximizes the similarity between the raw sequence and the high-quality SSL-augmented version, while explicitly minimizing the similarity between the raw sequence and the lower-quality random augmentation. This fine-grained supervision helps the encoder distinguish between meaningful patterns and random noise.
Experimental Evaluation
LACLRec was evaluated on three public benchmarks: Amazon Beauty, Yelp, and Amazon Sports. Preprocessing ensured the removal of "cold" users and items with fewer than five interactions.
Key Results
- Superior Accuracy: LACLRec consistently outperformed strong baselines, including CL4SRec, DuoRec, and CoSeRec. It achieved improvements of up to 10.18% in aggregate metrics over CL4SRec.
- Noise Resilience: In robustness tests involving intentional data corruption, LACLRec exhibited the smallest performance decline, validating its ability to handle "dirty" real-world data.
- Ablation Success: Removing either the learnable augmenter or the triplet loss led to significant performance drops, confirming that both components are vital for capturing robust user representations.
Conclusion
LACLRec demonstrates that data augmentation for sequential recommendation should be a "smart" process rather than a random one. By framing augmentation as a denoising task and utilizing a triplet loss to rank the quality of augmented views, the model achieves superior accuracy and robustness. Future work will focus on reducing the computational overhead of the Transformer-based augmenter and exploring more efficient pre-training strategies.
Summary updated