---
title: 'GOLD: Online Low-rank Directional Adaptation'
url: https://www.emergentmind.com/topics/guided-online-low-rank-directional-adaptation-gold
type: topic
---

# GOLD: Online Low-rank Directional Adaptation

Guided Online Low-rank Directional Adaptation (GOLD) is a source-free continual test-time adaptation method designed for online adaptation to unlabeled data streams under distribution shift while preserving online inference efficiency and generalization. It is introduced in "The Golden Subspace: Where Efficiency Meets Generalization in Continual Test-Time Adaptation" [2603.21928]. The method is organized around the claim that effective adaptation should occur not across the full parameter space, but within a small task-relevant feature subspace that is sufficient to change predictions with minimal perturbation to the pretrained representation. The paper terms this privileged subspace the **golden subspace**, proves its existence in a single-step adaptation setting, identifies it with the row space of the pretrained classifier, and proposes an online mechanism based on sample-wise Average Gradient Outer Product (AGOP) to maintain this subspace during continual adaptation. The implementation couples a frozen backbone and classifier with a lightweight low-rank adapter, a compact scaling vector, EMA-based self-training, and prototype-based regularization; the authors also release code at the stated repository [2603.21928].

## 1. Continual test-time adaptation setting and the efficiency–generalization trade-off

The method is formulated in the setting of **Continual Test-Time Adaptation (CTTA)**, where a model pretrained on labeled source data is deployed on an unlabeled target stream
\[
\mathcal{D}_T = \{\mathcal{X}_1, \mathcal{X}_2, \ldots, \mathcal{X}_T\},
\]
with batches \(\mathcal{X}_t\) arriving sequentially from a distribution that changes over time, \(p_t(x)\neq p_{t+1}(x)\). At each step, the model predicts on the current batch and updates itself using only the current unlabeled test data, without access to source samples and without offline retraining [2603.21928].

Within this setting, the central difficulty is the **efficiency–generalization trade-off**. Updating more parameters or invoking heavier test-time mechanisms can improve short-term fitting to a new domain, but the cost is higher FLOPs, higher memory use, and greater susceptibility to error accumulation, pseudo-label noise amplification, and parameter drift. The paper characterizes this as a structural tension in CTTA: aggressive adaptation may improve immediate fit while degrading long-horizon stability as the stream evolves.

GOLD addresses this by restricting adaptation to what the paper describes as a minimal feature subspace sufficient to produce the desired output correction. In the paper’s interpretation, the golden subspace is the minimal-update subspace that yields the needed output change while preserving as much of the pretrained representation as possible. This suggests that the method is not merely a low-rank parameterization for efficiency, but a geometric constraint intended to reconcile online plasticity with representation preservation.

## 2. Golden subspace theory and the classifier row space

The theoretical analysis is given for a **single-step adaptation** setting with a linear classifier
\[
z = Wf,
\]
where \(f\in\mathbb{R}^L\) is the feature vector and \(W\in\mathbb{R}^{C\times L}\) is the classifier weight matrix [2603.21928].

Given a desired logit correction \(\Delta y\in\mathbb{R}^C\), the paper studies the minimum-norm feature perturbation
\[
\min_{\Delta f\in\mathbb{R}^L}\ \tfrac{1}{2}\|\Delta f\|_2^2
\quad\text{s.t.}\quad
W\Delta f=\Delta y.
\]
Its unique minimum-norm solution is
\[
\Delta f^\star = W^{+}\Delta y,
\]
where \(W^{+}\) is the Moore–Penrose pseudoinverse. For a batch version,
\[
\min_{\Delta F}\ \tfrac{1}{2}\|\Delta F\|_F^2
\quad\text{s.t.}\quad
W\Delta F=\Delta Y
\]
has solution
\[
\Delta F^\star = W^{+}\Delta Y.
\]
The paper also writes
\[
\Delta F^\star = \Delta Y (W^\top)^{\dagger},
\]
and notes the rank bound
\[
\operatorname{rank}(\Delta F^\star) \le \operatorname{rank}\!\big((W^\top)^{\dagger}\big) = \operatorname{rank}(W^\top W).
\]

The key linear-algebraic conclusion is that the minimum-norm solution lies in the **row space of \(W\)**, equivalently the **column space of \(W^\top\)**. In the appendix argument, stationarity of the Lagrangian gives \(\Delta f = -W^\top \lambda\), hence \(\Delta f^\star\in \operatorname{span}(W^\top)=\mathrm{row}(W)\). Under an SVD \(W=U\Sigma V^\top\),
\[
\Delta f^\star = V\Sigma^{+}U^\top \Delta y.
\]
The paper therefore identifies the golden subspace exactly with the subspace spanned by the principal right singular vectors, or eigen-directions, of the classifier and states that it “coincides with the row space of the pretrained classifier” [2603.21928].

This characterization rules out an arbitrary notion of low rank. The relevant subspace is not any compressed feature basis, but the particular set of directions already encoded by the pretrained classifier as effective for changing logits. A plausible implication is that GOLD’s low-rank structure is tied directly to predictive geometry rather than to generic dimensionality reduction.

