Introduction
Partitioning sets into subsets is a fundamental task in machine learning, appearing in clustering, object segmentation, and resource allocation. However, the discrete nature of these assignments typically makes them incompatible with gradient-based optimization. At NeurIPS 2023, researchers from ETH Zurich introduced Differentiable Random Partition Models (DRPM), a framework that enables end-to-end learning of partitions within neural networks by bridging the gap between discrete logic and continuous optimization.
The Challenge of Discrete Partitioning
Standard deep learning relies on the "reparameterization trick" to flow gradients through stochastic processes. Partitioning—the act of assigning elements to specific, non-overlapping groups—is inherently discrete and non-differentiable. Furthermore, traditional clustering methods often assume data points are independent and identically distributed (i.i.d.), failing to account for the global constraints of a finite dataset where assigning one point to a cluster affects the available capacity for others.
The DRPM Framework
DRPM addresses these issues through a novel two-stage differentiable process:
- Modeling Subset Sizes: The model first predicts the distribution of subset sizes using a differentiable relaxation of the Multivariate Non-central Hypergeometric (MVHG) distribution. This allows the network to learn the "importance" or capacity of different groups.
- Learning Element Ordering: To assign elements to these subsets, the model learns a permutation (ordering) of the elements via the Plackett-Luce distribution and a differentiable sorting operator. Elements are then filled into the pre-determined subset sizes based on their rank.
By using continuous relaxations like the Gumbel-Softmax trick for both sizes and permutations, the entire process becomes differentiable, allowing the model to "sample" a partition during the forward pass while maintaining a functional gradient for the backward pass.
Experimental Evaluation and Results
The authors evaluated DRPM across several domains, including variational clustering, generative factor discovery, and multitask learning.
Variational Clustering
In clustering tasks on MNIST and Fashion-MNIST (FMNIST), the DRPM Variational Clustering (DRPM-VC) model significantly outperformed existing methods like Variational Deep Embedding (VaDE). By treating clustering as a partition of a finite set rather than independent categorical assignments, the model better captures global data structures. On MNIST, it achieved an accuracy of 0.94 compared to VaDE's 0.82.
Factor Discovery and Multitask Learning
In generative factor partitioning experiments using the robot arm dataset (mpi3d), DRPM-VAE was uniquely successful in estimating the true number of shared generative factors between image pairs, whereas baselines consistently overestimated them. In multitask learning (MTL) setups, the model acted as an adaptive router, dynamically allocating more neurons to harder tasks based on the loss signal, thereby optimizing resource usage without manual tuning.
Limitations and Future Outlook
While powerful, DRPM faces scalability challenges. The permutation matrix scales quadratically ($O(n^2)$) with the number of elements, limiting its use for very large datasets in a single pass. Additionally, the optimization landscape for learning orderings is complex and can be sensitive to initialization. Future research may explore alternative approaches, such as Earth Mover’s Distance, to enhance scalability and stability for large-scale partitioning tasks.
Summary updated