acceptodds
Published as a conference paper at NeurIPS 2026

Fast and Stable Gradient Approximation for Bilinear Forms of Hermitian Matrix Functions

Navjot Singh, Kipton Barros, Sherry Li

Abstract

Objectives involving bilinear forms \(u^\top f(A(\theta))v\) for Hermitian \(A\) arise widely in scientific computing and probabilistic machine learning. For large matrices, Lanczos efficiently approximates these quantities, but differentiating them with respect to \(\theta\) is challenging. Existing approaches either backpropagate through the Lanczos recurrence, requiring reorthogonalization for stability, or apply Arnoldi to an augmented block matrix of twice the original size. Both introduce extra computation and orthogonalization costs that can limit performance on modern hardware. We propose a forward-only gradient approximation that reuses the Lanczos pass and adds very minimal overhead in most cases. We prove that its error is proportional to the Lanczos residual norm, the same quantity controlling the forward approximation. Whereas a traditional adjoint-based calculation would be unstable without reorthogonalization, the new method appears unconditionally stable in our tests. It is also faster than existing state-of-the-art approaches.

Keywords:
Sydney, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 17%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.00 over 3 reviews, above 17% of the others.
Reviewer_JZQdOpenReview ↗
Rating
4
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper proposes a simple and practical method for approximating the gradient of quadratic form of Hermitian matrix functions via Lanczos. We assume that the parametrized matrix A(θ)A(\theta) could be accessed via matrix-vector product, making Lanczos an attractive method, by Lanczos, we know that AV=VT+βmvmem+1⊤AV=VT+\beta_m v_m e_{m+1}^\top where VV is an orthonormal basis for the Krylov subspace of A,uA, u, ignoring the last term, we could approximate u⊤f(A)uu^\top f(A) u via ∥u∥22e1⊤f(T)e1\|u\|_2^2 e_1^\top f(T) e_1 for tridiagonal TT. Set ϕ(T)=∥u∥22e1⊤f(T)e1\phi(T)=\|u\|_2^2 e_1^\top f(T) e_1, then dϕ=tr(G⊤dT)d\phi={\rm tr}(G^\top dT) where GG is a matrix that depends on the first row of QQ and the divided-difference matrix common in matrix differentiation. Since T=V⊤AVT=V^\top AV, dT=V⊤dAV+dV⊤AV+V⊤AdVdT=V^\top dA V+dV^\top AV+V^\top AdV, the paper proposes to drop the non-dAdA terms, this gives a way to approximate dϕd\phi through dAdA terms only, and yields an efficient, practical algorithm that first runs mm iterations of Lanczos to generate V,TV, T, then form the GG matrix, and let W=VGW=VG, the derivative of ϕ\phi wrt θ\theta can be written as a bilinear form of wj,vjw_j, v_j wrt the derivative of A(θ)A(\theta) of θ\theta. Experiments for several functions, including u⊤log⁡(K(θ))uu^\top \log(K(\theta))u, network sensitivity and quantum Hamiltonian show the improvements over existing results.

Strengths and weaknesses

Strengths:

  • The proposed method is simple and practical, through extensive experiments, the efficiency improvements are quite significant. This is important when one wants to deploy this algorithm at scale.

  • The studied problem is important, approximating the gradient of bilinear or quadratic form of Hermitian matrix functions is a quite common use case, especially when one tries to use first-order methods to optimize this class of functions.

Weaknesses:

  • One major weakness is the numerical stability is verified only through experiments, there are no formal statements proving the numerical stability of the proposed algorithm. This also holds for most of the results in this paper, the only theoretical piece Theorem 2, as Theorem 1 follows from a straightforward calculation. Though Theorem 2 spells out the error term explicitly, it deserves more discussions on the magnitude of the error for various functions.
Questions

Typos:

  • Line 262: "We use their We run these..." should be "We run these...".

Questions:

  • Can authors give some estimates on the error term of Theorem 2 for specific pairs of (A,u)(A, u)?
Limitations

Yes.

Paper formatting concerns

N/A.

Final justification

Authors' response gives a concrete example that clarifies my question, I'll keep my initial positive rating.

Reviewer_yqqxOpenReview ↗
Rating
3
Clarity
2
Confidence
3
Originality
3
Quality
3
Significance
2
Read review
Summary

This paper proposes a forward-only method for approximating gradients of scalar bilinear forms involving functions of large Hermitian matrices. The method uses Lanczos to project the large matrix problem onto a small tridiagonal matrix, differentiates the projected objective, and then lifts the sensitivity back to the original parameters using vector-Jacobian products. The authors provide an error analysis related to the Lanczos residual and evaluate the approach on matrix-logarithm derivatives, network sensitivity benchmarks, and quantum Hamiltonian learning.

Strengths and weaknesses

Strengths

