Abstract
Probabilistic clustering is a fundamental task in machine learning, yet existing amortized inference methods often struggle with a trade-off between providing assignment probabilities and maintaining invariance to input data permutations. We introduce GFNCP, a novel framework that leverages Generative Flow Networks (GFlowNets) to achieve state-of-the-art clustering performance. By framing clustering as a sequential process on a Directed Acyclic Graph and employing a shared energy-based parametrization, GFNCP ensures that cluster assignments are mathematically consistent regardless of the order in which data points are processed.
The Challenge of Order Invariance
Traditional probabilistic clustering methods, such as Markov Chain Monte Carlo (MCMC), are computationally expensive and struggle with high-dimensional data. Amortized inference offers a faster alternative by training neural networks to predict cluster assignments directly. However, existing models face significant limitations. Sequential models like the Neural Clustering Process (NCP) provide valuable uncertainty quantification via assignment probabilities but are highly sensitive to the order of input data. Conversely, non-sequential models like Deep Adaptive Clustering (DAC) lack explicit assignment probabilities.
GFNCP is designed to bridge this gap, offering a well-defined posterior and data-permutation invariance while retaining the ability to output assignment probabilities.
Methodology: GFlowNet-based Clustering
GFNCP treats the construction of a clustered dataset as a navigation task within a Directed Acyclic Graph (DAG). Each state in the DAG represents a partial clustering of the data, and transitions involve assigning a new data point to either an existing cluster or a newly created one.
Key Innovations
- Shared Energy-Based Parametrization: Instead of separate networks for policy and reward, GFNCP uses a single energy-based model. This architecture naturally respects permutation symmetries, guiding the model toward order-invariant predictions.
- Marginal Consistency Loss: The authors adapt the GFlowNet "Flow Matching" loss to ensure that the clustering posterior is consistent under marginalization. This theoretical link guarantees that the probability of a final clustering state is independent of the path (data order) taken to reach it.
- Self-Supervised Training: GFNCP utilizes instance discrimination, treating augmented versions of a single data point as a ground-truth cluster during training. This allows for effective unsupervised learning on complex datasets like ImageNet.
Key Results
GFNCP was evaluated on synthetic data, MNIST, Fashion-MNIST, and ImageNet subsets. It consistently outperformed baselines in both clustering accuracy and consistency.
Performance and Consistency
On ImageNet-200, GFNCP achieved a Normalized Mutual Information (NMI) of 0.58, surpassing DAC (0.57) and NCP (0.46). More importantly, GFNCP demonstrated a dramatic reduction in order sensitivity. Using the Standard Deviation over Permutation Probabilities (SDPP) metric, GFNCP showed significantly more stable predictions across different data shuffles compared to NCP.
As shown in the figure above, while NCP's cluster assignments can change drastically when the input order is permuted (e.g., misclassifying an '8' as a '6' in the first permutation), GFNCP maintains a consistent and correct clustering across different permutations.
Uncertainty Awareness
Qualitative analysis on Fashion-MNIST revealed that GFNCP effectively captures data uncertainty. For ambiguous items—such as footwear that shares features of both boots and shoes—the model assigns lower, more distributed probabilities, providing a principled measure of its own confidence.
Conclusion
GFNCP represents a significant step forward in amortized probabilistic clustering. By combining the strengths of GFlowNets with energy-based modeling, it provides a fast, accurate, and—crucially—consistent method for high-dimensional data clustering. While its $O(N)$ scaling presents a minor computational trade-off compared to parallel models, the gain in theoretical consistency and uncertainty quantification makes it a robust choice for real-world applications.
Summary updated