Differentiable Top-k Operator with Optimal Transport
Not on the map. Why?
Abstract (arXiv)
The top-k operation, i.e., finding the k largest or smallest elements from a collection of scores, is an important model component, which is widely used in information retrieval, machine learning, and data mining. However, if the top-k operation is implemented in an algorithmic way, e.g., using bubble algorithm, the resulting model cannot be trained in an end-to-end way using prevalent gradient descent algorithms. This is because these implementations typically involve swapping indices, whose gradient cannot be computed. Moreover, the corresponding mapping from the input scores to the indicator vector of whether this element belongs to the top-k set is essentially discontinuous. To address the issue, we propose a smoothed approximation, namely the SOFT (Scalable Optimal transport-based diFferenTiable) top-k operator. Specifically, our SOFT top-k operator approximates the output of the top-k operation as the solution of an Entropic Optimal Transport (EOT) problem. The gradient of the SOFT operator can then be efficiently approximated based on the optimality conditions of EOT problem. We apply the proposed operator to the k-nearest neighbors and beam search algorithms, and demonstrate improved performance.
Key facts. Cited by 17 papers in the map (data through 14 Oct 2026). First posted on arXiv 16 Feb 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 4; 2022: 4; 2023: 1; 2024: 2; 2025: 2; 2026: 4.
17 papers.
Sort:
By area:
- 2021Differentiable Patch Selection for Image Recognitioncited by 68
- 2022A Unified Framework for Implicit Sinkhorn Differentiationcited by 28
- 2023Dodo: Dynamic Contextual Compression for Decoder-only LMscited by 23
- 2025LapSum -- One Method to Differentiate Them All: Ranking, Sorting and Top-k Selectioncited by 13
- 2022Scalable Decision-Focused Learning in Restless Multi-Armed Bandits with Application to Maternal and Child Healthcited by 12
- 2021Combinatorial Optimization for Panoptic Segmentation: A Fully Differentiable Approachcited by 10
- 2021Leveraging Recursive Gumbel-Max Trick for Approximate Inference in Combinatorial Spacescited by 7
- 2022TUSK: Task-Agnostic Unsupervised Keypointscited by 5
- 2021Differentiable Spline Approximationscited by 4
- 2022Auto-Compressing Subset Pruning for Semantic Image Segmentationcited by 4
- 2025CS-Net:Contribution-based Sampling Network for Point Cloud Simplificationcited by 3
- 2024What is the Right Notion of Distance between Predict-then-Optimize Tasks?cited by 2
5 more
- 2024GSINA: Improving Subgraph Extraction for Graph Invariant Learning via Graph Sinkhorn Attentioncited by 1
- 2026Differentiable Knapsack and Top-k Operators via Dynamic Programmingcited by 1
- 2026DiffPrune: differentiable information throttling for token pruning in vision-language modelscited by 1
- 2026LaPrune: Controllable Differentiable Sparsity at Million Scalecited by 0
- 2026Fast LapSum: Exact Differentiable Top-k at Million Scalecited by 0
- 2026Fast LapSum: Exact Differentiable Top-k at Million Scale7 Aug 2026
- 2026LaPrune: Controllable Differentiable Sparsity at Million Scale4 Aug 2026
- 2026DiffPrune: differentiable information throttling for token pruning in vision-language models3 Aug 2026
- 2026Differentiable Knapsack and Top-k Operators via Dynamic Programming29 Jan 2026
- 2025LapSum -- One Method to Differentiate Them All: Ranking, Sorting and Top-k Selection8 Mar 2025
- 2025CS-Net:Contribution-based Sampling Network for Point Cloud Simplification18 Jan 2025
- 2024What is the Right Notion of Distance between Predict-then-Optimize Tasks?11 Sep 2024
- 2024GSINA: Improving Subgraph Extraction for Graph Invariant Learning via Graph Sinkhorn Attention11 Feb 2024
- 2023Dodo: Dynamic Contextual Compression for Decoder-only LMs3 Oct 2023
- 2022TUSK: Task-Agnostic Unsupervised Keypoints16 Jun 2022
- 2022A Unified Framework for Implicit Sinkhorn Differentiation13 May 2022
- 2022Scalable Decision-Focused Learning in Restless Multi-Armed Bandits with Application to Maternal and Child Health2 Feb 2022
5 more
- 2022Auto-Compressing Subset Pruning for Semantic Image Segmentation26 Jan 2022
- 2021Leveraging Recursive Gumbel-Max Trick for Approximate Inference in Combinatorial Spaces28 Oct 2021
- 2021Differentiable Spline Approximations4 Oct 2021
- 2021Combinatorial Optimization for Panoptic Segmentation: A Fully Differentiable Approach6 Jun 2021
- 2021Differentiable Patch Selection for Image Recognition7 Apr 2021
- 2021Differentiable Patch Selection for Image Recognitioncited by 68
- 2022A Unified Framework for Implicit Sinkhorn Differentiationcited by 28
- 2023Dodo: Dynamic Contextual Compression for Decoder-only LMscited by 23
- 2025LapSum -- One Method to Differentiate Them All: Ranking, Sorting and Top-k Selectioncited by 13
- 2022Scalable Decision-Focused Learning in Restless Multi-Armed Bandits with Application to Maternal and Child Healthcited by 12
- 2021Combinatorial Optimization for Panoptic Segmentation: A Fully Differentiable Approachcited by 10
- 2021Leveraging Recursive Gumbel-Max Trick for Approximate Inference in Combinatorial Spacescited by 7
- 2022TUSK: Task-Agnostic Unsupervised Keypointscited by 5
- 2021Differentiable Spline Approximationscited by 4
- 2022Auto-Compressing Subset Pruning for Semantic Image Segmentationcited by 4
- 2025CS-Net:Contribution-based Sampling Network for Point Cloud Simplificationcited by 3
- 2024What is the Right Notion of Distance between Predict-then-Optimize Tasks?cited by 2
12 most cited of 16 All 16 (JSON)
- 2026Fast LapSum: Exact Differentiable Top-k at Million Scale7 Aug 2026
- 2026LaPrune: Controllable Differentiable Sparsity at Million Scale4 Aug 2026
- 2026Differentiable Knapsack and Top-k Operators via Dynamic Programming29 Jan 2026
- 2025LapSum -- One Method to Differentiate Them All: Ranking, Sorting and Top-k Selection8 Mar 2025
- 2025CS-Net:Contribution-based Sampling Network for Point Cloud Simplification18 Jan 2025
- 2024What is the Right Notion of Distance between Predict-then-Optimize Tasks?11 Sep 2024
- 2024GSINA: Improving Subgraph Extraction for Graph Invariant Learning via Graph Sinkhorn Attention11 Feb 2024
- 2023Dodo: Dynamic Contextual Compression for Decoder-only LMs3 Oct 2023
- 2022TUSK: Task-Agnostic Unsupervised Keypoints16 Jun 2022
- 2022A Unified Framework for Implicit Sinkhorn Differentiation13 May 2022
- 2022Scalable Decision-Focused Learning in Restless Multi-Armed Bandits with Application to Maternal and Child Health2 Feb 2022
- 2022Auto-Compressing Subset Pruning for Semantic Image Segmentation26 Jan 2022
12 newest of 16 All 16 (JSON)