Papers
Topics
Authors
Recent
Search
2000 character limit reached

Top-K Multi-Positive Contrastive Objective

Updated 6 February 2026
  • Top-K Multi-Positive Contrastive Objective (MSCL) is a contrastive learning framework that leverages multiple positive samples to improve recommendation quality.
  • It modifies the classic InfoNCE loss with importance-aware weighting, balancing the influence of positive and negative interactions.
  • Empirical results on datasets like Yelp2018 and Amazon-Book show that MSCL achieves higher accuracy and faster convergence compared to traditional methods.

The Top-K Multi-Positive Contrastive Objective (MSCL) is a contrastive learning framework tailored for recommender systems under Top-K recommendation metrics. In this paradigm, MSCL modifies the classic InfoNCE/NT-Xent loss, incorporating a strategy that samples multiple positive items per user and applies a tunable importance weighting between positive and negative terms. This combination enhances both the utilization of sparse user-item interactions and the balance of gradient signal, resulting in improved recommendation accuracy and efficient optimization, particularly on sparse datasets (Tang et al., 2021).

1. Formalization of the Top-K Recommendation Task

The Top-K recommendation setting operates on the bipartite interaction graph G=(U∪I,E+)G = (U \cup I, E^+), where UU denotes the set of users, II the set of items, and E+⊆U×IE^+ \subseteq U \times I the observed positive user-item interactions. For each user u∈Uu \in U, the system must learn an embedding eu∈Rde_u \in \mathbb{R}^d, and similarly for each item i∈Ii \in I an embedding ei∈Rde_i \in \mathbb{R}^d. Recommendation is generated by ranking items for uu according to the predicted score y^ui=euTei\hat{y}_{u i} = e_u^T e_i, selecting the K items with the highest scores.

This formalism is central to embedding-based collaborative filtering and underpins both the classical contrastive baseline and the MSCL framework (Tang et al., 2021).

2. Standard Contrastive Loss (CL) and Its Limitations

The NT-Xent loss—prevalent in models such as SimCLR and GraphCL—adapts to recommendation by contrasting a user’s positive item against negatives drawn from the remainder of the minibatch. Given a minibatch UU0 of size UU1, the positive pair UU2 is contrasted with UU3. The loss is:

UU4

where UU5 is the cosine similarity of UU6 and UU7, and UU8 is the temperature.

The batch loss is averaged over UU9 such pairs. A critical limitation is the severe imbalance for each user: a single positive term against II0 negatives, which is further exacerbated by the sparsity common in practical recommendation scenarios. Each training step exploits only one positive item, leading to under-utilization of sparse user-item interaction signals (Tang et al., 2021).

3. Derivation and Formulation of the Multi-Positive Contrastive Loss (MSCL)

3.1 Importance-aware Contrastive Loss (ICL)

ICL introduces a weighting parameter II1 to control the relative contribution of positive and negative terms:

II2

Setting II3 recovers the symmetric NT-Xent loss, while II4 increases the emphasis on positives—helpful in extremely sparse data.

3.2 Multi-Positive Contrastive Loss (MCL) via Data Augmentation

Instead of a single positive sampled per user, MCL samples II5 distinct positives II6 from the user’s interaction history (without replacement). The per-user loss is aggregated over all sampled positives:

II7

3.3 Final Multi-Sample Contrastive Loss (MSCL)

Combining importance weighting and multi-positive sampling, MSCL is formally written as:

II8

with the overall minibatch loss:

II9

This approach enables simultaneous utilization of multiple positives, and the weighting scheme directly modulates the gradient flow to address imbalance (Tang et al., 2021).

4. Multi-Positive Sampling and Data Augmentation

At each iteration, for each user E+⊆U×IE^+ \subseteq U \times I0 in the minibatch, let E+⊆U×IE^+ \subseteq U \times I1 denote all known positives. MSCL samples E+⊆U×IE^+ \subseteq U \times I2 positives without replacement, resulting in E+⊆U×IE^+ \subseteq U \times I3 potential positive sets and thus significantly augments the sampling space. Each sampled E+⊆U×IE^+ \subseteq U \times I4 receives a parallel contrastive loss with the same set of negatives, substantially increasing supervisory signal—even in the case of very short user histories. This combinatorial data augmentation effect is a defining characteristic of MSCL, enabling the model to effectively utilize limited positive interactions (Tang et al., 2021).

5. Hyperparameterization: Balancing Positives and Negatives

The hyperparameter E+⊆U×IE^+ \subseteq U \times I5 is the central knob for controlling the positive/negative trade-off. E+⊆U×IE^+ \subseteq U \times I6 yields the conventional contrastive loss, but tuning is dataset-dependent: E+⊆U×IE^+ \subseteq U \times I7 works best for denser sets, and E+⊆U×IE^+ \subseteq U \times I8 for ultra-sparse domains (e.g., Alibaba-iFashion). Selection of E+⊆U×IE^+ \subseteq U \times I9, the number of positive views, is typically in the range u∈Uu \in U0, further increasing as user positive history and dataset size permit (Tang et al., 2021).

6. Integration with Graph Encoder Architectures

MSCL is agnostic to the embedding-based encoder and is demonstrated with LightGCN and sLightGCN. User and item embeddings u∈Uu \in U1 and u∈Uu \in U2 are computed as the layer-wise averages over GCN propagation steps:

u∈Uu \in U3

The cosine similarity between u∈Uu \in U4 and u∈Uu \in U5, u∈Uu \in U6, is input to the MSCL objective, replacing prior ranking-based losses such as BPR (Tang et al., 2021).

7. Empirical Findings and Advantages in Sparse Regimes

Benchmarking on Yelp2018, Amazon-Book, and Alibaba-iFashion datasets (interaction densities u∈Uu \in U7, u∈Uu \in U8, u∈Uu \in U9, respectively), MSCL with eu∈Rde_u \in \mathbb{R}^d0 and tuned eu∈Rde_u \in \mathbb{R}^d1 significantly outperforms the single-positive CL baseline:

Dataset Metric CL MSCL Relative Improvement
Yelp2018 recall@20 0.0655 0.0691 +5.0% (NDCG@20)
Amazon-Book recall@20 0.0480 0.0580 +17% (NDCG@20)
Alibaba-iFashion recall@20 0.1152 0.1201 +4% (NDCG@20)

These gains are accompanied by marked improvements in convergence speed (eu∈Rde_u \in \mathbb{R}^d250 epochs for MSCL versus eu∈Rde_u \in \mathbb{R}^d3900 for BPR) and nearly identical per-epoch computational cost on modern GPUs (Tang et al., 2021).

In summary, MSCL operationalizes combinatorially-augmented contrastive learning, tuned by explicit positive:negative weighting. Its principal benefit lies in overcoming the dual challenges of imbalance and sparse data endemic to practical Top-K recommender systems (Tang et al., 2021).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Top-K Multi-Positive Contrastive Objective.