Fast Differentiable Sorting and Ranking
Mathieu Blondel, Olivier Teboul, Quentin Berthet, Josip Djolonga
Abstract
The sorting operation is one of the most commonly used building blocks in computer programming. In machine learning, it is often used for robust statistics. However, seen as a function, it is piecewise linear and as a result includes many kinks where it is non-differentiable. More problematic is the related ranking operator, often used for order statistics and ranking metrics. It is a piecewise constant function, meaning that its derivatives are null or undefined. While numerous works have proposed differentiable proxies to sorting and ranking, they do not achieve the time complexity one would expect from sorting and ranking operations. In this paper, we propose the first differentiable sorting and ranking operators with time and space complexity. Our proposal in addition enjoys exact computation and differentiation. We achieve this feat by constructing differentiable operators as projections onto the permutahedron, the convex hull of permutations, and using a reduction to isotonic optimization. Empirically, we confirm that our approach is an order of magnitude faster than existing approaches and showcase two novel applications: differentiable Spearman's rank correlation coefficient and least trimmed squares.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9f1c4503-4ab2-4fa3-95f0-9d1d2168e233Cited by top-tier papers98
- Efficient and Modular Implicit DifferentiationMathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig et al.NeurIPS 2022 · 386 citations
- Learning with Differentiable Pertubed OptimizersQuentin Berthet, Mathieu Blondel, Olivier Teboul, Marco Cuturi et al.NeurIPS 2020 · 181 citations
- Uncertainty Quantification over Graph with Conformalized Graph Neural NetworksKexin Huang, Ying Jin, Emmanuel J. Candès, Jure LeskovecNeurIPS 2023 · 124 citations
- Learning Optimal Conformal ClassifiersDavid Stutz, Krishnamurthy Dvijotham, Ali Taylan Cemgil, Arnaud DoucetICLR 2022 · 123 citations
- Equivariance with Learned Canonicalization FunctionsSékou-Oumar Kaba, Arnab Kumar Mondal, Yan Zhang, Yoshua Bengio et al.ICML 2023 · 109 citations
Builds on1
Related papers
- Differentiable sorting for censored time-to-event dataAndre Vauvelle, Benjamin Wild, Roland Eils, Spiros C. DenaxasNeurIPS 2023 · 6 citations
- Generalized Neural Sorting Networks with Error-Free Differentiable Swap FunctionsJungtaek Kim, Jeongbeen Yoon, Minsu ChoICLR 2024 · 5 citations
- LapSum - One Method to Differentiate Them All: Ranking, Sorting and Top-k SelectionLukasz Struski, Michal B. Bednarczyk, Igor T. Podolak, Jacek TaborICML 2025
- PiRank: Scalable Learning To Rank via Differentiable SortingRobin M. E. Swezey, Aditya Grover, Bruno Charron, Stefano ErmonNeurIPS 2021 · 45 citations
- Fast, Differentiable and Sparse Top-k: a Convex Analysis PerspectiveMichael Eli Sander, Joan Puigcerver, Josip Djolonga, Gabriel Peyré et al.ICML 2023 · 35 citations
