Understanding the Ranking Loss for Recommendation with Sparse User Feedback

Zhutian Lin, Junwei Pan, Shangyu Zhang, Ximei Wang, Xi Xiao, Shudong Huang, Lei Xiao, Jie Jiang

Introduction

In industrial recommendation systems and online advertising, Click-Through Rate (CTR) prediction is typically framed as a binary classification task. Binary Cross Entropy (BCE) is the standard loss function used to distinguish between clicked (positive) and non-clicked (negative) items. However, real-world recommendation environments are characterized by extreme data sparsity, where positive signals often constitute less than 2% of total impressions. This paper investigates why the common practice of combining BCE with ranking losses significantly improves performance in these sparse regimes, revealing that the benefit is as much about optimization as it is about ranking.

The Challenge of Sparse Feedback: Gradient Vanishing

The authors identify a fundamental limitation of BCE when applied to sparse data: gradient vanishing on negative samples. In a scenario with a low global CTR (e.g., 1%), the model's predicted probabilities ($\hat{p}$) naturally gravitate toward zero. Because the BCE gradient for negative samples is proportional to $\hat{p}$, these gradients become infinitesimally small as the model converges toward the global mean. This results in a "flat" loss landscape where the model struggles to learn effectively from the vast majority of its data—the negative samples.

Methodology: The Combined-Pair Approach

To address this, the researchers analyze the Combined-Pair loss, which integrates BCE with a pairwise ranking loss (specifically RankNet):

$$\mathcal{L} = \alpha \mathcal{L}_{BCE} + (1-\alpha) \mathcal{L}_{Rank}$$

The core innovation lies in the mathematical decomposition of these gradients. Unlike BCE, the gradient of the ranking loss depends on the difference between the logits of positive and negative samples. This difference remains substantial even when the absolute predicted probabilities are very small, effectively providing a "gradient boost" that prevents the optimization process from stalling in the "flat" regions of the loss surface.

The study also extends this logic to listwise losses (like ListNet) and introduces a Combined-Contrastive Loss, which utilizes supervised contrastive learning as an auxiliary task to provide even more robust gradients.

Key Theoretical Insights

  1. The Gradient Boost: Ranking loss does not just help the model order items; it improves classification by providing larger gradients for negative samples, pushing the model out of optimization ruts where BCE alone would fail.
  2. Gradient Alignment: A critical finding is that the gradients of BCE and RankNet are always aligned in the same direction. This ensures that the two loss functions work in harmony rather than competing, avoiding the common "gradient conflict" issues found in multi-task learning.
  3. Loss Landscape Optimization: Visualization of the loss surface shows that BCE alone creates a plateau-like landscape. The addition of ranking loss introduces steeper gradients, leading to faster and more stable convergence.
  4. Calibration and Bias: Contrary to the belief that ranking losses might cause "score drifting" (uncalibrated probabilities), the authors demonstrate that the improved optimization actually results in better-calibrated models and lower bias in production environments.

Empirical Validation

The framework was validated using both public benchmarks and large-scale production data:

  • Criteo Benchmark: In offline tests, the performance gap between the Combined-Pair method and pure BCE widened as data sparsity increased. This confirms that ranking loss becomes increasingly vital as clicks become rarer.
  • Tencent Production Systems: Online A/B testing across WeChat Channels, WeChat Moments, and Tencent's Demand-Side Platform (DSP) showed significant gains. For instance, WeChat Channels saw a +0.91% CTR lift and a +1.08% increase in Gross Merchandise Value (GMV).
  • Cold-Start Performance: The method proved particularly effective for "new ads" with limited historical data, yielding a +1.26% GMV lift in WeChat Channels specifically.

Conclusion and Future Work

This research provides a strong theoretical foundation for the empirical success of hybrid loss functions in recommendation. By mitigating gradient vanishing through ranking-based auxiliary tasks, models can maintain effective learning even in the face of extreme feedback sparsity.

While the computational cost of pairwise/listwise losses is slightly higher ($O(N_+ \times N_-)$), the authors suggest this is negligible compared to the backbone model's complexity. Future research may focus on automated hyperparameter tuning for the loss balance ($\alpha$) and exploring whether this "gradient boost" logic applies to even sparser downstream signals, such as purchase conversions.

Summary updated

BibTeX
@inproceedings{lin2024understanding,
  author = {Zhutian Lin and Junwei Pan and Shangyu Zhang and Ximei Wang and Xi Xiao and Shudong Huang and Lei Xiao and Jie Jiang},
  title = {{Understanding the Ranking Loss for Recommendation with Sparse User Feedback}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
  doi = {10.1145/3637528.3671565},
}
Figure