Differentiable Top-k: From One-Hot to k-Hot
Klas Wijk, Ricardo Vinuesa, Hossein Azizpour
DiffSys @ EurIPS 2025
Abstract. The one-hot representation, argmax operator, and its differentiable relaxation, softmax, are ubiquitous in machine learning. These building blocks lie at the heart of everything from the cross-entropy loss and attention mechanism to differentiable sampling. Their -hot counterparts, however, are not as universal. In this paper, we consolidate the literature on differentiable top-, showing how the -capped simplex connects relaxed top- operators and ps sampling to form an intuitive generalization of one-hot sampling. In addition, we propose sigmoid top-, a scalable relaxation of the top- operator that is fully differentiable and defined for continuous . We validate our approach empirically and demonstrate its computational efficiency.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
Loading the discussion…