Differentiable Knapsack and Top-k Operators via Dynamic Programming

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Vivier-Ardisson, Germain, Sander, Michaël E., Parmentier, Axel, Blondel, Mathieu
Format: Preprint
Veröffentlicht: 2026
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908797936599040
author Vivier-Ardisson, Germain
Sander, Michaël E.
Parmentier, Axel
Blondel, Mathieu
author_facet Vivier-Ardisson, Germain
Sander, Michaël E.
Parmentier, Axel
Blondel, Mathieu
contents Knapsack and Top-k operators are useful for selecting discrete subsets of variables. However, their integration into neural networks is challenging as they are piecewise constant, yielding gradients that are zero almost everywhere. In this paper, we propose a unified framework casting these operators as dynamic programs, and derive differentiable relaxations by smoothing the underlying recursions. On the algorithmic side, we develop efficient parallel algorithms supporting both deterministic and stochastic forward passes, and vector-Jacobian products for the backward pass. On the theoretical side, we prove that Shannon entropy is the unique regularization choice yielding permutation-equivariant operators, and characterize regularizers inducing sparse selections. Finally, on the experimental side, we demonstrate our framework on a decision-focused learning benchmark, a constrained dynamic assortment RL problem, and an extension of discrete VAEs.
format Preprint
id arxiv_https___arxiv_org_abs_2601_21775
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Differentiable Knapsack and Top-k Operators via Dynamic Programming
Vivier-Ardisson, Germain
Sander, Michaël E.
Parmentier, Axel
Blondel, Mathieu
Machine Learning
Knapsack and Top-k operators are useful for selecting discrete subsets of variables. However, their integration into neural networks is challenging as they are piecewise constant, yielding gradients that are zero almost everywhere. In this paper, we propose a unified framework casting these operators as dynamic programs, and derive differentiable relaxations by smoothing the underlying recursions. On the algorithmic side, we develop efficient parallel algorithms supporting both deterministic and stochastic forward passes, and vector-Jacobian products for the backward pass. On the theoretical side, we prove that Shannon entropy is the unique regularization choice yielding permutation-equivariant operators, and characterize regularizers inducing sparse selections. Finally, on the experimental side, we demonstrate our framework on a decision-focused learning benchmark, a constrained dynamic assortment RL problem, and an extension of discrete VAEs.
title Differentiable Knapsack and Top-k Operators via Dynamic Programming
topic Machine Learning
url https://arxiv.org/abs/2601.21775