Self-supervised Learning for Sequential Recommendation with Model Augmentation

The sequential recommendation aims at predicting the next items in user behaviors , which can be solved by characterizing item relationships in sequences . Due to the data sparsity and noise issues in sequences , a new self-supervised learning ( SSL ) paradigm is proposed to improve the performance , which employs contrastive learning between positive and negative views of sequences . However , existing methods all construct views by adopting augmentation from data perspectives , while we argue that 1 ) optimal data augmentation methods are hard to devise , 2 ) data augmentation methods destroy sequential correlations , and 3 ) data augmentation fails to incorporate comprehensive self-supervised signals . Therefore , we investigate the possibility of model augmentation to construct view pairs . We propose three levels of model augmentation methods : neuron masking , layer dropping , and encoder complementing . This work opens up a novel direction in constructing views for contrastive SSL . Experiments verify the efficacy of model augmentation for the SSL in the sequential recommendation . 1 INTRODUCTION . The sequential recommendation ( Fan et al. , 2021 ; Liu et al. , 2021c ; Chen et al. , 2018 ; Tang & Wang , 2018 ; Zheng et al. , 2019 ) aims at predicting future items in sequences , where the crucial part is to characterize item relationships in sequences . Recent developments in sequence modeling ( Fan et al. , 2021 ; Liu et al. , 2021c ) verify the superiority of Transform ( Vaswani et al. , 2017 ) , i.e . the selfattention mechanism , in revealing item correlations in sequences . A Transformer ( Kang & McAuley , 2018 ) is able to infer the sequence embedding at specified positions by weighted aggregation of item embeddings , where the weights are learned via self-attention . Existing works ( Fan et al. , 2021 ; Wu et al. , 2020 ) further improve Transformer by incorporating additional complex signals . However , the data sparsity issue ( Liu et al. , 2021c ) and noise in sequences undermine the performance of a model in sequential recommendation . The former hinders performance due to insufficient training since the complex structure of a sequential model requires a dense corpus to be adequately trained . The latter also impedes the recommendation ability of a model because noisy item sequences are unable to reveal actual item correlations . To overcome both , a new contrastive self-supervised learning ( SSL ) paradigm ( Liu et al. , 2021b ; Xie et al. , 2020 ; Zhou et al. , 2020 ) is proposed recently . This paradigm enhances the capacity of encoders by leveraging additional self-supervised signals . Specifically , the SSL paradigm constructs positive view pairs as two data augmentations from the same sequences ( Xie et al. , 2020 ) , while negative pairs are augmentations from distinct sequences . Incorporating augmentations during training increases the amount of training data , thus alleviating the sparsity issue . And the contrastive loss ( Chen et al. , 2020 ) improves the robustness of the model , which endows a model with the ability to against noise . Though being effective in enhancing sequential modeling , the data augmentation methods adopted in the existing SSL paradigm suffer from the following weaknesses : • Optimal data augmentation methods are hard to devise . Current sequence augmentation methods adopts random sequence perturbations ( Liu et al. , 2021b ; Xie et al. , 2020 ) , which includes crop , mask , reorder , substitute and insert operations . Though a random combination of those augmenting operations improves the performance , it is rather time-consuming to search the optimal augmentation methods from a large number of potential combinations for different datasets ( Liu et al. , 2021b ) . • Data augmentation methods destroy sequential correlations , leading to less confident positive pairs . The existing SSL paradigm requires injecting perturbations into the augmented views of sequences for contrastive learning . However , because the view construction process is not optimized to characterize sequential correlations , two views of one sequence may reveal distinct item relationships , which should not be recognized as positive pairs . • Data augmentation fails to incorporate comprehensive self-supervised signals . Current data augmentation methods are designed based on heuristics , which already requires additional prior knowledge . Moreover , since the view construction process is not optimized with the encoder , data augmentation may only reveal partial self-supervised signals from data perspectives . Hence , we should consider other types of views besides data augmentation . Therefore , we investigate the possibility of model augmentation to construct view pairs for contrastive learning , which functions as a complement to the data augmentation methods . We hypothesis that injecting perturbations into the encoder should enhance the self-supervised learning ability to existing paradigms . The reasons are threefold : Firstly , model augmentation is jointly trained with the optimization process , thus endows the end-to-end training fashion . As such , it is easy to discover the optimal view pairs for contrastive learning . Secondly , model augmentation constructs views without manipulation to the original data , which leads to high confidence of positive pairs . Last but not least , injecting perturbation into the encoder has distinct characteristics to data augmentation , which should be an important complement in constructing view pairs for existing self-supervised learning scheme ( Liu et al. , 2021b ; Zhou et al. , 2020 ) . This work studies the model augmentation for a self-supervised sequential recommendation from three levels : 1 ) neuron masking ( dropout ) , which adopts the dropout layer to randomly mask partial neurons in a layer . By operating the dropout twice to one sequence , we can perturb the output of the embedding from this layer , which thus constructs two views from model augmentation perspective ( Gao et al. , 2021 ) . 2 ) layer dropping . Compared with neuron masks , we randomly drop a complete layer in the encoder to inject more perturbations . By randomly dropping layers in an encoder twice , we construct two distinct views . Intuitively , layer-drop augmentation enforces the contrast between deep features and shallows features of the encoder . 3 ) encoder complementing , which leverages other encoders to generate sequence embeddings . Encoder complementing augmentation is able to fuse distinct sequential correlations revealed by different types of encoders . For example , RNN-based sequence encoder ( Hidasi et al. , 2015 ) can better characterize direct item transition relationships , while Transformer-based sequence encoder models position-wise sequential correlations . Though only investigating SSL for a sequential recommendation , we remark that model augmentation methods can also be applied in other SSL scenarios . The contributions are as follows : • We propose a new contrastive SSL paradigm for sequential recommendation by constructing views from model augmentation , which is named as SRMA . • We introduce three levels of model augmentation methods for constructing view pairs . • We discuss the effectiveness and conduct a comprehensive study of model augmentations for the sequential recommendation . • We investigate the efficacy of different variants of model augmentation . 2 RELATED WORK . 2.1 SEQUENTIAL RECOMMENDATION . Sequential recommendation predicts future items in user sequences by encoding sequences while modeling item transition correlations ( Rendle et al. , 2010 ; Hidasi et al. , 2015 ) . Previously , Recurrent Neural Network ( RNN ) have been adapted to sequential recommendation ( Hidasi et al. , 2015 ; Wu et al. , 2017 ) , ostensibly modeling sequence-level item transitions . Hierarchical RNNs ( Quadrana et al. , 2017 ) incorporate personalization information . Moreover , both long-term and short-term item transition correlations are modelled in LSTM ( Wu et al. , 2017 ) . Recently , the success of selfattention models ( Vaswani et al. , 2017 ; Devlin et al. , 2018 ) promotes the prosperity of Transformerbased sequential recommendation models . SASRec ( Kang & McAuley , 2018 ) is a pioneering work adapting Transformer to characterize complex item transition correlations . BERT4Rec ( Sun et al. , 2019 ) adopts the bidirectional Transformer layer to encode sequence . ASReP ( Liu et al. , 2021c ) reversely pre-training a Transformer to augment short sequences and fine-tune it to predict the nextitem in sequences . TGSRec ( Fan et al. , 2021 ) models temporal collaborative signals in sequences to recognize item relationships . 2.2 SELF-SUPERVISED LEARNING . Self-supervised learning ( SSL ) is proposed recently to describe “ the machine predicts any parts of its input for any observed part ” ( Bengio et al. , 2021 ) , which stays within the narrow scope of unsupervised learning . To achieve the self-prediction , endeavors from various domains have developed different SSL schemes from either generative or contrastive perspectives ( Liu et al. , 2021a ) . For generative SSL , the masked language model is adopted in BERT ( Devlin et al. , 2018 ) to generate masked words in sentences . GPT-GNN ( Hu et al. , 2020 ) also generates masked edges to realize SSL . Other generative SSL paradigms in computer vision ( Oord et al. , 2016 ) are proposed . Compared with generative SSL , contrastive SSL schemes have demonstrated more promising performance . SimCLR ( Chen et al. , 2020 ) proposes simple contrastive learning between augmented views for images , which is rather effective in achieving SSL . GCC ( Qiu et al. , 2020 ) and GraphCL ( You et al. , 2020 ) adopts contrastive learning between views from corrupted graph structures . CL4SRec ( Xie et al. , 2020 ) and CoSeRec ( Liu et al. , 2021b ) devise the sequence augmentation methods for SSL on sequential recommendation . This paper also investigates the contrastive SSL for a sequential recommendation . Instead of adopting the data augmentation for constructing views to contrast , we propose the model augmentation to generate contrastive views . 3 PRELIMINARY . 3.1 PROBLEM FORMULATION . We denote user and item sets as U and V respectively . Each user u ∈ U is associated with a sequence of items in chronological order su = [ v1 , . . . , vt , . . . , v|su| ] , where vt ∈ V denotes the item that u has interacted with at time t and |su| is the total number of items . Sequential recommendation is formulated as follows : argmax vi∈V P ( v|su|+1 = vi |su ) , ( 1 ) where v|su|+1 denotes the next item in sequence . Intuitively , we calculate the probability of all candidate items and recommend items with high probability scores . 3.2 SEQUENTIAL RECOMMENDATION FRAMEWORK . The core of a generic sequential recommendation framework is a sequence encoder SeqEnc ( · ) , which transforms item sequences to embeddings for scoring . We formulate the encoding step as : hu = SeqEnc ( su ) , ( 2 ) where hu denotes the sequence embedding of su . To be specific , if we adopt a Transformer ( Kang & McAuley , 2018 ; Vaswani et al. , 2017 ) as the encoder , hu is a bag of embeddings , where at each position t , htu , represents a predicted next-item . We adopt the log-likelihood loss function to optimize the encoder for next-item prediction as follows : Lrec ( u , t ) = − log ( σ ( htu · evt+1 ) ) − ∑ vj 6∈su log ( 1− σ ( htu · evj ) ) , ( 3 ) where Lrec ( u , t ) denotes the loss score for the prediction at position t in sequence su , σ is the nonlinear activation function , evt+1 denotes the embedding for item vt+1 , and vj is the sampled negative item for su . The embeddings of items are retrieved from the embedding layer in SeqEnc ( · ) , which is jointly optimized with other layers .

Summary: This paper  a new self-supervised learning (SSL) paradigm for sequence recommendation by  contrastive learning between positive and negative views of sequences based on model augmentation. The model augmentation methods includes neuron masking, layer dropping and encoder complementing. The proposed algorithm is evaluated with several real-world datasets, showing the efficacy of the proposed methods.