## 3. AGOP as an online estimator of the subspace

Because directly updating \(W\) online is described as expensive and unstable, GOLD uses **sample-wise Average Gradient Outer Product (AGOP)** as a proxy for the classifier’s geometry [2603.21928].

For a sample \(i\), the gradient surrogate is
\[
g_i \;=\; \nabla_{f_i}\!\Big(\max_{c}\; h_{\psi}(f_i)_c\Big)\in\mathbb{R}^L.
\]
The mini-batch AGOP is
\[
\widehat{G}_t^{(b)} \;=\; \frac{1}{|\mathcal{M}_t|}\sum_{i\in\mathcal{M}_t} g_i g_i^\top \in\mathbb{R}^{L\times L},
\]
where
\[
\mathcal{M}_t=\{i\in[B]\mid p_{t,i}\ge\tau\}
\]
is the set of high-confidence samples in batch \(t\), \(p_{t,i}\) is the maximum softmax probability, and \(\tau\) is a confidence threshold. The online estimate is updated via exponential moving average:
\[
G_t \;=\; (1-\alpha)G_{t-1} + \alpha\,\widehat{G}_t^{(b)}.
\]
Every \(T_{\mathrm{eig}}\) batches, GOLD performs eigendecomposition
\[
G_t = Q \Lambda Q^\top,\qquad \Lambda=\operatorname{diag}(\lambda_1,\dots,\lambda_L),
\]
and selects the top-\(r\) eigenvectors
\[
V_t = [v_1,\dots,v_r]\in\mathbb{R}^{L\times r}.
\]

The paper motivates this construction through prior work on AGOP representations, stating an empirical relation of the form
\[
W_i^{(l)\top} W_i^{(l)} \propto \Bigg(\frac{1}{n}\sum_{p=1}^n \sum_{j=1}^m \nabla_{u_{ij}^{(l)}}\hat{f}(x^{(p)})\, \nabla_{u_{ij}^{(l)}}\hat{f}(x^{(p)})^\top \Bigg)^{\alpha},
\]
with \(\alpha\) often near \(1/2\). In the CTTA setting, where labels are unavailable, GOLD combines confidence-filtered pseudo-labeling and AGOP over test samples to track the same subspace online.

The paper further argues that AGOP-derived subspaces quickly align with the true golden subspace and that the AGOP spectrum is strongly low-rank: the top 64–128 eigenvectors capture over 99% of the energy in the reported experiments. This supports the operational claim that the classifier-relevant geometry can be maintained online without retraining the classifier itself.

## 4. Adapter design, projection mechanism, and learning objective

GOLD is implemented as a **lightweight adapter** attached to a frozen backbone \(g_{\phi^\ast}\) and classifier \(h_\psi\) [2603.21928]. The pretrained backbone remains frozen, and the method computes source-derived class prototypes
\[
P=[P_1,\dots,P_C]^\top\in\mathbb{R}^{C\times L},
\]
which serve as semantic anchors during test-time adaptation.

For a feature \(f\in\mathbb{R}^L\), the current golden-subspace basis \(V_t\) defines a projection
\[
u = V_t^\top f \in \mathbb{R}^r.
\]
An elementwise scaling vector \(S_t\in\mathbb{R}^r\) is then applied:
\[
\tilde{u} = (1 + S_t)\odot u.
\]
The adapted feature is produced in residual form,
\[
\mathcal{A}(f) = f + V_t(\tilde{u}-u)
= f + V_t\big( S_t \odot (V_t^\top f)\big).
\]
For a batch, the paper writes
\[
F_t^{\mathrm{adapt}} = F_t + \big(S_t\odot (F_t V_t)\big) V_t^\top.
\]

This parameterization has three properties emphasized in the paper: only a low-dimensional subspace is modified; the residual form guarantees \(\mathcal{A}(f)=f\) when \(S_t=0\); and updates are concentrated in a compact and interpretable set of directions. The trainable state is correspondingly small: the method performs a single gradient step on the scaling vector \(S_t\) and a small set of normalization parameters.

Optimization uses an EMA teacher and two losses. The **self-training consistency loss** is
\[
\mathcal{L}_{\mathrm{st}} =
\tfrac{1}{2}\,\mathrm{SCE}\big(Y_t,\,Y_t^{\mathrm{ema}}\big)
+
\tfrac{1}{2}\,\mathrm{SCE}\big(Y_t^{+},\,Y_t^{\mathrm{ema}}\big),
\]
where \(Y_t\) are student logits on the current batch, \(Y_t^+\) are logits on an augmented view, and \(Y_t^{\mathrm{ema}}\) are teacher logits. The **prototype-based contrastive loss** selects the nearest source prototype \(k(i)\) for each sample by cosine similarity and uses
\[
\mathcal{L}_{\mathrm{cont}} =
-\frac{1}{2|\mathcal{B}|}\sum_{i\in\mathcal{B}}
\Bigg[
\log\frac{\exp\big(\mathrm{sim}(f_i,P_{k(i)})/\kappa\big)}
{\sum_{c}\exp\big(\mathrm{sim}(f_i,P_c)/\kappa\big)}
+
\log\frac{\exp\big(\mathrm{sim}(f_i^{+},P_{k(i)})/\kappa\big)}
{\sum_{c}\exp\big(\mathrm{sim}(f_i^{+},P_c)/\kappa\big)}
\Bigg],
\]
with
\[
\mathrm{sim}(u,v)=\frac{u^\top v}{\|u\|\|v\|}
\]
and temperature \(\kappa>0\). The total objective is
\[
\mathcal{L} = \lambda_{\mathrm{trg}}\mathcal{L}_{\mathrm{st}} + \lambda_{\mathrm{cont}}\mathcal{L}_{\mathrm{cont}}.
\]

