---
title: 'Dynamic Trace Estimation: Adaptive Matrix Tracking'
url: https://www.emergentmind.com/topics/dynamic-trace-estimation
type: topic
---

# Dynamic Trace Estimation: Adaptive Matrix Tracking

to=arxiv_search.search  天天送json
{"query":"Dynamic Trace Estimation 2110.13752 Optimal Query Complexities for Dynamic Trace Estimation 2209.15219 stochastic trace estimation parameter-dependent matrices 2502.18626", "max_results": 10}
to=arxiv_search.search  诺果json
{"query":"Estimation of matrix trace using machine learning 1606.05560 On Symmetric Lanczos Quadrature for Trace Estimation 2504.18913", "max_results": 10}
Dynamic trace estimation is the dynamic version of implicit trace estimation: given matrix-vector product access to a matrix that changes over time, the objective is to maintain accurate approximations of its trace with substantially fewer oracle calls than re-running a static estimator at every snapshot. In the canonical formulation, one observes a sequence \(A_1,\dots,A_m\in\mathbb{R}^{n\times n}\), accessible only through matrix-vector multiplications, and seeks estimates \(t_1,\dots,t_m\) for \(\operatorname{tr}(A_i)\) under explicit \(\epsilon\)-accuracy and \(\delta\)-failure guarantees. The central methodological idea is to exploit temporal smoothness—typically a bound on \(\|A_{i+1}-A_i\|\)—so that trace information from earlier matrices can be reused rather than discarded [2110.13752][2209.15219].

## 1. Canonical formulation and oracle model

The basic dynamic problem is posed for a matrix sequence
\[
A_1,A_2,\dots,A_m\in\mathbb{R}^{n\times n},
\]
with access restricted to a matrix-vector product oracle. In one representative formulation, the target is to output \(t_i\) such that
\[
\Pr\big[|t_i-\operatorname{tr}(A_i)|\ge \epsilon\big]\le \delta,
\]
under the assumptions
\[
\|A_i\|_F\le 1,\qquad \|A_{i+1}-A_i\|_F\le \alpha .
\]
Here \(\alpha\) quantifies temporal drift, and the cost metric is the number of oracle calls \(A_i x\) [2110.13752].

A second formulation replaces the Frobenius-norm smoothness condition by a Schatten-norm condition. In particular, for matrices satisfying
\[
\|A_{i+1}-A_i\|_{S_1}\le \alpha,
\]
or more generally \(\|A_{i+1}-A_i\|_{S_p}\le \alpha\) for \(p\in[1,2]\), the objective remains simultaneous additive \(\epsilon\)-accurate trace estimation over the whole sequence, again using only matrix-vector queries [2209.15219].

These formulations are motivated by matrix-free settings in which explicit matrix entries are unavailable or unaffordable. The trace is then a hidden scalar functional extracted indirectly from quadratic forms or low-rank sketches. This setting includes Hessian analysis during neural-network optimization, graph quantities such as triangle counts and natural connectivity, and parameterized matrix-function traces arising in spectral density approximation [2110.13752][2502.18626].

## 2. Static estimators as the foundation

Dynamic methods are built on static stochastic trace estimation. The classical baseline is Hutchinson’s estimator,
\[
h_\ell(A)=\frac{1}{\ell}\sum_{i=1}^{\ell} g_i^T(A g_i),
\]
with Rademacher probes \(g_i\). It is unbiased,
\[
\mathbb{E}[h_\ell(A)]=\operatorname{tr}(A),
\]
and satisfies
\[
\operatorname{Var}[h_\ell(A)] = \frac{2}{\ell}\left(\|A\|_F^2-\sum_{i=1}^n A_{ii}^2\right)\le \frac{2}{\ell}\|A\|_F^2.
\]
Applied independently to every \(A_i\), this yields a naive dynamic cost of
\[
O\!\left(m\cdot \frac{\log(1/\delta)}{\epsilon^2}\right)
\]
matrix-vector products [2110.13752].

Several static works show how strongly this cost can depend on exploitable structure. A machine-learned trace estimator replaces Hutchinson’s random probes by a small learned set of probing vectors \(\{\mathbf p_l\}_{l=1}^{N_p}\), trained over a collection of structurally similar matrices by minimizing squared trace-estimation error. In numerical experiments on random matrices, \(\mathcal{O}(10)\) learned probing vectors achieved precision similar to \(\mathcal{O}(10000)\) random noise vectors, and about \(30\) probing vectors gave accuracy comparable to Hutchinson with \(20000\)–\(30000\) random noise vectors [1606.05560].

This suggests a useful conceptual distinction. Static methods already exploit cross-instance regularity—shared sparsity, spectral structure, or learned families of matrices—whereas dynamic trace estimation exploits temporal regularity across a sequence. The underlying principle is the same: redundancy in the target family should be converted into fewer matrix-vector products.

## 3. Recursive dynamic estimators and variance control

