The Power Spherical distribution

Nicola De Cao, Wilker AzizarXiv 2020

Abstract

There is a growing interest in probabilistic models defined in hyper-spherical spaces, be it to accommodate observed data or latent structure. The von Mises-Fisher (vMF) distribution, often regarded as the Normal distribution on the hyper-sphere, is a standard modeling choice: it is an exponential family and thus enjoys important statistical results, for example, known Kullback-Leibler (KL) divergence from other vMF distributions. Sampling from a vMF distribution, however, requires a rejection sampling procedure which besides being slow poses difficulties in the context of stochastic backpropagation via the reparameterization trick. Moreover, this procedure is numerically unstable for certain vMFs, e.g., those with high concentration and/or in high dimensions. We propose a novel distribution, the Power Spherical distribution, which retains some of the important aspects of the vMF (e.g., support on the hyper-sphere, symmetry about its mean direction parameter, known KL from other vMF distributions) while addressing its main drawbacks (i.e., scalability and numerical stability). We demonstrate the stability of Power Spherical distributions with a numerical experiment and further apply it to a variational auto-encoder trained on MNIST.

Introduction

Directional data, which naturally resides on the surface of a hyper-sphere, is prevalent in modern machine learning applications, ranging from word embeddings in natural language processing to feature vectors in computer vision. The standard approach for modeling such data is the von Mises-Fisher (vMF) distribution. While the vMF distribution is mathematically elegant as an exponential family, it presents significant practical challenges in deep learning workflows. Specifically, sampling from a vMF distribution relies on rejection sampling, which is computationally expensive and complicates the use of the reparameterization trick for gradient-based optimization. Furthermore, the reliance on modified Bessel functions leads to numerical instability in high-dimensional spaces or under high concentration parameters, often resulting in floating-point errors during training.

The Power Spherical Distribution

To address these limitations, we introduce the Power Spherical distribution. Like the vMF, it is rotationally symmetric around a mean direction $\mu \in \mathbb{S}^{d-1}$ and controlled by a concentration parameter $\kappa > 0$. However, its probability density function (PDF) is defined using a power-law form: $$p(x; \mu, \kappa) \propto (1 + \mu^\top x)^\kappa$$

This formulation allows for a more efficient sampling strategy. The distribution can be decomposed into a marginal distribution that follows a transformed Beta distribution. Since Beta distributions have analytical inverse cumulative distribution functions (CDFs), the Power Spherical distribution enables direct, rejection-free, and differentiable sampling. Additionally, the authors derived a closed-form Kullback-Leibler (KL) divergence between Power Spherical and vMF distributions, ensuring interoperability with existing models.

The Power Spherical distribution visualized on the circle $\mathbb{S}^1$ and sphere $\mathbb{S}^2$ across different concentration levels $\kappa$.

Experimental Results

We evaluated the Power Spherical distribution against the vMF across several benchmarks focusing on stability, speed, and performance in generative modeling.

Numerical Stability and Scalability

We conducted a grid search across dimensions $d$ up to $10^5$ and concentrations $\kappa$ up to $10^6$. The vMF distribution becomes unstable (returning NaN) in a significant portion of the parameter space, particularly as dimension and concentration increase. In contrast, the Power Spherical distribution remains stable throughout the entire tested range, avoiding the pitfalls of complex special functions.

Computational Efficiency

Sampling speed is a critical factor for large-scale training. On GPU hardware, the Power Spherical distribution achieves a speedup of 6x to 20x compared to the vMF. Notably, the sampling time for the Power Spherical distribution remains constant regardless of the concentration parameter, whereas the vMF's rejection sampling becomes increasingly inefficient as concentration grows.

Numerical stability (left) and sampling time on GPU (right) comparison between von Mises-Fisher and Power Spherical distributions.

Variational Auto-Encoder on MNIST

We integrated the Power Spherical distribution into a hyperspherical Variational Auto-Encoder (VAE) trained on the MNIST dataset. The Power Spherical VAE achieved comparable log-likelihood and Evidence Lower Bound (ELBO) scores to the vMF-based VAE, but with a training speed increase of over 2x. This demonstrates that the distribution is not only more stable and faster but also maintains the representational capacity required for complex latent variable models.

Conclusion

The Power Spherical distribution provides a robust and efficient alternative to the von Mises-Fisher distribution for modeling hyperspherical data. By eliminating the need for rejection sampling and avoiding numerically unstable special functions, it enables the seamless application of directional priors in high-dimensional deep learning models. Future research will explore its utility in normalizing flows and other manifold-constrained probabilistic models.

Summary updated

BibTeX
@misc{cao2020power,
  author = {Nicola De Cao and Wilker Aziz},
  title = {{The Power Spherical distribution}},
  year = {2020},
  eprint = {2006.04437},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.04437},
}
Figure