Estimating the Density Ratio between Distributions with High Discrepancy using Multinomial Logistic Regression

Akash Srivastava, Seungwook Han, Kai Xu, Benjamin Rhodes, Michael U. Gutmann

Abstract

Estimating the ratio of two probability densities ($p/q$) is a fundamental task in machine learning, yet it remains challenging when the distributions have little overlap—a phenomenon known as the "density-chasm problem." Standard binary classification-based estimators often fail in these scenarios as classifiers become overly confident, leading to inaccurate ratio estimates in the distribution tails. This paper introduces Multinomial Logistic Regression based Density Ratio Estimation (MDRE), a method that bridges this gap by employing auxiliary "bridge" distributions within a multi-class classification framework. Unlike previous "telescopic" methods that suffer from cumulative errors due to distribution shift, MDRE trains a single model on all distributions simultaneously. Empirical results on high-dimensional synthetic and image datasets demonstrate that MDRE significantly outperforms existing baselines in accuracy and robustness.

Introduction

Probability density ratios are essential for various machine learning applications, including Generative Adversarial Networks (GANs), Mutual Information (MI) estimation, and representation learning. However, a significant hurdle exists when $p$ and $q$ are highly dissimilar, often referred to as the "density-chasm problem." In such cases, standard estimators that rely on binary classification to distinguish between samples from $p$ and $q$ tend to fail because the classification task becomes too easy, causing the model to ignore the critical "tails" of the distributions.

The Density-Chasm Problem

The conventional approach to density ratio estimation involves training a binary classifier. If the classifier is optimal, the ratio of class probabilities yields the density ratio. However, when $p$ and $q$ are well-separated, the classifier learns a sharp decision boundary and becomes "too confident," leading to flat probability estimates that do not capture the true log-density ratio in the overlapping regions.

Comparison of BDRE and MDRE performance in 1D. BDRE fails to estimate the log-ratio in the tails due to classifier overconfidence, while MDRE with an auxiliary distribution 'm' succeeds.

Methodology: Multinomial Logistic Regression (MDRE)

To address the limitations of binary classification and the distribution shift issues found in sequential "telescopic" methods, the authors propose MDRE. Instead of a binary setup, MDRE utilizes multi-class classification.

The core idea is to introduce $K$ auxiliary "bridge" distributions ($m_1, \dots, m_K$) that overlap with both target distributions $p$ and $q$. A single multinomial logistic regression model is trained to classify samples into $K+2$ classes. The log-density ratio between $p$ and $q$ is then derived from the difference between their respective unnormalized log-probabilities (logits):

$$\log \hat{r}_{p/q}(x) = \hat{h}_p(x) - \hat{h}_q(x)$$

By training on all distributions simultaneously, MDRE avoids the "blind spots" and distribution shifts that plague step-by-step telescopic approaches. The auxiliary distributions can be constructed using heavy-tailed distributions (like Cauchy), linear mixing of samples, or dimension-wise mixing for high-dimensional data.

Visualization of distribution shift in telescopic methods (TRE) versus MDRE. MDRE's simultaneous training on all classes prevents the cumulative errors seen in sequential binary classifiers.

Key Results

The researchers evaluated MDRE against standard binary density-ratio estimation (BDRE) and Telescopic Density-Ratio Estimation (TRE) across several benchmarks:

  • 1D Gaussians: In a scenario with a true KL divergence of 200.27, BDRE estimated 21.74 and TRE estimated 136.05, while MDRE achieved a near-perfect 203.32.
  • High-Dimensional MI Estimation: In a 320-dimensional task with a true MI of 240, MDRE estimated 217.14, significantly outperforming all baselines which failed to exceed 101.
  • Representation Learning: On the SpatialMultiOmniglot benchmark, MDRE-trained encoders achieved nearly 100% accuracy on downstream tasks, whereas TRE's performance dropped to 85% as complexity increased.

Conclusion

MDRE provides a robust and theoretically grounded solution to the density-chasm problem. By leveraging multi-class classification and simultaneous training with auxiliary bridge distributions, it overcomes the distribution shift and overconfidence issues of prior methods. While future work may explore automated bridge design, MDRE currently stands as a highly effective tool for high-dimensional density ratio estimation.

Summary updated

BibTeX
@article{srivastava2023estimating,
  author = {Akash Srivastava and Seungwook Han and Kai Xu and Benjamin Rhodes and Michael U. Gutmann},
  title = {{Estimating the Density Ratio between Distributions with High Discrepancy using Multinomial Logistic Regression}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2023},
  url = {https://openreview.net/forum?id=EQMiMPmmqb},
}
Figure