NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sequential Recommendation with Diffusion Models

Hanwen Du, Huanhuan Yuan, Zhen Huang, Pengpeng Zhao, Xiaofang ZhouarXiv 2023 · DOI

Abstract

Sequential recommendation systems often struggle with the inherent uncertainty of user behavior and exposure bias in deterministic models. This paper introduces DiffRec, the first framework to successfully adapt diffusion models for sequential recommendation. By treating recommendation as a generative denoising process and focusing noise on the target item while preserving historical context, DiffRec captures complex user distributions and outperforms state-of-the-art baselines like SASRec and BERT4Rec across multiple benchmarks.

Introduction

Sequential recommendation aims to predict a user's next action based on their interaction history. Traditional models typically represent items as fixed-point vectors in a deterministic space. However, this approach faces two significant challenges: uncertainty in user behavior, where a single vector cannot capture the range of potential future interests, and exposure bias, where models overfit to specific training items and fail to generalize.

While generative models like Variational Auto-Encoders (VAEs) and GANs have attempted to address these issues, they often suffer from posterior or model collapse. Diffusion models offer a stable generative alternative but are traditionally designed for continuous data (like images) rather than discrete item IDs. DiffRec bridges this gap, adapting the diffusion paradigm to the recommendation domain.

Methodology

DiffRec adapts the diffusion process through three primary innovations designed for the discrete and temporal nature of recommendation data:

  1. Bridging Discrete and Continuous Spaces: To apply diffusion, which operates in continuous space, DiffRec uses a transition layer. The forward process maps discrete items to hidden embedding vectors, while the reverse process employs a softmax layer to convert these vectors back into a probability distribution over the item catalog.
  2. Target-only Noising: Unlike standard diffusion that noises the entire input, DiffRec applies Gaussian noise only to the target item. This preserves the user's historical sequence as a high-fidelity guiding signal for the denoising process.
  3. Denoise Sequential Recommender (DSR): The core architecture is a Transformer-based denoiser. It processes the noised target item alongside the user's history, position embeddings, and a diffusion-step embedding to reconstruct the original item.
Figure 1: The forward and reverse diffusion process in DiffRec, highlighting the target-only noising strategy.

To address the computational overhead of diffusion inference, the authors utilize Importance Sampling during training to focus on difficult denoising steps. For inference, they implement a "shortcut" strategy that predicts the final item in minimal steps, averaging results across multiple random noise seeds to enhance robustness.

Experiments and Results

The model was evaluated on three benchmark datasets: Amazon Beauty, Amazon Toys, and MovieLens-1M (ML-1M). These datasets represent a mix of sparse and dense interaction data.

DiffRec consistently outperformed all baselines, including standard Transformers (SASRec, BERT4Rec) and existing generative models (ACVAE, MFGAN). As shown in the results table, DiffRec achieved significant improvements in accuracy and ranking metrics.

Figure 4: Performance comparison of DiffRec against state-of-the-art baselines across three datasets.

Key Findings

  • Accuracy Gains: On the Beauty dataset, DiffRec improved HR@5 by 16.27% and NDCG@5 by 23.48% over the strongest baseline.
  • Robustness: The model performed exceptionally well on both sparse (Amazon) and dense (MovieLens) datasets, demonstrating its ability to handle various data distributions.
  • Probabilistic Modeling: By treating items as distributions, DiffRec effectively manages "fuzzy" user preferences, understanding the neighborhood of items a user might like rather than just a single point.

Conclusion

DiffRec demonstrates that diffusion models can be highly effective for sequential recommendation when properly adapted. By focusing noise on the target item and leveraging the power of generative denoising, the model captures user uncertainty more effectively than deterministic alternatives. Future work may involve extending this framework to "next-K" item prediction and integrating contrastive learning to further refine item embeddings.

Summary updated

BibTeX
@misc{du2023sequential,
  author = {Hanwen Du and Huanhuan Yuan and Zhen Huang and Pengpeng Zhao and Xiaofang Zhou},
  title = {{Sequential Recommendation with Diffusion Models}},
  year = {2023},
  eprint = {2304.04541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.04541},
}
Figure