arXiv:2611.12242cs.LGNov 2026

Manuscript Offprint

arXiv:2611.12242

Controlling Temporal Pseudo-Label Marginals for Stable Online Test-Time Adaptation

Rani Amar, Ofir Lindenbaum

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Continual Test-Time Adaptation (CTTA) methods update models online using a stream of unlabeled data to overcome distribution shifts encountered at test time. However, CTTA is often unstable, as it can reinforce biases in early predictions and increasingly predict only a few classes, resulting in drift or even collapse. In this paper, we identify narrowing pseudo-label class usage as an indicator of CTTA instability and quantify this behavior. Most existing methods have attempted to address this issue by either selecting reliable adaptation samples or re-weighting the loss to encourage diverse pseudo-labels, but they do not explicitly enforce a class marginal over a temporal window. Instead, we propose Sinkhorn Class-Marginal Regularization (SCALAR), a simple plug-and-play module that controls the pseudo-label distribution over a short temporal window. SCALAR works by maintaining recent predictions in a buffer, balancing their class distribution via the Sinkhorn algorithm to match a specified target distribution, and using the balanced soft targets for adaptation. Without changing the model architecture, SCALAR maintains the per-step runtime and increases the peak allocated GPU memory by only 10 MB on ImageNet-C. Our method is particularly effective on skewed, non-stationary data with severe distribution shifts, where SCALAR significantly alleviates drift and collapse when combined with existing stabilization methods based on entropy or diversity. Code is available at https://github.com/r-isr/SCALAR.

1 Introduction

Continual test-time adaptation (CTTA) assumes a deployment setting where a model must continuously adapt at test time under non-stationary conditions.

In CTTA, models must adapt online to a stream of unlabeled test samples that may differ in distribution from the training data and may change over time, without access to the source data [32]. Typically, CTTA methods adopt a teacher–student framework where an exponential moving average (EMA) of the student parameters defines the teacher model, which generates pseudo-labels for each batch. The student is updated online using these pseudo-labels as supervision [32, 10, 34, 23, 22]. Other methods such as TENT [31] minimize an entropy objective to directly update the BatchNorm affine parameters of a single model.

In both settings, the adaptation signal is driven by the model's own predictions. Small biases can cause the adaptation signal to focus on fewer classes even in approximately balanced data streams due to the self-training effect. This can cause the pseudo-label distribution to become less diverse and eventually collapse to a small subset of classes. The CTTA community has observed two failure modes: (1) error accumulation during test-time adaptation, ranging from drift (gradual accumulation of errors) to collapse (rapid accumulation of errors), and (2) forgetting of the model's accuracy on

Preprint.

clean data after adapting on corrupted data [32, 34, 15]. Existing CTTA methods attempt to mitigate temporal instabilities by modifying local model updates. These include filtering out potentially unreliable predictions [25, 26], promoting pseudo-label diversity [33], adding regularization to prevent the test-time model from deviating too far from the source model [25, 24], and reducing temporal correlation in adaptation batches using a memory bank [15, 34]. However, they do not explicitly project window-level pseudo-label class marginals toward a specified target.

We aim to control the temporal class marginals of the pseudo-labels, which form the supervision signal in CTTA. We propose Sinkhorn Class-Marginal Regularization (SCALAR), a lightweight intervention to mitigate the marginal contraction that can contribute to test-time collapse.

Concretely, SCALAR maintains a short first-in-first-out (FIFO) queue of recent teacher logits and balances their class marginals over this window using the Sinkhorn–Knopp algorithm. This generates soft labels by rescaling teacher predictions so their class marginals over the window are close to a user-specified target prior (uniform by default). This procedure approximates a constrained KL projection of teacher predictions to satisfy a desired temporal class marginal [28, 9].

SCALAR is not intended to recover the test-time class prior but to stabilize the supervision signal observed by the student. While providing the correct class prior can reduce corruption errors, SCALAR with a uniform prior still provides substantial stabilization even in skewed settings. However, SCALAR with a uniform prior can slightly hinder the model's ability to specialize to target classes if the target distribution consists of only a subset of source classes and the model is already stably adapting to them.

We find SCALAR's stabilization benefit is highly state-dependent: when class usage is stable, SCALAR often has a smaller effect. But as class usage contracts and errors increase, SCALAR can counteract this contraction. We evaluate this behavior across balanced and skewed streams, fixed and dynamic skew schedules, different adaptation speeds, both teacher–student and entropy minimization settings, and backbone architectures like ViT-B and ResNet-50.

Since SCALAR is a window-level intervention, it complements other methods that stabilize updates on a per-sample (e.g., filtering, loss weighting) or per-parameter level (regularization). We demonstrate SCALAR's complementarity to the EATA method [25], which uses an entropy- and diversity-aware, history-dependent approach to select samples for updating. Despite adaptive sample selection, EATA does not explicitly constrain class marginals of the supervision signal. Applying SCALAR on top of EATA further reduces drift and mitigates collapse.

Contributions. Our contributions are threefold:

  • Temporal control of pseudo-labels. We propose SCALAR, which uses Sinkhorn balancing over a short queue of recent predictions to bring their class marginals close to a specified target prior.

  • When SCALAR helps. We track the effective number of pseudo-label classes to study when marginal balancing reduces drift and collapse. We also show that a uniform prior can hinder specialization when only a subset of source classes is present, and adaptation is already stable.

  • Stabilization across adaptation methods. We show that SCALAR reduces drift and collapse under skewed streams and aggressive adaptation in both teacher–student and entropy-minimization settings, including EATA. Our ImageNet-C measurements show no measurable increase in runtime and a 10 MB increase in peak allocated GPU memory.

References (33)