A direct incremental identity,
\[
\operatorname{tr}(A_j)=\operatorname{tr}(A_{j-1})+\operatorname{tr}(A_j-A_{j-1}),
\]
suggests estimating only the trace of changes. The difficulty is drift: repeatedly adding noisy difference estimates causes error accumulation. The main practical resolution is the damped recursive estimator **DeltaShift**, defined through
\[
\widehat{\Delta}_j = A_j-(1-\gamma)A_{j-1},
\qquad
t_j=(1-\gamma)t_{j-1}+h_\ell(\widehat{\Delta}_j),
\]
with a damping parameter \(0\le \gamma<1\) [2110.13752].

The role of damping is explicit. Multiplying the previous estimate by \((1-\gamma)\) shrinks older noise, stabilizes the recursion, and balances carried-forward variance against the variance of the fresh correction term. In the theoretical analysis, setting \(\gamma=\alpha\) yields
\[
\|\widehat{\Delta}_j\|_F\le \|A_j-A_{j-1}\|_F+\gamma\|A_{j-1}\|_F\le 2\alpha,
\]
so Hutchinson applied to \(\widehat{\Delta}_j\) has variance on the order of \(\alpha^2/\ell\) rather than the scale of the full matrix [2110.13752].

The main complexity theorem states that DeltaShift solves the dynamic trace estimation problem with
\[
O\!\left(m\cdot \frac{\alpha\log(1/\delta)}{\epsilon^2}+\frac{\log(1/\delta)}{\epsilon^2}\right)
\]
total matrix-vector multiplications. In the natural regime \(\alpha=O(\epsilon)\), the average per-step cost becomes
\[
O\!\left(\frac{\log(1/\delta)}{\epsilon}\right),
\]
whereas independent Hutchinson requires
\[
O\!\left(\frac{\log(1/\delta)}{\epsilon^2}\right)
\]
per step. The paper identifies this as a quadratic improvement in \(\epsilon\) [2110.13752].

The same work also studies a stronger setting with bounded nuclear norm and a Hutch++-based variant. There the static variance bound
\[
\operatorname{Var}[h_\ell^{++}(A)]\le \frac{16}{\ell^2}\|A\|_*^2
\]
permits a stronger dynamic algorithm. A plausible implication is that dynamic trace estimation becomes especially favorable when the evolving matrices or updates are near-low-rank [2110.13752].

## 4. Optimal query complexity and adaptive path length

The first optimal-complexity treatment organizes the sequence into blocks and estimates a hierarchy of trace differences by a binary-tree summation procedure. For a block \(A_1,\dots,A_s\), the algorithm estimates \(\operatorname{tr}(A_1)\), adjacent differences, and then longer-range differences at scales \(2^\ell\). Because a difference spanning \(2^\ell\) steps satisfies
\[
\|A_{2^\ell k}-A_{2^\ell(k-1)}\|_{S_p}\le 2^\ell \alpha,
\]
the estimator allocates accuracy level by level and reconstructs each \(\operatorname{tr}(A_i)\) from only \(O(\log s)\) tree nodes [2209.15219].

Under the Schatten-\(1\) condition, this yields query complexity
\[
\widetilde{O}\left(\frac{m\alpha\sqrt{\log(1/\delta)}}{\epsilon}+m\log(1/\delta)\right),
\]
and more generally, for \(p\in[1,2]\),
\[
\widetilde{O}\left(m\alpha\left(\frac{\sqrt{\log(1/\delta)}}{\epsilon}\right)^p+m\log(1/\delta)\right).
\]
The same paper proves matching lower bounds in all relevant parameters, including failure probability, and gives the first unconditional lower bounds for dynamic trace estimation. It also establishes tight static lower bounds for Hutchinson’s estimator in the matrix-vector product model with Frobenius-norm error [2209.15219].

A subsequent general framework replaces worst-case dependence on \(\max_i \alpha_i\) by a path-length-style dependence on
\[
\sum_{i=1}^m \alpha_i .
\]
Its adaptive residual-reuse update is
\[
u_t=v_t-(1-\gamma_t)v_{t-1},\qquad
L_t=(1-\gamma_t)L_{t-1}+\widehat L(u_t,k_t),
\]
with \(\gamma_t=\min(1,\alpha_t)\) and local budget \(k_t\) chosen as a function of the current step size. The resulting complexity scales like
\[
\mathcal O\!\left(\sum_{i=1}^m \alpha_i\right)
\]
rather than \(\mathcal O(m\cdot \max_i\alpha_i)\), which is sharper for sequences that are mostly stable but contain rare bursts [2606.23655].

The same framework also treats unknown step sizes. In the matrix case, \(\alpha_t=\|A_t-A_{t-1}\|_F\) is estimated on the fly by applying Hutchinson to
\[
M_t=(A_t-A_{t-1})^\top(A_t-A_{t-1}),
\qquad
\alpha_t^2=\operatorname{tr}(M_t),
\]
with only \(O(\log(m/\delta))\) extra queries per step for a constant-factor estimate. The paper emphasizes that, in certain cases, change magnitudes can be estimated with nearly no added cost [2606.23655].

## 5. Parameter-dependent matrices, matrix functions, and online monitoring

