LapSum - One Method to Differentiate Them All: Ranking, Sorting and Top-k Selection

Lukasz Struski, Michal B. Bednarczyk, Igor Podolak, Jacek Tabor
2/14/2026

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

We present a novel technique for constructing differentiable order-type operations, including soft ranking, soft top-k selection, and soft permutations. Our approach leverages an efficient closed-form formula for the inverse of the function LapSum, defined as the sum of Laplace distributions. This formulation ensures low computational and memory complexity in selecting the highest activations, enabling losses and gradients to be computed in $O(n\log{}n)$ time. Through extensive experiments, we demonstrate that our method outperforms state-of-the-art techniques for high-dimensional vectors and large $k$ values. Furthermore, we provide efficient implementations for both CPU and CUDA environments, underscoring the practicality and scalability of our method for large-scale ranking and differentiable ordering problems.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{struski2026lapsum,
  title  = {LapSum - One Method to Differentiate Them All: Ranking, Sorting and Top-k Selection},
  author = {Lukasz Struski and Michal B. Bednarczyk and Igor Podolak and Jacek Tabor},
  year   = {2026},
  eprint = {2503.06242},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2503.06242},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.06242.svg)](https://codeofpaper.com/paper/2503.06242)

Discussion