Optimization over covariance matrices with a parameterized metric

Yibang Li, Bamdev Mishra, Pratik Jawanpuria, Cyrus MostajeranarXiv 2026

TL;DR

This paper introduces a novel two-parameter family of Riemannian metrics for optimizing over symmetric positive-definite (SPD) matrices that unifies classic metrics like Euclidean, Bures-Wasserstein, and affine-invariant. By treating the choice of metric as a data-driven preconditioning problem, the authors provide simple, efficient rules to tune the metric's parameters directly to the objective function, dramatically accelerating optimization convergence.

What Problem Does This Paper Address?

Symmetric positive-definite (SPD) matrices—commonly used as covariance matrices—are fundamental in machine learning, signal processing, and medical imaging. When minimizing a function over the space of SPD matrices, researchers use Riemannian gradient descent, which requires defining a "metric" to determine the steepest descent direction.

Conventionally, researchers pick a standard metric (like the affine-invariant or Bures-Wasserstein metric) based on appealing geometric properties. However, from an optimization standpoint, the metric acts as an intrinsic preconditioner. A metric that is geometrically elegant might be poorly suited for a specific objective function, leading to ill-conditioned Hessians and painfully slow convergence. This paper addresses the lack of flexibility in standard metrics by proposing a tunable metric family that can adapt to the landscape of the specific problem at hand.

Methods

The authors introduce a two-parameter family of metrics defined via a Sylvester-type equation: $$X^pLX^q + X^qLX^p = U$$ where $X$ is the current matrix, $U$ is a tangent vector, and $L$ is solved for. By varying the parameters $(p, q)$, this family exactly recovers well-known geometries:

  • Euclidean at $(0,0)$
  • Bures-Wasserstein at $(1,0)$
  • Affine-invariant at $(1,1)$

Instead of guessing the best parameters, the authors analyze how the condition number of the Riemannian Hessian behaves at the optimal solution. They show that the condition number has a theoretical "floor" (a lower bound) determined by the exponent $r = p + q$.

To exploit this, they propose a two-stage optimization algorithm:

  1. Pilot Phase: Run a few iterations (e.g., 25 steps) using a default metric to get close to the structure of the solution.
  2. Tuning Phase: Compute a few cheap Hessian-vector products along the eigenbasis frames of the matrix. Use these values to estimate the optimal exponent $r$ and shape $a = p - q$ via either a least-squares fit or a range criterion.
  3. Resume Phase: Complete the optimization using the newly customized, highly efficient metric.
Fig. 3. Selecting the exponent and shape in the (p, q) family. Blue marks the first exponent fit on p = q. Yellow selects δ⋆along p+q = r0, and green refits the exponent along p −q = δ⋆. The gray branch contains the same metrics with p and q exchanged. The positions are schematic. The arrows give the selection order. The final fit can move in either direction along the green line.

Datasets

The proposed methods were evaluated on several real-world tasks:

  • Pixel Covariance Data: A standard digits dataset ($n=36$) used to evaluate fixed power-congruence objectives.
  • UCI Repository Datasets: The Wine and Breast Cancer Wisconsin datasets, utilized for Mahalanobis distance metric learning tasks under various regularizers.
  • SARCOS Dataset: An inverse-dynamics dataset used to learn a $7 \times 7$ SPD task covariance matrix for multi-output Gaussian process prediction.

Key Insights and Ideas

  • Algorithmic over Geometric: The choice of a Riemannian metric should be treated as an algorithmic preconditioning decision tailored to the objective function, rather than a rigid geometric assumption.
  • The Hessian Floor: The conditioning of a problem depends fundamentally on the sum $r = p + q$. For a large class of problems, the optimal choice collapses to a simple diagonal family where $p = q = r/2$.
  • Sparse Sampling Suffices: You do not need to compute the full, expensive Hessian matrix to tune the metric. Evaluating the Hessian on just the extreme diagonal "frames" (the maximum and minimum eigenvalues) provides enough information to find near-optimal parameters.

Key Results

  • Massive Conditioning Improvements: On standard covariance estimation problems, standard named metrics performed up to $10^7$ times worse than the optimally tuned member of the new family.
  • Faster Convergence: In Mahalanobis metric learning experiments, the tuned metrics consistently bypassed the performance plateaus of standard metrics, reaching machine precision significantly faster.
Fig. 1. Objective gap for (26) against iterations at µ = 0.01. Rows correspond to the two datasets, and columns to the three regularizers. The regularizers are labeled by R−tr X, as in Table 2. All runs start from X0 = I and use the same line search. The two-stage curves run at the default r = 2, the affine-invariant weight, until the marker at L and branch there. A five-step pilot suffices on the barriers but not under the log-determinant, which is why L = 25 is used throughout. Log-Euclidean carries open squares because it can sit under affine- invariant to within half a percent.
  • Shape Tuning Gains: On the SARCOS dataset, tuning both the exponent and the shape parameter yielded an additional 54% to 55% median reduction in the Hessian condition number compared to only tuning the exponent baseline.

Limitations and Future Work

The primary limitation is computational complexity: the method relies on performing an eigendecomposition at every iteration, which scales as $O(n^3)$. This restricts its practical use to moderate-sized matrices (typically $n \le 1000$), where the cost of evaluating the objective function or its Hessian-vector products dominates the $O(n^3)$ algebraic overhead.

Future work could explore extending these adaptive preconditioning strategies to larger-scale matrices by avoiding full eigendecompositions or applying low-rank approximations.

Summary updated

Abstract

The choice of Riemannian metric can strongly influence the convergence of gradient-based optimization over covariance matrices. Euclidean, Bures-Wasserstein and affine-invariant metrics are common choices, but their relative effectiveness depends on the objective. We introduce a two-parameter family defined by $X^{p}LX^{q}+X^{q}LX^{p}=U$, solved for $L$ at each tangent vector $U$, that contains all three as exact members, at $(0,0)$, $(1,0)$ and $(1,1)$, and extends past them. We treat the choice of member as a particular way of preconditioning for a given problem. To this end, we analyze the conditioning of the Riemannian Hessian at the solution. We show that it obeys a lower bound that depends on $(p,q)$ only through the exponent $r=p+q$. When the Euclidean Hessian is a pure power that mixes no eigendirections, the member $p=q=r/2$ attains that bound, and a closed-form criterion identifies the other members that do. We discuss ways to tune $r$ for a given problem. Experiments on real covariance data confirm the predicted conditioning and the benefit of tuning $r$. A task covariance example shows a further gain from tuning the shape.
BibTeX
@misc{li2026optimization,
  author = {Yibang Li and Bamdev Mishra and Pratik Jawanpuria and Cyrus Mostajeran},
  title = {{Optimization over covariance matrices with a parameterized metric}},
  year = {2026},
  eprint = {2609.17089},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.17089},
}
Figure