Source-linked AI summary

Adversarial and Contrastive Variational Autoencoder for Sequential Recommendation

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

arXiv:2103.10693v1cs.IRcs.LG

TL;DR

Sequential VAE models can have limited approximate-posterior representations, affecting the quality of generated sequences. ACVAE combines AVB, contrastive loss, and recurrent-convolutional sequence encoding; the paper reports that it outperforms other methods across four datasets and all evaluated metrics.

  • Problem

    Sequential VAE models may have limited approximate-posterior representations, restricting the quality of generated samples and the user-specific information in latent variables.

    Source: §1 · p. 2
  • Method

    ACVAE uses AVB for adversarial training, contrastive loss for personalized latent characteristics, and recurrent-convolutional encoding to capture sequence relationships.

    Source: §1 · p. 2
  • Results

    ACVAE outperforms other methods across four datasets on all evaluated top-k recommendation metrics, while baseline performance varies with dataset characteristics.

    Source: §4.5 · p. 8
  • Takeaways & Limitations

    The paper presents ACVAE as a way to enhance sequential recommendation encoders’ representation of sequential information and users’ unique preferences.

    Source: §5 · p. 10

Abstract

from arXiv · show

Sequential recommendation as an emerging topic has attracted increasing attention due to its important practical significance. Models based on deep learning and attention mechanism have achieved good performance in sequential recommendation. Recently, the generative models based on Variational Autoencoder (VAE) have shown the unique advantage in collaborative filtering. In particular, the sequential VAE model as a recurrent version of VAE can effectively capture temporal dependencies among items in user sequence and perform sequential recommendation. However, VAE-based models suffer from a common limitation that the representational ability of the obtained approximate posterior distribution is limited, resulting in lower quality of generated samples. This is especially true for generating sequences. To solve the above problem, in this work, we propose a novel method called Adversarial and Contrastive Variational Autoencoder (ACVAE) for sequential recommendation. Specifically, we first introduce the adversarial training for sequence generation under the Adversarial Variational Bayes (AVB) framework, which enables our model to generate high-quality latent variables. Then, we employ the contrastive loss. The latent variables will be able to learn more personalized and salient characteristics by minimizing the contrastive loss. Besides, when encoding the sequence, we apply a recurrent and convolutional structure to capture global and local relationships in the sequence. Finally, we conduct extensive experiments on four real-world datasets. The experimental results show that our proposed ACVAE model outperforms other state-of-the-art methods.

1 INTRODUCTION

Sequential recommendation models next-item choices from interaction histories, but sequential VAE models can be limited by low-quality approximate posteriors. ACVAE combines adversarial and contrastive learning with a convolutional encoder layer to improve latent representations for sequential recommendation.

1 INTRODUCTION

  • Traditional collaborative filtering can miss changing item dependencies, while sequential recommenders use interaction context to model dynamic preferences and predict the next item.Sequential methods seek patterns and dependencies among items in a user’s interaction sequence.Source: §1 · p. 1
  • FPMC uses Markov chains but cannot capture long-term sequence information; RNN-based methods capture longer-term information, while attention-based models capture global dependencies.The introduction describes attention-based models such as SASRec and BERT4Rec as achieving better prediction results than RNN-based models.Source: §1 · pp. 1–2
  • Sequential VAE models can obtain low-quality approximate posteriors, limiting the information in latent variables used to generate sequences and represent user-specific preferences.The paper seeks latent variables informative enough for the decoder and distinct enough across users to support personalized sequences.Source: §1 · p. 2
  • ACVAE introduces AVB to make the approximate posterior more flexible and reduce latent-dimension correlations, contrastive loss to learn personalized user characteristics, and convolution to capture local item relationships.The convolutional layer is added to the RNN-based encoder to capture local dependencies between adjacent items.Source: §1 · p. 2

2 RELATED WORK

Prior work addresses sequential dependencies with Markov, recurrent, convolutional, hierarchical, and attention-based models. VAE variants model recommendation preferences, while adversarial learning has been applied to VAE and recommendation but remains underexplored for sequential recommendation.

2.1 Sequential Recommendation

  • Sequential recommendation predicts the next item from a user’s interaction history, with prior methods using Markov chains, recurrent networks, CNNs, hierarchical structures, and attention to model sequence dependencies.Examples include Caser, FPMC, LSTM, GRU [5], SASRec, and BERT4Rec.Source: §2.1 · p. 2

2.2 VAE for Recommendation

  • VAE learns an approximate posterior over latent variables; recommendation variants include Mult-VAE, sequential SVAE, CVRCF, MacridVAE, and RecVAE.SVAE processes item sequences with a GRU and outputs a probability distribution over candidate items.Source: §2.2 · p. 2

