Affine-invariant ensemble transform methods for logistic regression

Jakiw Pidstrigach, Sebastian Reich

TL;DR

This paper extends ensemble transform methods—traditionally restricted to squared-error loss functions—to handle cross-entropy loss in logistic regression and classification tasks. By leveraging a continuous homotopy approach, the authors develop affine-invariant, gradient-free ensemble algorithms that support data sub-sampling (mini-batching) and dropout-based covariance localization.

What Problem Does This Paper Address?

Ensemble methods, such as the Ensemble Kalman Filter (EnKF) and the Feedback Particle Filter (FPF), are highly popular tools for Bayesian inference. However, they have historically been designed around squared-error loss functions, which assume Gaussian measurement noise.

When it comes to classification problems—like logistic regression—the standard tool is the cross-entropy loss function. Applying traditional ensemble methods directly to cross-entropy loss breaks their underlying mathematical assumptions. While some work has adapted these methods for optimization (minimizing loss), using them for true Bayesian inference (sampling from the posterior distribution) in classification tasks has remained a challenge. This paper bridges that gap.

Methods

The authors introduce a framework that adapts ensemble transform methodologies to cross-entropy loss functions through several key techniques:

  • The Homotopy Approach: Instead of jumping directly from a prior distribution to a complex posterior distribution, the algorithms continuously deform the prior into the posterior over a pseudo-time parameter $\tau \in [0,1]$.
  • Affine-Invariance: The proposed particle evolution equations are invariant to linear transformations of the parameter space. This means the algorithms can sample highly stretched or poorly scaled distributions just as efficiently as perfectly symmetric ones.
  • Modified FPF and EnKBF: The authors derive cross-entropy extensions for both the Feedback Particle Filter (using diffusion maps to solve the governing equations) and the Ensemble Kalman-Bucy Filter (EnKBF).
  • Dropout Localization: In high-dimensional spaces where the ensemble size $M$ is smaller than the parameter dimension $D$, empirical covariance matrices become rank-deficient. The authors introduce a novel "dropout" mechanism—randomly zeroing out ensemble entries during covariance estimation—to act as a regularizer and break subspace confinement.
  • Data Sub-sampling (Mini-batching): The framework natively supports randomly sub-sampling data points, bringing the computational efficiency of stochastic gradient descent (SGD) mini-batches to continuous Bayesian inference.
  • Ensemble Transform Langevin Dynamics: They introduce an alternative sampling method based on McKean-Vlasov stochastic differential equations (SDEs) that can be implemented in a completely derivative-free manner.

Datasets

The methodologies are evaluated using synthetic datasets designed to simulate specific inference challenges:

  • Example 1 (Low-Dimensional Toy Problem): A binary classification problem with $J=2$ features ($D=3$ total parameters) and $N=100$ data points generated from two distinct Gaussian classes. This was used to benchmark the algorithms against exact reference samplers under both informative and uninformative priors.
  • Example 2 (High-Dimensional Problem): A synthetic dataset with $D=50$ parameters and $N=1000$ data points, specifically designed to test the performance of the EnKBF under ensemble size constraints ($M \le D$), dropout localization, and mini-batching.

Key Insights and Ideas

  • Escaping Squared-Error: The core "aha" moment is demonstrating that the continuous homotopy framework provides a mathematically rigorous pathway to escape the squared-error constraint, allowing ensemble filters to handle non-Gaussian likelihoods natively.
  • Dropout as Covariance Localization: Borrowing "dropout" from deep learning serves as an elegant, effective localization technique for data assimilation. It prevents small ensembles from getting trapped in narrow subspaces without requiring complex distance-based localization metrics.
  • Trading Bias for Dimension: While the extended EnKBF relies on a Gaussian approximation that introduces a slight systematic bias in highly non-Gaussian settings, it scales exceptionally well to high dimensions where exact particle filters (like the FPF) fail due to the curse of dimensionality.

Key Results

  • Low-Dimensional Accuracy: In tests with an informative prior, all proposed methods accurately reproduced the reference posterior mean and variance. Under a less informative (more non-Gaussian) prior, the FPF successfully converged to the exact reference solution as the ensemble size increased.
  • The Power of Dropout: In the 50-dimensional experiment with a tiny ensemble ($M=20$), the standard EnKBF failed drastically with an $l_2$ error of $6.26 \pm 0.75$. Activating dropout localization dramatically improved the behavior, dropping the error to $1.29 \pm 0.29$.
  • Mini-batching Efficiency: Incorporating mini-batches ($N'=100$ out of $N=1000$) provided significant computational savings while only marginally altering the approximation quality (an $l_2$ error of $2.14 \pm 0.46$ with small ensembles).

Limitations and Future Work

  • Variance Underestimation: Both the EnKBF and the second-order methods systematically underestimate the posterior variance. The authors note that incorporating "ensemble inflation" techniques common in geoscience could mitigate this.
  • FPF Computational Cost: The FPF provides a more consistent approximation for non-Gaussian targets but is computationally expensive, scaling poorly as ensemble size and dimensionality grow (up to 100x more expensive than EnKBF in tests).
  • Theoretical Gaps: Rigorous mathematical proofs regarding convergence to mean-field limits, ergodicity, and exact equilibrium properties for general non-Gaussian distributions remain open questions.
  • Complex Applications: Future work aims to apply these algorithms to more challenging real-world problems, such as training the Sentence Gestalt model in natural language comprehension.

Summary updated

Abstract

We investigate the application of ensemble transform approaches to Bayesian inference of logistic regression problems. Our approach relies on appropriate extensions of the popular ensemble Kalman filter and the feedback particle filter to the cross entropy loss function and is based on a well-established homotopy approach to Bayesian inference. The arising finite particle evolution equations as well as their mean-field limits are affine-invariant. Furthermore, the proposed methods can be implemented in a gradient-free manner in case of nonlinear logistic regression and the data can be randomly subsampled similar to mini-batching of stochastic gradient descent. We also propose a closely related SDE-based sampling method which again is affine-invariant and can easily be made gradient-free. Numerical examples demonstrate the appropriateness of the proposed methodologies.
BibTeX
@article{pidstrigach2023affine,
  author = {Jakiw Pidstrigach and Sebastian Reich},
  title = {{Affine-invariant ensemble transform methods for logistic regression}},
  journal = {Found. Comput. Math},
  year = {2023},
  doi = {10.1007/s10208-022-09550-2},
}
Figure