Gradient-Based Diversity Optimization with Differentiable Top-$k$ Objective

Tianyi Zhou, Sebastian Dalleiger, Ece Calikus, Aristides GionisICLR 2026

This paper introduces a novel framework for baking diversity directly into the training of recommendation and ranking models. By making the traditionally non-differentiable "top-$k$" selection process differentiable, the authors allow models to learn to be diverse using standard gradient-based optimization, effectively breaking filter bubbles without sacrificing accuracy.

Executive Summary

The authors propose a differentiable top-$k$ diversity objective that allows machine learning models to optimize for both relevance and variety simultaneously during training. Their methods, Direct Diversity-Guided Tuning (DDT) and Meta-Diversity Reweighting (MDR), significantly improve recommendation diversity with negligible loss in accuracy across multiple real-world datasets.

The Challenge: Accuracy vs. Diversity

Most recommendation engines are "accuracy-hungry." They are trained to maximize relevance—predicting exactly what a user is likely to click on. While this sounds ideal, it often leads to homogeneity: the model recommends very similar items, reinforces filter bubbles, and ignores the "long tail" of diverse content.

The challenge is that "diversity" is usually defined over the top-$k$ items a model selects. However, the operation of picking the top-$k$ items is discrete and non-differentiable, meaning you cannot pass a gradient through it to update model weights. Historically, researchers solved this using post-hoc re-ranking (adjusting results after the model runs), which is computationally expensive and often tanks accuracy. This paper seeks a way to make diversity a first-class citizen during the training phase itself.

Proposed Methodology: Differentiable Top-$k$ Diversity

The core innovation is a differentiable smooth-ranking approximation. Instead of a hard "top-$k$" cut-off, the authors project predicted scores onto a "permutahedron" to create a soft ranking vector. This allows them to define a Differentiable Diversity Reward Objective (DDRO) based on pairwise item dissimilarity.

Building on this, they propose two strategies:

  1. Direct Diversity-Guided Tuning (DDT): This adds the diversity objective directly to the standard loss function (like Mean Squared Error). To manage the tension between relevance and diversity, they use an adaptive trade-off parameter ($\beta$) based on the Multiple Gradient Descent Algorithm (MGDA). This ensures the model only takes steps that improve (or at least don't hurt) both objectives simultaneously.
  2. Meta-Diversity Reweighting (MDR): A meta-learning approach that leaves the model architecture and loss function untouched. Instead, it learns to assign weights to training examples. Samples that contribute more to the overall diversity of the top-$k$ set are upweighted during training.

Both methods can be used to train a model from scratch or, more efficiently, to fine-tune a pre-trained, relevance-only model.

Evaluation Datasets

The authors evaluated their framework on five diverse recommendation benchmarks:

  • MovieLens & Netflix: Standard movie recommendation datasets.
  • Yahoo-R2: Music recommendations.
  • Coat: Product recommendations with specific item attributes.
  • KuaiRec: A large-scale social video dataset.

Key Insights

  • Adaptive Balancing is Essential: You cannot simply pick a fixed weight for diversity. As shown in the optimization trajectories, the "optimal" balance ($\beta^*$) shifts during training. By adaptively calculating this balance, the authors ensure the model converges to a Pareto-stationary point where neither relevance nor diversity can be improved without hurting the other.
Optimization trajectories showing the adaptive trade-off parameter ($\beta^*$) and diversity increases over epochs.
  • Fine-tuning Efficiency: One of the most practical findings is that you don't need to retrain models from scratch. Fine-tuning a pre-trained model for just a few epochs with the diversity objective "injects" variety while preserving the relevance the model has already learned.
  • Generality Beyond Top-$k$: Interestingly, optimizing for the top-10 items also improves the diversity of the top-20 or top-30. The optimization reshapes the entire ranking distribution, not just the items at the very top.

Experimental Results

The proposed methods consistently outperformed established baselines like Maximal Marginal Relevance (MMR) and Determinantal Point Processes (DPP).

  • Diversity Gains: On the Yahoo-R2 dataset, DDT achieved a massive diversity improvement (up to 78% relative gain) compared to a standard Matrix Factorization baseline.
  • Accuracy Preservation: In almost all tests, the "relevance" (measured by Recall or Hit Rate) remained nearly identical to the accuracy-only baseline, even as diversity climbed.
  • Model Agnostic: The framework worked equally well for simple Matrix Factorization (MF) and more complex Neural Collaborative Filtering (NCF) architectures.
Comparison of DDT and MDR against baselines across five datasets, demonstrating superior diversity-relevance trade-offs.

Limitations & Future Directions

  • Local Optima: While the adaptive $\beta$ ensures common descent at each step, it doesn't guarantee the model will find the global optimum for the joint objective.
  • Similarity Metrics: The current work relies on categorical metadata (like genres) to define diversity. The authors suggest that future work should incorporate more nuanced semantic embeddings to capture "latent" diversity.
  • Data-Driven Bias: Diversity optimization helps, but it doesn't solve the underlying data scarcity for "minority" items. The authors see potential in combining this gradient-based approach with counterfactual data augmentation.

Summary updated

BibTeX
@inproceedings{zhou2026gradient,
  author = {Tianyi Zhou and Sebastian Dalleiger and Ece Calikus and Aristides Gionis},
  title = {{Gradient-Based Diversity Optimization with Differentiable Top-$k$ Objective}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=cuzWopwoZG},
}
Figure