Reparameterizing the Birkhoff Polytope for Variational Permutation Inference

Scott W. Linderman, Gonzalo E. Mena, Hal James Cooper, Liam Paninski, John P. CunninghamAISTATS 2018

Abstract

Permutations are fundamental to many machine learning tasks, including sorting, matching, and object tracking. However, performing Bayesian inference over the space of permutations is computationally challenging due to the factorial growth of the search space and the discrete nature of permutation matrices. This paper addresses these challenges by relaxing the discrete set of permutations into the continuous Birkhoff polytope—the set of all doubly-stochastic matrices. We propose two novel, differentiable reparameterizations for this space: a stick-breaking construction and a rounding map based on the Hungarian algorithm. These transformations allow for the use of reparameterization gradients in stochastic variational inference. Our methods are evaluated on synthetic matching problems and a biological task involving neural identity in C. elegans, demonstrating superior performance in capturing multi-modal distributions and providing robust uncertainty quantification.

Introduction

Reasoning about permutations is a pervasive problem in artificial intelligence. Whether matching features across images or identifying neurons in a brain, the underlying structure often involves a one-to-one mapping between sets. However, the space of $N \times N$ permutation matrices is discrete and contains $N!$ elements, making exhaustive search or standard gradient-based optimization impossible for even moderate $N$. While point estimation can be achieved via algorithms like the Hungarian method, fully Bayesian inference—which accounts for uncertainty and enables information sharing across datasets—remains difficult. Existing approaches like Markov Chain Monte Carlo (MCMC) often struggle with slow mixing in high-dimensional discrete spaces.

Methods: Relaxing the Birkhoff Polytope

The core idea of this work is to move from the discrete set of permutation matrices to their convex hull, known as the Birkhoff polytope. This polytope consists of all doubly-stochastic matrices, where rows and columns sum to one and all entries are non-negative. By working in this continuous space, we can leverage gradient-based variational inference.

We introduce two primary reparameterization techniques:

  1. Stick-Breaking for Permutations: This method generalizes the stick-breaking process used in Dirichlet processes to the matrix case. It fills a matrix entry-by-entry while maintaining doubly-stochastic constraints through a system of dynamic upper and lower bounds. This transformation is both invertible and differentiable, allowing for efficient $O(N^2)$ computation.
  2. Rounding via the Hungarian Algorithm: This approach maps a point within the Birkhoff polytope toward its nearest permutation matrix. By incorporating a temperature parameter $\tau$, we can control the "softness" of the distribution. As $\tau \to 0$, the distribution concentrates on discrete permutations. This method is more symmetric than stick-breaking but requires the $O(N^3)$ Hungarian algorithm.
Visual comparison of reparameterization methods for categorical and permutation distributions.

Experimental Evaluation

The proposed methods were tested on two benchmarks. First, a synthetic matching task with $N=6$ items allowed for comparison against the exact posterior. Our methods significantly outperformed the traditional Mallows distribution in capturing complex, multi-modal posterior structures.

Second, we applied the framework to a real-world problem: identifying neurons in the nematode C. elegans. By matching observed calcium imaging data to a known connectome, the model successfully identified biological labels for active neurons. Unlike point estimation methods, our variational approach provided a full distribution over identities, highlighting cases where labels were ambiguous. Furthermore, the Bayesian framework allowed for the aggregation of data across multiple individuals, significantly improving identification accuracy.

Discussion and Conclusion

By relaxing permutations to the Birkhoff polytope, we enable efficient, gradient-based Bayesian inference for a class of problems previously considered intractable. While the stick-breaking method offers computational efficiency, the rounding method provides better symmetry. Both methods offer a significant leap forward in our ability to handle uncertainty in discrete matching problems. Future work will focus on scaling these methods to even larger systems and integrating more complex, non-linear models of underlying dynamics.

Summary updated

BibTeX
@inproceedings{linderman2018reparameterizing,
  author = {Scott W. Linderman and Gonzalo E. Mena and Hal James Cooper and Liam Paninski and John P. Cunningham},
  title = {{Reparameterizing the Birkhoff Polytope for Variational Permutation Inference}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2018},
}
Figure