The paper addresses a relevant computational problem: differentiating scalar objectives involving functions of large Hermitian matrices. The proposed method is conceptually clean, using Lanczos to reduce the large problem to a small tridiagonal projected problem and then computing gradients through vector-Jacobian products. This avoids backpropagating through the Lanczos recurrence, which can be costly and numerically delicate. The work also provides an error decomposition related to the Lanczos residual. The experiments on matrix-logarithm derivatives, network sensitivity benchmarks, and quantum Hamiltonian learning suggest that the method can be efficient and stable in several settings.

Weaknesses

The paper’s positioning could be clearer to a machine learning audience. While the theoretical and algorithmic contribution is interesting, the paper does not fully articulate which classes of learning problems are the primary targets of the proposed approximation. The error analysis is also informative but somewhat limited, since the residual-related term does not provide a complete a priori bound.

Questions
  1. Could the authors clarify which learning problems are the main targets of the method?

  2. Could the authors provide more intuition or conditions under which the residual-related error term in Theorem 2 is small?

  3. In which regimes is the proposed method preferable to differentiating through Lanczos or using Fréchet/adjoint-based methods in terms of accuracy, stability, memory, and runtime?

Limitations

Yes

Paper formatting concerns

No concerns

Final justification

The authors have addressed most of my concerns. However, incorporating all of these changes represents substantial additional work that we as reviewers won't have the opportunity to re-review before camera-ready. I will defer to the AC to judge whether a paper in this situation is appropriate to accept as is, or whether the authors should be asked to incorporate everything and resubmit to a future venue.

Reviewer_LhHuOpenReview ↗
Rating
5
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper studies gradient computation for objectives involving bilinear or quadratic forms of Hermitian matrix functions, such as u⊤f(A(θ))vu^\top f(A(\theta))v.

Main contributions:

  • Proposes a forward-only gradient approximation that reuses the Lanczos pass instead of backpropagating through the Lanczos recurrence.
  • Derives the gradient by differentiating the small projected tridiagonal problem and lifting the sensitivity back through matrix-vector-product VJPs.
  • Proves that the error from ignoring Lanczos basis-variation terms is controlled by the final Lanczos residual coefficient βm\beta_m.
  • Shows empirically that the method is more stable than adjoint/backpropagation-based Lanczos gradients without requiring full reorthogonalization.
  • Demonstrates speed and accuracy gains on log-determinant, graph-sensitivity, and Hamiltonian-learning experiments.
Strengths and weaknesses

Strengths.

  • The paper addresses an important matrix-free gradient computation problem for objectives such as u⊤f(A(θ))uu^\top f(A(\theta))u.

  • The proposed method is simple and efficient: it avoids backpropagating through Lanczos and only differentiates the small projected tridiagonal problem.

  • The residual-based analysis is useful, showing that the ignored basis-variation term is controlled by βm\beta_m.

Weaknesses.

  • The paper is framed around bilinear forms u⊤f(A(θ))vu^\top f(A(\theta))v, but the main derivation is for quadratic forms, with bilinear forms handled indirectly.

  • The paper provides a useful residual-based approximation-error result, but the stronger numerical-stability claim is mainly empirical. A more formal finite-precision stability analysis, or a clearer characterization of failure cases, would strengthen the paper.

Questions
  • The error from ignoring basis variation is proportional to βm\beta_m, but it also involves unobserved basis-variation terms. Can the authors provide a practical a posteriori gradient-error estimate, or clarify when a small Lanczos residual reliably implies an accurate gradient?

  • How should practitioners decide between the proposed forward-only gradient, adjoint/backprop-through-Lanczos, and block-Arnoldi Fréchet-derivative methods? Are there regimes of ff, spectra of AA, or accuracy requirements where the proposed approximation is expected to be less reliable than these alternatives?

Limitations

Yes

Paper formatting concerns

No

Final justification

N/A

Comments on the paper

1 comment
Meta-review

The paper introduces a forward-only method for approximating gradients of bilinear or quadratic forms u⊤f(A(θ))vu^\top f(A(\theta))v, reusing a Lanczos decomposition rather than differentiating through the recurrence (this is technical, and looks narrow, but I believe this is relevant). It proves that the omitted basis-variation error is tied to the Lanczos residual and reports improved runtime and empirical stability on log-determinant, graph-sensitivity, and Hamiltonian-learning tasks.

On the positive side, this is a common primitive in machine learning. Moreover, the method is conceptually simple, matrix-free, and computationally efficient, with minimal overhead beyond the forward Lanczos pass. Its residual-based error decomposition is theoretically useful, and the experiments show substantial accuracy, stability, and speed advantages over existing approaches.

On the negative side, the paper does not clearly delimit the machine-learning problems or regimes where the approximation is preferable.

I am leaning towards acceptance, but I think that a positive response to the questions raised by the reviewers would finally convince all of them to accept and lead to a final paper with more impact (in particular related to relevance to ML, or "in which regimes is the proposed method preferable to differentiating through Lanczos or using Fréchet/adjoint-based methods in terms of accuracy, stability, memory, and runtime?").

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.