To optimize the sequential recommender, a commonly used approach is to conduct a batch-level optimization objective with contrastive learning [1]}, [2]}.
Specifically, for a batch of \(B\)  training instances, where each instance is a pair of the sequential context (i.e., historical interaction sequence) and the ground-truth next item (i.e., positives).
We encode them into representations \(\lbrace \langle {s}_1, {v}_1\rangle , \ldots ,\langle {s}_B, {v}_B\rangle \rbrace \) , where \({s}_{j}\)  denotes the \(j\) -th normalized sequence representations (Eqn. (REF )) and \({v}_{j}\)  denotes the \(j\) -th normalized representation of positive item paired with \({s}_{j}\)  (Eqn. (REF )).
For conducting the contrastive training, a key step is to sample a number of negatives to contrast the positive, which are usually obtained by random sampling.
