Recommenders trained on click logs mostly learn which items are popular, not what each user likes. A standard way to help the long tail, meaning the many items with few interactions, is to pull each item's learned vector toward "collaborative neighbors": other items consumed by the same people. One careful attempt to choose those neighbors more cleverly, by similarity weighting, did no better than choosing them at random. This proposal gives a specific reason for that failure and a fix taken from an older literature on predicting links between people. Two items that are both bought by one person who buys everything tell you little. Two items that are both bought by one person who buys almost nothing tell you a lot. Standard item-item similarity corrects for how popular the two items are, but not for how indiscriminate the shared users are. We propose weighting neighbor evidence by the rarity of the users who connect two items. We also evaluate on a test in which the model cannot score well just by ranking popular items first.
The rarity principle is well established outside recommendation. In social networks, sharing an isolated friend predicts a tie far better than sharing a celebrity (Study of Data Mining Algorithm in Social Network Analysis). Shared membership in small groups beats shared membership in large ones for reconstructing hidden networks (Cold start link prediction). The chance of a connection falls with the size of the smallest shared interest group (On the Interplay between Social and Topical Structure). These results supply the method. What is new here is placing that principle at the one point in modern graph recommenders where a documented negative result says the obvious signal fails: the choice and weighting of contrastive positives. We test it under an evaluation that removes the popularity shortcut.
Core Claim
The ItemKNN and cosine weighting tried in Neighborhood-Enhanced Supervised Contrastive Learning for Collaborative Filtering (NESCL) failed to beat uniform neighbor sampling. NESCL adds interacted and nearest-neighbor items as positive pairs in a contrastive loss (a loss that pulls designated pairs together and pushes others apart) on top of LightGCN, a simplified graph convolutional recommender. The failure has a mechanism we can name. Cosine similarity, which divides co-occurrence count $c_{ij}$ by $\sqrt{d_i d_j}$ (the item degrees), normalizes the endpoints of a path. It leaves the intermediate user unweighted. Heavy users who touch thousands of items therefore manufacture most co-occurrences, and the weighted positives concentrate on a hub-dominated neighborhood.
We claim that rarity-weighted positives will improve tail accuracy over both uniform and cosine-weighted positives on a degree-corrected test, without the in-distribution losses that global popularity penalties incur. Rarity-weighted positives discount each shared user by how many items that user touches, as Adamic-Adar-style link prediction does, and shrink the weight when support is thin. The pair-level structure should matter: a reweighting that uses only node degrees should not reproduce the gain.
Concretely, for items $i$ and $j$ with shared user set $S_{ij}$, raw co-count $c_{ij}=|S_{ij}|$, and user degree $d_u$, the rarity weight is
$$ w_{ij} \;=\; \frac{c_{ij}}{c_{ij}+\kappa}\sum_{u\in S_{ij}} \frac{1}{\log(1+d_u)}, $$
where $\kappa>0$ is a shrinkage constant. The sum is the Adamic-Adar discount on intermediaries. The prefactor handles a known weakness of rarity metrics: over-trusting one-off, possibly misrecorded rare matches. It follows the balance between evidence strength and rarity used in Copy or Coincidence? A Model for Detecting Social Influence and Duplication Events and the hit-miss mixture of A hit-miss model for duplicate detection in the WHO drug safety database. A second variant replaces the sum with $\max_{u\in S_{ij}} 1/d_u$, the "rarest shared cohort" signal from the Interplay paper. Positives for item $i$ are sampled in proportion to $w_{ij}$, and user-side positives are built symmetrically.
Relation to Prior Work
Three papers motivate the proposal by locating the damage. How Graph Convolutions Amplify Popularity Bias for Recommendation? shows that an item's gradient influence grows like $d_i^{3/2}$ despite LightGCN's symmetric normalization. It fixes this post hoc with DAP, which clusters embeddings and subtracts an estimated popularity pull at inference. We intervene at training time instead. Model-Agnostic Counterfactual Reasoning for Eliminating Popularity Bias in Recommender System (MACR) shows that LightGCN is more popularity-prone than matrix factorization. It removes a scalar direct popularity effect using a causal graph. Our signal is not a scalar per item but a property of each item pair. Popularity-Aware Alignment and Contrast for Mitigating Popularity Bias (PAAC) aligns tail items with co-interacted popular items. It is the closest method in spirit, but it deliberately anchors the tail to the head. Rarity weighting instead anchors a tail item to items that share discriminating users, which are often other tail items, so niche structure should survive.
One paper constrains the design. NESCL's negative result means any positive-weighting scheme must beat uniform sampling, not just cosine weighting. That is the bar we adopt.
One paper supplies the evaluation. Implicit degree bias in the link prediction task shows that the preferential-attachment null model, which scores a pair by the product of its degrees, reaches 0.83 AUC-ROC on standard benchmarks and drops to 0.54 when negatives are sampled in proportion to degree. That paper is limited to unipartite graphs and explicitly leaves the bipartite case open. We build that bipartite extension as a measurement tool, not as the contribution.
Research Program
The work has three parts, run in order.
The first is a degree-corrected bipartite test protocol. Held-out positives are ranked per user, which already matches user degree. The item negatives for each user are drawn with probability proportional to item degree, so positive and negative items have the same popularity distribution. Under this protocol, a model that simply ranks popular items first scores near chance.
The second is the rarity-weighted positive sampler, plugged into the NESCL training loop without other changes. It is computed once from the training graph using sparse matrix products; the cost is comparable to building ItemKNN.
The third is a diagnostic analysis. We measure the degree distribution of selected positives under uniform, cosine, and rarity sampling, which tests the mechanism directly. We also track the gradient share received by the top 20% of items across training, to see whether rarity positives reduce the $d_i^{3/2}$ dominance DAP identifies.
Baselines
The naive reference is LightGCN trained with the standard pairwise ranking loss, reported on all test protocols. It anchors how much any method moves tail and degree-corrected metrics.
The direct parent is NESCL with uniform neighbor positives, run from its released configuration on Yelp2018, Gowalla, and Amazon-Book. It reports NDCG@20 gains over the contrastive baseline SGL of 10.09%, 7.09%, and 35.36% on those datasets; the file does not give absolute NDCG values. We also run NESCL with cosine-weighted positives, reproducing its failed variant. That run is the control for our causal story.
The strongest popularity-debiasing competitor is PAAC. It reports a 30.2% NDCG@20 improvement over its strongest baseline on Yelp2018's unbiased test set, and cuts the popular-unpopular accuracy gap by 87.5% on Yelp2018 and 34.18% on Gowalla. We also run DAP, which reports tail Recall and NDCG gains of 23.96% and 28.27% on Gowalla, and MACR.
All methods share the LightGCN backbone, embedding size, layer count, data splits, and an equal hyperparameter search budget. That budget covers $\kappa$ for us, PAAC's $\gamma$ and $\beta$, and DAP's cluster settings. Beating PAAC means matching or exceeding its unbiased-test NDCG@20 and tail Recall@20 while losing less standard-test Recall@20. We treat that in-distribution trade-off as the likely point of separation.
Two ablations isolate the key ingredient. In the node-level ablation, positives are sampled with weights built only from item degrees, such as inverse item popularity, with no pair structure. This tests whether pair-level rarity matters at all. In the unshrunk ablation, $\kappa\to 0$, which tests the noise-robustness term.
Why not just…?
Why not just reweight the loss by inverse item popularity, or retune LightGCN's normalization exponent? This is the strongest simple alternative. If the benefit is merely "less weight on popular items," it will match us. The node-level ablation above is exactly this test, since it shares every setting except pair structure. MACR notes that inverse propensity weighting is high-variance and sensitive to its weighting function, and PAAC reports beating IPS baselines on unbiased tests. Neither result addresses a node-level reweighting of contrastive positives specifically, so this remains an open threat. If the ablation ties our method on degree-corrected metrics, we will report that the gain is degree-level and drop the pair-level claim.
Why not just ensemble LightGCN with a bipartite Adamic-Adar heuristic score at inference? This would inject the same rarity signal with no training change, and in the link prediction literature such heuristics are strong. We run the heuristic alone and in a tuned linear mixture with LightGCN under the same protocols. Our hypothesis is that the ensemble helps on items with many rare co-users but cannot help items whose evidence is only reachable through learned multi-hop smoothing. We will check this by stratifying tail items by their number of shared-user paths. If the ensemble matches us across strata, the training-time injection is unnecessary, and we will say so.
Why not just use PAAC or DAP, which already fix the tail? Both report large tail gains. PAAC ties tail items to popular anchors, and DAP corrects scores after training, so neither changes which structural evidence the model learns from. The decisive comparison is the degree-corrected bipartite test together with standard-test Recall@20. If PAAC wins on both, rarity positives add nothing beyond a possible combination with PAAC, which we also run.
Proposed Experiments
We use Yelp2018, Gowalla, and Amazon-Book with standard splits. We add Yahoo!R3 because it has a uniformly exposed random test set, as used by Robust Collaborative Filtering to Popularity Distribution Shift. Metrics are Recall@20 and NDCG@20 on the standard test, the uniform-item test used by PAAC and MACR, and our degree-corrected bipartite test. We also report tail Recall@20 on the bottom 80% of items, as in DAP, and NDCG@20 across ten popularity groups, as in Adap-τ. As a sanity check, preferential attachment should fall to near chance on the degree-corrected test, reproducing the qualitative drop from 0.83 to 0.54 in the unipartite study.
The decisive checks are three. First, the degree histogram of cosine-selected positives should be visibly shifted toward positives reached through heavy users relative to rarity-selected positives; if it is not, the mechanism claim fails. Second, rarity positives must beat uniform positives on the degree-corrected test on at least three of four datasets, since cosine weighting did not. Third, the gap between the full method and the node-level ablation must survive seed variance. If it does not, the paper's honest conclusion is that NESCL's weighting failure was about node popularity, not about pair-level rarity.
References
- Study of Data Mining Algorithm in Social Network Analysis
- Cold start link prediction
- On the Interplay between Social and Topical Structure
- Neighborhood-Enhanced Supervised Contrastive Learning for Collaborative Filtering
- Copy or Coincidence? A Model for Detecting Social Influence and Duplication Events
- A hit-miss model for duplicate detection in the WHO drug safety database
- How graph convolutions amplify popularity bias for recommendation?
- Model-Agnostic Counterfactual Reasoning for Eliminating Popularity Bias in Recommender System
- Popularity-Aware Alignment and Contrast for Mitigating Popularity Bias
- Implicit degree bias in the link prediction task
- Robust Collaborative Filtering to Popularity Distribution Shift
- Adap-τ : Adaptively Modulating Embedding Magnitude for Recommendation