2.3 Adversarial Learning

  • Adversarial Variational Bayes combines GAN and VAE to approximate the real posterior, but the paper identifies a lack of work applying adversarial learning to sequential recommendation.VAEGAN is cited as using AVB for implicit variational inference.Source: §2.3 · p. 3

3 THE METHOD

ACVAE encodes interaction sequences with recurrent and convolutional layers, then sends the resulting latent variable to the decoder, discriminator, and adversary. The discriminator and adversary receive different paired inputs to calculate the contrastive loss and approximate KL divergence, respectively.

3 THE METHOD

  • The user interaction sequence enters an encoder composed of RNN-CNN layers and a noise function after embedding, producing latent variable z.The model has contrast, encoder, and adversary parts.Source: §3 · p. 3
  • The encoder’s latent variable z is passed to the decoder, discriminator, and adversary.The adversary pairs (x, z) with (x, z′) sampled from a normal Gaussian distribution.Source: §3 · p. 3
  • The discriminator pairs (x, z) with shuffled latent variable (x, z~) for contrastive loss, while the adversary pairs (x, z) with (x, z′) for approximate KL divergence.Both networks can optimize encoder parameters through back-propagation.Source: §3 · p. 3

3.1 Problem Formulation

The problem is to predict a user’s next item from that user’s historical interaction sequence. The formulation defines sets of users and items and represents each user’s interactions as an ordered sequence.

3.1 Problem Formulation

  • U denotes the set of all users, and V denotes the set of all items.The passage uses |U| and |V| for the respective set sizes.Source: §3.1 · p. 3
  • For user u, x_u is the interaction sequence of T_u items, with x_u,i denoting the i-th item.The sequence is presented as an ordered list of interactions.Source: §3.1 · p. 3
  • Given user u’s historical interaction sequence x_u, sequential recommendation predicts the next item, the (T_u+1)-th item.Source: §3.1 · p. 3

3.2 Sequential VAE Model

A VAE infers latent variables from observed sequences and uses a decoder to reconstruct observations. Sequential VAE models temporal order by predicting each next item from the preceding sequence.

3.2 Sequential VAE Model

  • VAE uses an approximate posterior to infer latent variables from observations, then a decoder reconstructs observations conditioned on those variables.The latent variable is modeled probabilistically, and the true posterior is approximated because it is difficult to calculate directly.Source: §3.2 · p. 3
  • Mult-VAE generates a distribution over all items from a Gaussian-sampled latent variable and samples recommendations from that distribution.Its output distribution is produced through a parameterized function followed by softmax.Source: §3.2 · p. 3
  • At timestep t, the sequential model predicts item t+1 from items 1 through t, unlike Mult-VAE, which does not model temporal order.SVAE generates a target item at each timestep from its latent variable.Source: §3.2 · p. 3
  • SVAE’s approximate posterior for a user’s sequence is factorized across timesteps, and the decoder generates the target sequence from the latent sequence.The posterior is inferred from preceding items; the target spans items 2 through T_u+1.Source: §3.2 · pp. 3–4

3.3 Adversarial Learning for Sequential VAE

Traditional VAE’s Gaussian approximate posterior can limit latent-variable representational ability, while AVB uses adversarial training to approximate a more flexible posterior. ACVAE applies this approach to sequential recommendation, using a discriminator and alternating optimization to train the objective.

3.3.1 Shortcomings of Traditional VAE Models.

  • The Gaussian approximate posterior in traditional VAE limits latent-variable representational ability, while adversarial training can improve it with a flexible inference model.The paper’s example shows that KL divergence can be identical for real independent and fake dependent samples, whereas a discriminator gives different outputs; AVB is intended to reduce latent-dimension correlation.Source: §3.3.1 · p. 4

3.3.2 Adversarial Sequential Variational Bayes.

  • AVB replaces the tractable Gaussian-posterior assumption with a flexible approximate posterior intended to better fit the true posterior.The paper notes that a higher-quality approximate posterior can improve representational flexibility and approximation to the true posterior [9].Source: §3.3.2 · p. 4
  • The AVB objective addresses an intractable approximate-posterior KL term, with reparameterization enabling back-propagation optimization.The paper says the generative and inference objectives have opposing optimization tendencies, so they are trained alternately.Source: §3.3.2 · p. 5
  • A discriminative network distinguishes sequence-latent pairs sampled from the posterior from pairs sampled from the prior, supplying the adversarial objective.The network takes the whole user sequence and latent sequence and outputs values across the sequence.Source: §3.3.2 · p. 5