Dynamic trace estimation also appears in parameter-dependent settings. For a continuous family
\[
B(t)\in\mathbb{R}^{n\times n},\qquad t\in[a,b],
\]
one often needs \(\operatorname{Trace}(B(t))\) for many \(t\)-values. A recent approach modifies the Girard-Hutchinson, Nyström, and Nyström++ estimators by using the same random vectors for every \(t\). This “constant randomization” makes it possible to reuse matrix-vector products across parameter values, especially when \(B(t)\) is itself approximated by a Chebyshev expansion in \(t\), and the analysis shows that the loss of stochastic independence across different \(t\) does not lead to deterioration [2502.18626].

For spectral density approximation, the target has the form
\[
\phi_\sigma(t)=\frac{1}{n}\operatorname{Trace}(g_\sigma(tI-A)).
\]
The proposed method combines constant randomization with the Chebyshev recurrence
\[
T_0(A)=I,\qquad T_1(A)=A,\qquad T_\ell(A)=2AT_{\ell-1}(A)-T_{\ell-2}(A),
\]
so that sketches such as \(\Omega^\top T_\ell(A)\Omega\) are computed once and then reused for every \(t\). The key theoretical statement is that Nyström++ with constant randomization achieves \(n_\Omega=n_\Psi=\mathcal{O}(\varepsilon^{-1}\log(\delta^{-1}))\), independent of low-rank properties of \(B(t)\) [2502.18626].

A distinct online formulation appears in neural-network training, where the target is the trace of each layer’s diagonal Hessian block,
\[
T_\ell=\operatorname{tr}(H_\ell).
\]
A stochastic estimator combines Hutchinson probes with a single full-network Hessian-vector product, so that one backward-type pass per probe yields unbiased estimates for all layers simultaneously. The estimator’s conditional variance is
\[
\operatorname{Var}\!\bigl(\hat T_\ell\,|\,H_\ell\bigr)=\frac{2}{K}\left(\|H_\ell\|_F^2-\sum_{i=1}^{P_\ell}(H_\ell)_{ii}^2\right),
\]
and the total variance decomposes into probe noise plus mini-batch noise, yielding a critical probe count \(K_\ell^\ast\). The practical recommendation is \(K\in[5,10]\) for online monitoring [2605.25674].

These examples broaden the subject without collapsing its distinctions. In the core literature, “dynamic” refers to evolving matrices over time; in parameter-dependent problems it refers to reuse across a continuum of \(t\)-values; in training diagnostics it refers to repeated online estimation during optimization.

## 6. Applications, neighboring methods, and conceptual boundaries

The earliest dynamic-trace applications emphasize three domains. For neural-network optimization, traces of Chebyshev polynomials of the Hessian are used to track moments of the Hessian spectral density. For dynamic graphs, triangle counting relies on
\[
\#\text{triangles}=\frac{1}{6}\operatorname{tr}(B^3),
\]
while natural connectivity depends on \(\operatorname{tr}(\exp(B))\). Across these applications, damped dynamic estimators achieved lower error or better error-versus-cost tradeoffs than Hutchinson, simple incremental updates, or periodic restarts [2110.13752].

Recent work on stochastic Lanczos quadrature addresses a complementary issue: when trace estimation of \(\operatorname{tr}(f(A))\) is built from quadratic forms approximated by Lanczos-Gauss rules, symmetric quadrature nodes and weights can lower iteration counts. For Jordan-Wielandt matrices, carefully chosen initial vectors guarantee symmetric quadrature and yield unbiased trace estimators for Estrada index computation in bipartite and directed graphs [2504.18913].

Several neighboring methods are dynamic-friendly but not dynamic in the strict sequence-update sense. FlexTrace is a single-pass, exchangeable randomized estimator for \(\operatorname{tr}(f(\mathbf A))\) that uses only matvecs with \(\mathbf A\). The paper explicitly states that it is about static trace estimation of matrix functions and does not address updating the estimate under matrix changes over time, although its single-pass and function-agnostic properties are close in spirit to streaming constraints [2603.05721].

This terminological boundary matters. Dynamic trace estimation is not simply “Hutchinson on differences,” because error accumulation makes damping or multiscale summation essential. Nor is every adaptive trace estimator dynamic: learned probing vectors, single-pass matrix-function sketches, and variational trace-related estimators can exploit structure without maintaining a stateful estimate across a changing target. The common thread is matrix-free access and aggressive reuse of information; the defining feature of the dynamic problem is that the reuse is indexed by change in the target itself [2110.13752][2603.05721].

The main limitation is equally consistent across the literature. Dynamic gains require stable structure: small \(\alpha\), representative training families, or smoothly parameterized operators. When updates are large, when the structure shifts abruptly, or when training labels or trace surrogates are too noisy, the advantage over static re-estimation narrows. The lower-bound results show that, under the standard matrix-vector product model, the leading dependence on \(m\), \(\alpha\), \(\epsilon\), and \(\delta\) is essentially settled up to polylogarithmic factors [2209.15219].

Source: https://www.emergentmind.com/topics/dynamic-trace-estimation