Lune

ICML2023Top-tier venue

Fast, Differentiable and Sparse Top-k: a Convex Analysis Perspective

Michael Eli Sander, Joan Puigcerver, Josip Djolonga, Gabriel Peyré, Mathieu Blondel

Abstract

The top-k operator returns a sparse vector, where the non-zero values correspond to the k largest values of the input. Unfortunately, because it is a discontinuous function, it is difficult to incorporate in neural networks trained end-to-end with backpropagation. Recent works have considered differentiable relaxations, based either on regularization or perturbation techniques. However, to date, no approach is fully differentiable and sparse. In this paper, we propose new differentiable and sparse top-k operators. We view the top-k operator as a linear program over the permutahedron, the convex hull of permutations. We then introduce a p-norm regularization term to smooth out the operator, and show that its computation can be reduced to isotonic optimization. Our framework is significantly more general than the existing one and allows for example to express top-k operators that select values in magnitude. On the algorithmic side, in addition to pool adjacent violator (PAV) algorithms, we propose a new GPU/TPU-friendly Dykstra algorithm to solve isotonic optimization problems. We successfully use our operators to prune weights in neural networks, to fine-tune vision transformers, and as a router in sparse mixture of experts.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

15 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Differentiable Clustering with Perturbed Spanning Forests cites Efficient and Modular Implicit Differentiation
  • Scaling Vision with Sparse Mixture of Experts cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Scaling Vision with Sparse Mixture of Experts cites BASE Layers: Simplifying Training of Large, Sparse Models
  • Mixture-of-Experts with Expert Choice Routing cites BASE Layers: Simplifying Training of Large, Sparse Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers15

  1. Differentiable Clustering with Perturbed Spanning ForestsLawrence Stewart, Francis R. Bach, Felipe Llinares-López, Quentin BerthetNeurIPS 2023 · 16 citations
  2. Foundations of Top-k Decoding for Language ModelsGeorgy Noarov, Soham Mallick, Tao Wang, Sunay Joshi et al.NeurIPS 2025 · 14 citations
  3. A path-norm toolkit for modern networks: consequences, promises and challengesAntoine Gonon, Nicolas Brisebarre, Elisa Riccietti, Rémi GribonvalICLR 2024 · 13 citations
  4. OKRidge: Scalable Optimal k-Sparse Ridge RegressionJiachang Liu, Sam Rosen, Chudi Zhong, Cynthia RudinNeurIPS 2023 · 10 citations
  5. How Many Tokens Do 3D Point Cloud Transformer Architectures Really Need?Tuan Anh Tran, Duy M. H. Nguyen, Hoai-Chau Tran, Michael Barz et al.NeurIPS 2025 · 5 citations

Builds on15

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. Scaling Vision with Sparse Mixture of ExpertsCarlos Riquelme, Joan Puigcerver, Basil Mustafa, Maxim Neumann et al.NeurIPS 2021 · 1,213 citations
  3. Mixture-of-Experts with Expert Choice RoutingYanqi Zhou, Tao Lei, Hanxiao Liu, Nan Du et al.NeurIPS 2022 · 933 citations
  4. Efficient and Modular Implicit DifferentiationMathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig et al.NeurIPS 2022 · 386 citations
  5. BASE Layers: Simplifying Training of Large, Sparse ModelsMike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal et al.ICML 2021 · 382 citations

Related papers

  1. Differentiable Top-k with Optimal TransportYujia Xie, Hanjun Dai, Minshuo Chen, Bo Dai et al.NeurIPS 2020 · 124 citations
  2. DTop-p MoE: Sparsity-Controlled Dynamic Top-p MoE for Foundation Model Pre-trainingCan Jin, Hongwu Peng, Mingcan Xiang, Qixin Zhang et al.ICML 2026 · 3 citations
  3. Maximum Score Routing For Mixture-of-ExpertsBowen Dong, Yilong Fan, Yutao Sun, Zhenyu Li et al.ACL Findings 2025 · 2 citations
  4. ReMoE: Fully Differentiable Mixture-of-Experts with ReLU RoutingZiteng Wang, Jun Zhu, Jianfei ChenICLR 2025
  5. Learnable Permutation for Structured Sparsity on Transformer ModelsZekai Li, Ji Liu, Guanchen Li, Yixing Xu et al.AAAI 2026
Dusk over the sea between two cliffs drawn in fine vertical lines