3.4 Encoder Structure

The encoder combines recurrent and convolutional layers to represent both long-distance dependencies and local sequence relationships, then maps their output to latent variables.

3.4 Encoder Structure

  • The encoder combines an RNN with a convolutional layer because recurrent units can capture long-term dependencies while overlooking relationships between adjacent items.The convolutional layer is added to strengthen local relationships.Source: §3.4 · p. 5

3.4.1 RNN Layer.

  • A GRU produces timestep representations containing information from the user’s sequence up to that timestep.This recurrent design follows SVAE.Source: §3.4.1 · p. 5

3.4.2 CNN Layer.

  • The CNN applies a vertical filter to adjacent sequence items’ hidden states to extract local features, with preceding zero-padding used to prevent future-item label leakage.The convolution output at each timestep corresponds to that timestep; padding rows are placed before the real data.Source: §3.4.2 · p. 5

3.4.3 Fully Connected Layer.

  • A fully connected network transforms the CNN output into latent variable z.Source: §3.4.3 · p. 5

3.5 Contrastive Learning

Contrastive learning is added because sequence reconstruction alone may overlook salient personalization when users’ sequences are similar. The contrastive loss compares user-sequence and latent-variable matches to encourage distinctive user features.

3.5 Contrastive Learning

  • When user sequences are similar, sequence reconstruction may overlook salient personalized information, motivating contrastive learning to improve latent-variable individuation.Source: §3.5 · pp. 5–6

3.5.1 Contrastive Loss.

  • The contrastive discriminator distinguishes positive user-sequence/latent matches from negative pairs using another user’s latent variable.Minimizing the loss improves the discriminator’s distinction between match types and yields latent variables with more salient, personalized user information.Source: §3.5.1 · p. 6
  • The contrastive loss is optimized over encoder and discriminator parameters and added to the VAE objective without an additional alternating-training process.Source: §3.5.2 · p. 6

3.6 Objective Functions

ACVAE’s objective combines terms whose weights are controlled by α and β. The section also presents the training algorithm and its gradient and SGD updates.

3.6 Objective Functions

  • The overall ACVAE objective for a user is introduced, with α and β controlling the weights of the discriminative and contrastive terms.Source: §3.6 · p. 6
  • Algorithm 1 presents the training procedure for ACVAE.Source: §3.6 · p. 6
  • The algorithm includes computing the Ψ gradient and performing SGD updates for Ψ.Source: §3.6 · p. 6

4 EXPERIMENTS

ACVAE is evaluated against recommendation baselines on four datasets, with results reported across top-k metrics. The experiments also examine its components and the effects of α and β.

4.1 Datasets

  • The four datasets differ in size and sequence length; preprocessing keeps positive interactions, removes users and items with fewer than five interactions, and treats retained feedback as implicit.Source: §4.1 · pp. 6–7

4.2 Baselines

  • Evaluation uses an 8:2 train-test split and top-k metrics, comparing ACVAE with popularity, recurrent, attention-based, adversarial, and VAE recommendation baselines.Source: §4.4 · p. 7, §4.2 · p. 7

4.5 Performance Comparison

  • ACVAE outperforms the other methods across evaluation metrics for top-k recommendation on four datasets.Source: Table 2 · p. 8, §4.5 · p. 8
  • ACVAE significantly improves over SVAE, Mult-VAE, Caser, and GRU4Rec+ and performs better than BERT4Rec despite using unidirectional information without global attention.Source: §4.5 · p. 8

4.6 Ablation Study

4.6.1 Study of AVB.

4.7 Impact of Hyper-parameters

  • On ML-1m, Recall@10 and NDCG@10 peak at α=0.05; higher α values over-regularize and reduce the effect.Source: §4.7.1 · p. 10, Figure 5 · p. 10
  • The contrastive-loss results are best at β=0.5; when α=0, contrastive loss substantially improves results because the model relies on it without the KL term.Source: §4.7.1 · p. 10, Figure 5 · p. 10

5 CONCLUSION

ACVAE enhances the sequential VAE encoder with adversarial and contrastive learning and a recurrent-convolutional structure. Experiments show considerable performance improvement over state-of-the-art models.

5 CONCLUSION

  • ACVAE achieves considerable performance improvement compared with state-of-the-art models.Source: §5 · p. 10
  • Adversarial learning via AVB reduces relevance between latent dimensions, while contrastive learning improves generalization by minimizing contrastive loss.Source: §5 · p. 10
  • A convolutional layer after the recurrent layer captures short-term sequence information, addressing shortcomings in VAE latent-variable quality.Source: §5 · p. 10
Loading 2103.10693v1…