The golden subspace itself is updated online by initializing \(G_0 = W^\top W\), updating \(G_t\) with AGOP from high-confidence samples, and periodically recomputing \(V_t\) via eigendecomposition. This yields a subspace that begins from classifier geometry and gradually incorporates target-domain semantics without classifier retraining.

## 5. Empirical evaluation across classification and segmentation

The paper evaluates GOLD on standard CTTA corruption benchmarks—**CIFAR10-C**, **CIFAR100-C**, and **ImageNet-C**—each containing 15 corruption types at severity level 5, with online one-pass adaptation over the stream. Source backbones include WideResNet-28, ResNeXt-29, and ResNet-50 [2603.21928].

On these classification benchmarks, GOLD reports the best average error on all three datasets:
- **CIFAR10-C:** 14.1%
- **CIFAR100-C:** 28.6%
- **ImageNet-C:** 59.3%

The paper states that these results outperform baselines including TENT, Ada, CoTTA, RMT, DSS, EATA, SAR, BeCoTTA, SANTA, and OBAO, with especially notable gains on harder corruptions and on the more challenging CIFAR100-C and ImageNet-C settings.

For segmentation, the evaluation uses **CarlaTTA**, a gradual semantic segmentation benchmark based on CARLA, with five sequences: **day2night**, **clear2fog**, **clear2rain**, **dynamic**, and **highway**. GOLD achieves the best mIoU on three of the five sequences and is described as especially strong on the difficult **highway** setting, where both covariate shift and label distribution shift appear.

The paper also emphasizes long-term stability. It reports that GOLD remains well-aligned with the true golden subspace as adaptation progresses, maintains performance under repeated domain exposure, and achieves the best error rate in a 10-round long-term CIFAR10-C experiment:
- **10-round long-term CIFAR10-C:** 14.15%

Relative to CoTTA, RMT, BeCoTTA, SANTA, EATA, SAR, and ViDA in that experiment, the method is presented as combining short-horizon accuracy with more stable long-horizon generalization.

## 6. Efficiency profile, ablations, and stated limitations

A defining feature of GOLD is its lightweight adaptation profile. The reported efficiency figures are:
- **trainable parameter ratio:** 0.373%
- **FLOPs:** 1425.14G
- **peak GPU memory:** 5.37 GB

The paper further reports runtime around 0.25 seconds per batch and states that AGOP plus periodic eigendecomposition add only modest overhead [2603.21928]. It positions this efficiency as close to, or only slightly above, other adapter-based methods such as SANTA, while remaining much cheaper than full-model update methods such as CoTTA.

Ablation results support the individual components of the method. The paper states that initializing with \(W^\top W\) improves over having no subspace projection; AGOP-based online updates further improve or stabilize long-term adaptation; the prototype contrastive loss helps preserve source semantics and reduce drift; and the full method combining \(W^\top W\) initialization, AGOP, and \(\mathcal{L}_{\mathrm{cont}}\) performs best.

The practical interpretation advanced by the paper is that GOLD improves both efficiency and generalization because it updates only the directions that matter most for changing predictions. Its rationale is distributed across several elements: the subspace is theoretically justified by the classifier’s row space; AGOP allows that subspace to track target-domain evolution without retraining the classifier; the adapter is low-rank and residual, which minimizes drift; and prototype anchoring together with EMA consistency reduces noisy pseudo-label effects.

The authors also identify several assumptions and possible limitations. The theoretical argument treats the classifier as linear in the final feature space. The golden subspace is estimated from high-confidence pseudo-labels, so extremely noisy confidence estimates could degrade AGOP quality. The method assumes that enough confident samples arrive over time to estimate AGOP reliably. Periodic eigendecomposition, while efficient in the reported setting, still introduces overhead. The paper also notes that its strongest justification is for CTTA with a frozen backbone and lightweight adaptation; if the domain shift is so large that the pretrained feature space is severely misaligned, a small subspace adapter may be insufficient.

Taken together, these points define GOLD as a structured, low-rank feature adaptation framework for CTTA in which adaptation is constrained to a classifier-governed subspace and updated online through AGOP. A plausible implication is that the method reframes the usual CTTA design question—from how much of the model to update to which feature directions are minimally sufficient for prediction-preserving adaptation.

Source: https://www.emergentmind.com/topics/guided-online-low-rank-directional-adaptation-gold