Journal of Computer Applications

    Next Articles

Sequential recommendation based on long- and short-term interest dual encoding and contrastive learning

  

  • Received:2026-02-27 Revised:2026-05-07 Online:2026-05-28 Published:2026-05-28

基于长短期兴趣双编码与对比学习增强的序列推荐

曾雯1,王玉菡1,解庆2,汤梦姿1,刘永坚3   

  1. 1. 武汉理工大学,计算机与人工智能学院
    2. 武汉理工大学计算机与人工智能学院
    3. 武汉理工大学计算机科学与技术学院
  • 通讯作者: 汤梦姿
  • 基金资助:
    国家自然科学基金

Abstract: Sequential recommendation aims to predict the next item that a user is likely to interact with based on historical behavior sequences. However, most existing sequential recommendation methods model user interest with a unified sequence representation or only perform modeling in the time domain. As a result, the modeling of long-term stable preferences and short-term dynamic interests is often implicit or tightly coupled, which makes it difficult to effectively distinguish interest patterns at different temporal scales in the representation space. To improve temporal decoupling and prediction accuracy of sequence representations, this paper proposes a sequential recommendation method enhanced by long–short dual encoding and contrastive learning, named LSDCRec (Long and Short-term Dual Encoding and Contrastive Learning). The method adopts a dual-encoder architecture. The long-term interest encoder projects sequence embeddings into the frequency domain using the Fast Fourier Transform and extracts stable long-term preferences through a global filtering mechanism that progressively expands the preserved low-frequency bands. The short-term interest encoder combines a Gated Recurrent Unit and a cross multi-head attention mechanism, where the original input is used as the query and the GRU outputs are used as keys and values to model rapid changes in recent interactions. Long-term and short-term interest representations are adaptively fused through learnable weights. In addition, contrastive learning with data augmentation is introduced, and the InfoNCE loss is used to enhance the discriminability and robustness of sequence representations. Experimental results on three public datasets show that LSDCRec achieves average improvements of 3.27% in Recall and 3.45% in NDCG over the strongest baseline methods. The results verify the effectiveness of frequency-domain long-term preference modeling and short-term dynamic Abstract: interest extraction, and demonstrate the important role of contrastive learning in alleviating representation degeneration in sequential recommendation.

Key words: sequential recommendation, fast fourier transform, gated recurrent unit, attention mechanism, contrastive learning, long- and short-term interests

摘要: 摘 要: 序列推荐旨在依据用户历史行为序列预测下一次交互目标,但现有序列推荐方法多采用统一的序列表示来刻画用户兴趣,或仅在时域中对不同行为进行建模,对长期稳定偏好与短期动态变化的建模往往是隐式的或耦合的,难以在表示层面实现对不同时间尺度兴趣特征的有效区分。为提高序列表示的时域解耦能力与预测精度,构建了一种长短期双编码与对比学习增强的序列推荐方法,LSDCRec(Long- and Short-term Dual Encoding and Contrastive Learning)。该方法采用双编码结构,其中长期兴趣编码器借助快速傅里叶变换FFT将序列嵌入投影到频域,通过低频保留的全局滤波机制逐层扩展可保留频段,以提取稳定的长期偏好;短期兴趣编码器结合门控循环单元GRU与交叉多头注意力结构,以原始输入为查询、GRU输出为键和值,以表征近期交互的快速变化特征。长短期兴趣表示通过可学习权重实现自适应融合,并在对比学习框架下结合数据增强策略,利用InfoNCE损失提升序列表示的判别性与鲁棒性。在三个公开数据集上的实验结果表明,LSDCRec在Recall和NDCG平均超过最优基线方法3.27%和3.45%。结果验证了频域长期偏好建模与短期动态兴趣提取的有效性,并说明对比学习在缓解序列表示退化问题方面具有重要作用。

关键词: 序列推荐, 快速傅里叶变换, 门控循环单元, 注意力机制, 对比学习, 长短期兴趣

CLC Number: