Adversarial and Contrastive Variational Autoencoder for Sequential Recommendation

Zhe Xie, Chengxuan Liu, Yichi Zhang, Hongtao Lu, Dong Wang, Yue Ding

Introduction

Sequential recommendation systems aim to predict a user's next interaction based on their historical behavior. While Variational Autoencoders (VAEs) have proven effective as generative models for this task, they often suffer from a "representation bottleneck." Standard VAEs typically assume that latent variables follow a simple, independent Gaussian distribution. This rigid mathematical constraint often fails to capture the complex, interdependent nature of human preferences, leading to "blurry" latent representations where distinct user profiles become indistinguishable.

Methodology: The ACVAE Framework

To overcome these limitations, the authors propose the Adversarial and Contrastive Variational Autoencoder (ACVAE). This model enhances the standard VAE pipeline through three primary architectural innovations.

The architecture of ACVAE, featuring a hybrid GRU-CNN encoder and dual adversarial/contrastive components.

1. Adversarial Variational Bayes (AVB)

Instead of relying on the traditional Kullback-Leibler (KL) divergence to regularize the latent space, ACVAE employs an Adversary network. This discriminator-based approach allows the model to learn a more flexible "black box" posterior distribution. By moving away from simple Gaussian assumptions, the model can capture intricate dependencies between latent dimensions that are ignored by standard VAEs.

2. Contrastive Learning for Personalization

To ensure that the learned representations are highly personalized, ACVAE incorporates a contrastive loss. A second discriminator is trained to distinguish between a user’s true latent variable and a "shuffled" version. This mechanism forces the encoder to prioritize the most distinctive and salient features of a specific user's sequence, effectively filtering out common noise.

3. Hybrid GRU-CNN Encoder

While many models choose between Recurrent Neural Networks (RNNs) for long-term dependencies or Convolutional Neural Networks (CNNs) for local patterns, ACVAE utilizes both. The encoder consists of a Gated Recurrent Unit (GRU) followed by a specialized Convolutional layer. This hybrid structure allows the model to capture both the overarching historical context and the immediate, short-term transitions between adjacent items.

Experimental Evaluation

The model was evaluated against several state-of-the-art baselines, including FPMC, Caser, GRU4Rec+, BERT4Rec, and other VAE variants like Mult-VAE and SVAE. Testing was conducted on four benchmark datasets: MovieLens (Latest, 1m, 10m) and Yelp. These datasets represent a variety of interaction scales and sequence lengths.

Results and Discussion

ACVAE consistently outperformed all baseline models across all metrics (Recall, NDCG, and MRR) and datasets.

Performance comparison across four datasets. ACVAE consistently outperforms baselines in Recall, NDCG, and MRR.

Key findings from the empirical results include:

  • Superior Performance: On the MovieLens 1m dataset, ACVAE achieved a Recall@5 of 0.095, significantly surpassing the previous best VAE model, SVAE (0.077).
  • Comparison with Transformers: ACVAE outperformed BERT4Rec on most metrics. This suggests that for generative recommendation tasks, optimizing the latent space via adversarial training can be more effective than increasing the complexity of self-attention mechanisms.
  • Ablation Success: The authors confirmed that each component—AVB, contrastive loss, and the hybrid encoder—contributes significantly to the final performance. Removing any of these elements resulted in a measurable decline in accuracy across all benchmarks.

Conclusion

By integrating adversarial and contrastive learning, ACVAE breaks the restrictive assumptions of traditional VAEs, leading to more expressive and personalized latent representations. While the model shows significant promise, future work may explore bidirectional sequence modeling and strategies to mitigate the computational overhead associated with adversarial training.

Summary updated

BibTeX
@inproceedings{xie2021adversarial,
  author = {Zhe Xie and Chengxuan Liu and Yichi Zhang and Hongtao Lu and Dong Wang and Yue Ding},
  title = {{Adversarial and Contrastive Variational Autoencoder for Sequential Recommendation}},
  booktitle = {The Web Conference},
  year = {2021},
  doi = {10.1145/3442381.3449873},
}
Figure