Backpropagation through Combinatorial Algorithms: Identity with Projection Works
Subham Sekhar Sahoo, Anselm Paulus, Marin Vlastelica, Vít Musil, Volodymyr Kuleshov, Georg Martius
TL;DR
The paper tackles the challenge of backpropagating through discrete combinatorial solvers, where true gradients are zero or undefined. It introduces Identity, a hyperparameter-free gradient replacement that treats the solver as a negative identity on the backward pass, augmented by cost projections to exploit solver invariances and optionally a margin via symmetric noise. This framework reframes solver differentiation as a relaxed or relaxed-relaxation process, avoiding extra solver calls while stabilizing learning. Across DVAE, learning-to-explain, deep graph matching, image retrieval, and TSP, Identity demonstrates competitive performance and robustness, with projections and margins significantly improving stability and preventing cost collapse. The approach offers a practical, scalable alternative to complex smoothing or learning-based differentiation methods, enabling more reliable integration of combinatorial modules into end-to-end models.
Abstract
Embedding discrete solvers as differentiable layers has given modern deep learning architectures combinatorial expressivity and discrete reasoning capabilities. The derivative of these solvers is zero or undefined, therefore a meaningful replacement is crucial for effective gradient-based learning. Prior works rely on smoothing the solver with input perturbations, relaxing the solver to continuous problems, or interpolating the loss landscape with techniques that typically require additional solver calls, introduce extra hyper-parameters, or compromise performance. We propose a principled approach to exploit the geometry of the discrete solution space to treat the solver as a negative identity on the backward pass and further provide a theoretical justification. Our experiments demonstrate that such a straightforward hyper-parameter-free approach is able to compete with previous more complex methods on numerous experiments such as backpropagation through discrete samplers, deep graph matching, and image retrieval. Furthermore, we substitute the previously proposed problem-specific and label-dependent margin with a generic regularization procedure that prevents cost collapse and increases robustness.
