Source-linked AI summary
DiffuRec: A Diffusion Model for Sequential Recommendation
Zihao Li, Aixin Sun, Chenliang Li
TL;DR
Sequential recommendation commonly uses fixed item vectors, limiting representation of latent item aspects and diverse user interests. DiffuRec adapts diffusion to generate distributional item representations and inject uncertainty, and it outperforms nine strong baselines across four datasets.
Problem
Fixed-vector sequential recommendation representations may not simultaneously capture multiple latent item aspects and users’ diverse interests, while existing methods lack a unified distributional framework.
Method
DiffuRec adapts diffusion to sequential recommendation by corrupting target item embeddings with Gaussian noise and generating distribution representations for historical items.
Results
DiffuRec outperforms nine existing strong baselines by a large margin on four real-world datasets.
Takeaways & Limitations
DiffuRec demonstrates that diffusion-based distribution representations can model item aspects and user intentions within sequential recommendation.
Takeaways & Limitations
VAE-based alternatives are described as having limited representation capacity and posterior-collapse issues, while one alternative reconstruction objective failed to converge.
Abstract
from arXiv · showhide
Mainstream solutions to Sequential Recommendation (SR) represent items with fixed vectors. These vectors have limited capability in capturing items' latent aspects and users' diverse preferences. As a new generative paradigm, Diffusion models have achieved excellent performance in areas like computer vision and natural language processing. To our understanding, its unique merit in representation generation well fits the problem setting of sequential recommendation. In this paper, we make the very first attempt to adapt Diffusion model to SR and propose DiffuRec, for item representation construction and uncertainty injection. Rather than modeling item representations as fixed vectors, we represent them as distributions in DiffuRec, which reflect user's multiple interests and item's various aspects adaptively. In diffusion phase, DiffuRec corrupts the target item embedding into a Gaussian distribution via noise adding, which is further applied for sequential item distribution representation generation and uncertainty injection. Afterward, the item representation is fed into an Approximator for target item representation reconstruction. In reverse phase, based on user's historical interaction behaviors, we reverse a Gaussian noise into the target item representation, then apply a rounding operation for target item prediction. Experiments over four datasets show that DiffuRec outperforms strong baselines by a large margin.
1 INTRODUCTION
Sequential recommendation models user interest evolution from interaction histories, but fixed item vectors may not capture multiple item aspects and diverse user interests. DiffuRec addresses this gap by introducing diffusion-based distribution representations and reports strong empirical gains.
- Sequential recommendation predicts a user’s next item from historical interaction records by modeling interest evolution.
- Fixed item vectors may inadequately capture multiple latent item aspects and diverse user preferences simultaneously.Items can contain different themes or categories, while users may pursue multiple interests.
- Existing approaches use multi-interest mechanisms or VAE-based distributions, but no unified framework models user interests and item aspects as distributions.These methods also face heuristic interest counts or VAE representation-capacity and posterior-collapse issues.
- DiffuRec is presented as the first diffusion-model approach for sequential recommendation, using diffusion’s distribution-generation capability to represent multiple interests and item aspects.The paper motivates diffusion models based on their reported success in computer vision and natural language processing.
- DiffuRec adds Gaussian noise to the target item embedding to generate historical-item distribution representations, incorporating target-item guidance and uncertainty during training.The noised target representation provides supervised information for representation generation.
- Experiments on four real-world datasets show that DiffuRec outperforms nine existing strong baselines by a large margin, with ablations supporting its components.
2 RELATED WORK
Related work spans sequential modeling, multi-interest recommendation, probabilistic representation learning, and diffusion models. These lines of research motivate DiffuRec while exposing limitations in fixed-vector, VAE-based, and conventional sequence-modeling approaches.
- 2.1 Sequential Recommendation: Sequential recommendation research progressed from Markov chains and recurrent or convolutional networks to attention-based and graph-based sequence models.SASRec and BERT4Rec use Transformer architectures, while GNN methods capture high-order item relationships.
- 2.2 Multi-Interest Modeling: Multi-interest methods use soft attention or dynamic routing to represent users’ diverse preferences, but typically require a heuristically predefined number of interests.
- 2.3 Representation Distribution and Uncertainty Modeling: VAE-based approaches model probabilistic latent variables and representation distributions, yet struggle with representation degeneration and posterior-collapse issues.
- 2.4 Diffusion Models: Diffusion models generate representations through stochastic processes and have shown strong potential in computer vision, natural language processing, and other fields.Representative applications include iterative denoising for super-resolution and text-conditional image generation.
3 PRELIMINARY
Diffusion models transform an original representation into Gaussian noise through a forward Markov process, then iteratively denoise it to recover the original representation. A neural approximator estimates the unknown original representation during reversal.
- Forward diffusion: Diffusion incrementally corrupts x0 into Gaussian noise xt through a Markov chain.The forward process proceeds from x0 through x1, ..., xt, with βt controlling the injected noise.
- Forward diffusion: A predefined noise schedule β determines how much noise is injected at each diffusion step.Common schedules include square-root, cosine, and linear forms.
- Reverse diffusion: Reverse diffusion iteratively denoises xt through x_t−1, ..., x1 to approximate x0.Each reverse step calculates the next representation from the current denoised representation.
- Reverse diffusion: Because x0 is unknown during reversal, a neural network fθ estimates it and is trained with a variational lower bound.The VLB includes terms for matching the forward terminal distribution, reverse-process divergence, and final prediction likelihood.
- Approximator: The approximator εθ can be instantiated with a Transformer or U-Net to support noise injection and diffusion.The noise variable ε is sampled from a standard Gaussian distribution.
4 METHODOLOGY
DiffuRec adapts diffusion to sequential recommendation by generating distributional item representations from noisy target embeddings and reconstructing the target through a Transformer approximator. Training injects uncertainty and target guidance, while inference reverses Gaussian noise iteratively before prediction.
- Overview: DiffuRec comprises an approximator, a diffusion training process, and a reverse inference phase for target-item prediction.The approximator reconstructs target representations, diffusion incorporates target guidance and noise, and reversal performs prediction.
- Overview: The model treats a static item embedding as semantic encoding, then noises the target embedding to generate distribution representations for historical items.This enables item aspects and user intentions to be represented as distributions rather than fixed vectors.
- Reverse phase: During reverse inference, DiffuRec samples xt from a standard Gaussian and repeatedly uses the trained approximator to estimate x0 and generate x_t−1.The process continues until x0 is reached, after which rounding is used for target-item prediction.
- Approximator: The Approximator uses a Transformer backbone to reconstruct the target representation from sequence representations and step information.Transformer components include self-attention, feed-forward layers, normalization, dropout, residual connections, and multiple stacked blocks.
- Distribution representation: Step embeddings identify diffusion or reverse steps, while Gaussian λi samples perturb historical item embeddings for distribution representation generation.In diffusion, x is the noised target embedding; in reversal, x is the representation being iteratively denoised.
- Diffusion training: DiffuRec uses a truncated linear βs schedule and randomly samples diffusion steps during training.The schedule controls noise injection, with truncation applied when βs exceeds τ.
- Loss function: The model uses cross-entropy rather than mean-squared error because item embeddings are static in latent space and recommendation commonly uses inner products.The approximator reconstructs x̂0, whose inner product with item embeddings supports target prediction.
- Uncertainty injection: Injected diffusion and sampling noise introduce uncertainty intended to improve robustness and allow historical-item aspects to be adjusted iteratively in a user-aware manner.The reverse process changes latent-aspect importance across reverse steps.
5 EXPERIMENTS
The experiments evaluate DiffuRec on four real-world sequential-recommendation datasets against conventional, multi-interest, and uncertainty-modeling baselines. Evaluation uses leave-one-out chronological splits and HR@K and NDCG@K at K = 5, 10, and 20.
- Baselines and research questions: The study compares DiffuRec with nine baselines spanning conventional sequential recommendation, multi-interest modeling, and uncertainty modeling.The experiments are designed to assess overall performance, design choices, hyperparameters, efficiency, sequence-length effects, popularity effects, diversity, and uncertainty.
- Datasets: Four real-world datasets are used: Amazon Beauty, Amazon Toys, Movielens-1M, and Steam.The datasets cover Amazon reviews, movie ratings, and an online video-game platform.
- Preprocessing: Reviews and ratings are converted to implicit feedback, interactions are ordered chronologically, and users or items below activity thresholds are filtered.Inactive users have fewer than 5 actions, and unpopular items are removed.
- Evaluation protocol: Leave-one-out evaluation uses the most recent interaction for testing, the penultimate interaction for validation, and earlier interactions for training.This split is applied across all datasets.
- Evaluation metrics: Performance is measured with HR@K and NDCG@K for K = 5, 10, and 20.HR@K measures top-K hits, while NDCG@K additionally accounts for hit ranking positions.
The Conventional Sequential Neural Models
Conventional sequential recommendation models learn item representations as fixed embedding vectors and use sequence architectures to model user behavior. Representative approaches include recurrent, convolutional, and self-attention-based models.
- Representative models: GRU4Rec uses a GRU to model users’ sequential behavior for recommendation.
- Representative models: Caser applies horizontal and vertical CNNs to exploit users’ recent subsequence behaviors.
- Representative models: SASRec uses a unidirectional Transformer with a masked encoder to model implicit item correlations.It is described as a competitive sequential-recommendation benchmark.
- Representative models: BERT4Rec uses a bidirectional Transformer with a cloze task because unidirectional architectures are considered insufficient for behavior modeling.
Multi-Interest Models
Multi-interest sequential recommendation models represent users’ diverse preferences through learned interest representations, but their approaches differ in supervision and flexibility.
- ComiRec uses attention and dynamic routing to extract and recommend from a user’s multiple interests.
- TiMiRec adds an auxiliary loss that uses the target item as a supervised signal for interest distribution generation.
VAE and Uncertainty Models
VAE-based and distribution-aware methods extend sequential recommendation beyond fixed vectors by modeling uncertainty and item relationships. DiffuRec’s experiments report broad gains, while ablations identify important design choices and schedule-dependent variation.
- VAE-based Models: SVAE combines GRU with a variational autoencoder, while ACVAE uses adversarial variational Bayes to generate sequential recommendation representations.
- VAE-based Models: STOSA uses Wasserstein self-attention with Gaussian distributions to model item correlations, while injecting dynamic uncertainty.
- Overall Comparison: DiffuRec consistently outperforms all baselines across four datasets and six metrics, with HR/NDCG gains up to 57.26%/56.72%.The reported maximum occurs on Amazon Beauty against the best baseline.
- Overall Comparison: The results support a unified treatment of multiple item aspects, multiple user interests, uncertainty, and target-item guidance.
- Overall Comparison: Transformer-based models generally outperform GRU4Rec and Caser, while multi-interest models do not consistently surpass SASRec and BERT4Rec.
- Ablation Study: Replacing the Transformer Approximator with GRU can retain superior performance on Movielens-1M and Steam while significantly reducing space and time complexity.
- Ablation Study: Replacing DiffuRec’s inner-product rounding strategy reduces HR/NDCG by at least 68.71%/74.61% on Amazon Beauty.The corresponding minimum reductions are also reported for Amazon Toys, Movielens-1M, and Steam.
- Ablation Study: The truncated linear schedule can produce the best results on some datasets but sub-optimal performance on others, while schedule differences generally do not create huge fluctuations.
5.6 Impact of Hyper-parameter Setting (RQ3)
The experiments examine how noise scheduling and λ affect DiffuRec, including comparisons with adversarial training. Small λ values generally perform better, while excessive noise degrades recommendation quality.
- λ sensitivity: Small λ generally produces better performance on Amazon Beauty and Movielens-1M.Increasing λ to 0.1 sharply reduces HR and NDCG, especially on Movielens-1M.
- Noise scheduling: The diffusion noise schedule determines how noise is injected across steps, with DiffuRec using a truncated linear schedule for β_s.
- λ sensitivity: Large λ may corrupt historical interaction information and hinder precise understanding of user interest.
- Adversarial comparison: Adversarial Transformer improves BERT4Rec on Amazon Beauty and Movielens-1M for HR and NDCG by at least 2.57%/10.23% and 8.05%/4.89%, respectively.
- Adversarial comparison: DiffuRec surpasses adversarial Transformer by a large margin on all datasets.The paper attributes this to target-item information being introduced as supervised signals alongside uncertainty and perturbation.
5.8 Performance on Varying Lengths of Sequences and Items with Different Popularity (RQ5)
DiffuRec is evaluated across item popularity, sequence lengths, convergence, inference efficiency, and reverse-step settings. It generally outperforms baselines, while moderate reverse-step counts balance quality and speed.
- Dataset distributions: Movielens-1M contains predominantly short sequences and long-tail items despite having longer sequences and more interactions than Amazon Beauty.
- Item popularity: DiffuRec outperforms all baselines in most head- and long-tail-item settings, particularly on NDCG.Head-item performance exceeds long-tail performance for every model; the gap is smaller on Movielens-1M than Amazon Beauty.
- Sequence length: DiffuRec achieves the best results across all evaluated sequence-length settings, indicating robustness to sequence length.The paper notes that short sequences may lack sufficient preference information, while very long sequences challenge all models.
- Convergence: DiffuRec converges around 100 epochs on Movielens-1M, compared with around 250 epochs for SASRec.On Amazon Beauty, both models converge after 150 epochs.
- Efficiency: With two diffusion steps, DiffuRec’s inference time is close to SASRec and BERT4Rec, but inference time rises exponentially as reverse steps increase.The authors consider 32 or 64 reverse steps a sufficient quality–time compromise for sequential recommendation.
- Efficiency: DiffuRec’s average training time is close to SASRec, ACVAE, STOSA, and BERT4Rec, with reported times ranging from 14s to 18s.GRU4Rec trains significantly faster because its architecture is more lightweight.
5.10 Visualization of Uncertainty and Diversity (RQ7)
Visualization studies show that DiffuRec produces clustered yet varied reconstructions for the same sequence and recommends a broader range of categories. This supports its uncertainty and diversity mechanisms.
- Uncertainty: Reconstructions from one sequence remain relatively close across 100 Gaussian noises while retaining deviations from one another.Reconstructions from random sequences are dispersed throughout the representation space.
- Uncertainty: Reversing 100 representations for one sequence yields 643 unique top-20 items on Amazon Beauty and 82 on Movielens-1M.Parallel generation of these representations produces diversified retrieval results.
- Diversity: DiffuRec recommends a wider range of item categories than SASRec and TimiRec, which tend to concentrate on similar categories.STOSA also produces broader category coverage than the category-focused baselines.
6 CONCLUSION
The paper introduces DiffuRec as the first adaptation of diffusion models to sequential recommendation, using distributional representations to model latent item aspects and multi-level user interests. Experiments demonstrate superiority on four real-world datasets, while broader applications remain under-explored.
- Contribution: DiffuRec adapts diffusion and reverse processes to sequential recommendation and designs an Approximator for the new setting.
- Contribution: The method replaces single-vector item representations to model items’ latent aspects and users’ multi-level interests.
- Findings: Experiments demonstrate DiffuRec’s superiority on four real-world datasets and evaluate the effectiveness of its designed components.
- Future scope: Adapting diffusion models to other recommendation scenarios, including session-based recommendation and click-through rate prediction, remains under-explored.