Accelerating Convergence in Bayesian Few-Shot Classification

Tianjun Ke, Haoqun Cao, Feng Zhou

TL;DR

This paper introduces MD-BSFC, a novel framework that applies mirror descent to Bayesian few-shot classification. By leveraging non-Euclidean geometry, the authors transform the difficult problem of non-conjugate Gaussian Process inference into a fast, "conjugate-like" update. This results in quicker convergence and superior uncertainty calibration compared to existing methods.

The Challenge of Bayesian Few-Shot Learning

Few-shot classification (FSC) is the challenge of teaching a model to recognize new categories from just one or a handful of examples. Bayesian methods, particularly those using Gaussian Processes (GPs), are popular in this domain because they naturally handle the high uncertainty inherent in small datasets, preventing the model from making overconfident "hallucinations."

However, a significant mathematical hurdle exists: GP classification typically uses a softmax likelihood, which is "non-conjugate" to the Gaussian prior. This means you cannot calculate the posterior distribution directly. Existing workarounds either introduce complex "auxiliary variables" (which slow down the model) or simplify the math by treating discrete labels as continuous values (which hurts accuracy). The authors set out to find a way to perform this inference efficiently without these compromises.

Methods: Enter MD-BSFC

To overcome these hurdles, the authors propose Mirror Descent-based Bayesian Few-Shot Classification (MD-BSFC). The key innovation lies in how the model updates its "inner loop" (the part that learns a specific task).

Overview of the MD-BSFC framework integrating Mirror Descent into bi-level optimization.
  • Mirror Descent (MD): Instead of using standard Gradient Descent, which assumes a flat, Euclidean space, MD operates on a Riemannian manifold. This respects the underlying geometry of probability distributions.
  • The Conjugate Shortcut: The authors prove that by using MD over the "mean parameters" of the distribution, the update step becomes equivalent to a simple conjugate Bayesian inference. This allows them to update task-specific parameters using first-order information while achieving the convergence speed typically associated with second-order methods.
  • Bi-level Optimization: The model uses a deep kernel (a neural network) to extract features. The "outer loop" learns these general features across many tasks, while the "inner loop" uses MD to quickly adapt to a specific few-shot task.

Key Insights

  • Geometry is a Cheat Code: Standard gradients often take "unnatural" paths when optimizing distributions. By switching to non-Euclidean geometry via Mirror Descent, the model finds the "steepest" path toward the optimal distribution, leading to much faster convergence.
  • Simplicity Wins: Unlike previous state-of-the-art GP methods (like those using Polya-Gamma augmentation), MD-BSFC does not require adding extra variables to the model. This makes the implementation cleaner and the computation more direct.
  • Parameterization Invariance: Because MD-BSFC is based on the geometry of the distribution itself, it doesn't matter how you mathematically represent that distribution (e.g., natural parameters vs. mean parameters); the optimization path remains efficient.
  • Inner-Loop Efficiency Impacts the Whole Model: Faster convergence in the inner loop doesn't just save time; it provides more stable gradients for the outer loop, helping the model learn better deep-feature representations overall.

Experimental Results

The model was evaluated on four standard few-shot benchmarks: CUB (fine-grained bird species), mini-ImageNet, Omniglot, and EMNIST (used for cross-domain evaluation).

  • Accuracy: MD-BSFC achieved state-of-the-art or competitive results across all benchmarks. Notably, it reached 65.45% accuracy in 1-shot CUB tasks and 40.75% in the challenging mini-ImageNet $\rightarrow$ CUB cross-domain scenario.
  • Convergence Speed: In empirical tests, the Evidence Lower Bound (ELBO) for MD-BSFC increased significantly faster than standard Gradient Descent. The model often required only 3 steps in the inner loop to reach high performance.
Comparison of ELBO convergence between Gradient Descent (GD) and Mirror Descent (MD) for 1-shot classification.
  • Uncertainty Calibration: The model demonstrated exceptional reliability. It achieved the lowest Expected Calibration Error (ECE) on several datasets (e.g., ~0.005 on CUB), meaning the model's "confidence" scores closely match its actual accuracy—a critical feature for high-stakes applications like medical diagnosis.

Limitations and Future Work

The authors acknowledge that while they have successfully upgraded the inner-loop optimization to a second-order-like method (via Mirror Descent), the outer-loop (which updates the neural network weights) still relies on standard first-order Adam optimization. This is due to the massive computational and memory costs of performing second-order updates on large neural networks.

Future work will likely explore how to bring similar geometric acceleration to the outer loop without exploding the computational budget. Additionally, the authors suggest investigating more complex non-Euclidean manifolds beyond the ones explored in this paper.

Summary updated

BibTeX
@inproceedings{ke2024accelerating,
  author = {Tianjun Ke and Haoqun Cao and Feng Zhou},
  title = {{Accelerating Convergence in Bayesian Few-Shot Classification}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=9PQnc6EWdL},
}
Figure