Introduction
While Vision Transformers (ViTs) have dominated the computer vision landscape, State Space Models (SSMs) like VMamba have recently emerged as highly efficient alternatives. They offer linear computational complexity while maintaining global receptive fields. However, despite their efficiency, SSMs struggle significantly when the data they encounter at "test-time" differs from their training data—a common issue caused by weather changes, sensor noise, or artistic style shifts.
To address this, researchers have introduced TRUST (Test-Time Refinement using Uncertainty-Guided SSM Traverses). TRUST is the first test-time adaptation (TTA) method specifically engineered for Mamba-based vision models. By leveraging the unique scanning mechanism of SSMs, it generates multiple "causal perspectives" of an image, adapts the model parameters using uncertainty-guided pseudo-labels, and averages the resulting weights to achieve state-of-the-art robustness against distribution shifts.
The Vulnerability of SSMs
The authors identify two core vulnerabilities that cause SSMs to degrade under distribution shifts:
- Fixed Traversal Bias: VMamba processes images by scanning patches in four fixed directions. This creates a strong inductive bias where the model's internal representation becomes rigidly tied to specific scanning paths.
- Hidden State Poisoning: Because SSMs are recurrent in nature, a "corrupted" patch encountered early in a scan can propagate its error through the entire hidden state sequence. This amplifies the bias and severely degrades overall performance.
The TRUST Methodology
To overcome these limitations, the authors propose turning the SSM's sequential nature into a strength.
- Traversal Permutations: Instead of relying on the default scan order, TRUST systematically generates multiple permutations of the four directional scans. This exposes the model to diverse "causal perspectives" of the exact same image.
- Uncertainty-Guided Selection: Because not all scan orders yield equally reliable features, TRUST computes the Shannon entropy of the model's predictions for different permutations. It then selects the top-K most confident (lowest entropy) paths for adaptation.
- Mamba-Specific Adaptation: The method performs self-supervised adaptation by treating the model's own predictions as pseudo-labels. Crucially, it only updates the Mamba-specific parameters (the SS2D blocks), keeping the rest of the network frozen to prevent catastrophic forgetting.
- Weight Averaging: Inspired by the concept of "flat minima," TRUST averages the adapted weights from the different traversal paths. This results in a single, consolidated model that is significantly more stable and robust than any single-path adaptation.
Key Insights
- Architecture-Aware TTA: Most existing TTA methods (like Tent or SHOT) are "black-box" approaches that minimize entropy regardless of the underlying model architecture. TRUST is the first to demonstrate that explicitly exploiting the internal dynamics of the architecture (the scan order) yields significantly better results.
- Breaking Recurrent Poisoning: By changing the scan order, a corrupted patch that appeared "early" in one scan might appear "late" in another. Averaging these diverse perspectives prevents any single artifact from dominating the model's hidden state.
- Finding Flat Minima: Weight averaging across different traversal paths helps the model converge to a smoother, lower-loss region in the weight space, which is a well-known hallmark of good generalization.
- Efficiency via Parallelism: The authors designed a parallel implementation that instantiates multiple SS2D blocks. This allows for simultaneous adaptation across paths with only a moderate memory overhead (e.g., 1.7x memory for 8 traversals).
Key Results
The authors evaluated TRUST across seven rigorous benchmarks, including robustness datasets (CIFAR10-C, CIFAR100-C, ImageNet-C) and domain generalization datasets (PACS, ImageNet-S, ImageNet-V2, ImageNet-R).
TRUST consistently outperformed existing TTA methods across all benchmarks:
- ImageNet-C: Achieved 56.1% mean accuracy, a massive 17.4% improvement over the non-adapted source model, and significantly higher than competing methods like Tent (41.7%) or SHOT (41.7%).
- CIFAR10-C: Reached 77.5% accuracy, outperforming the next best method by over 10%.
- Domain Shifts: On the ImageNet-R (Artistic renditions) dataset, TRUST improved accuracy by 13.0% over the source model, proving it handles stylistic shifts just as effectively as pixel-level noise.
- Ablation Success: The "weight averaging" component was shown to be vital. Using an ensemble of predictions (instead of weights) or simple repetitions of the same scan yielded much lower performance.
Limitations and Future Work
While TRUST excels in general computer vision benchmarks, the authors note it has not yet been tested or optimized for the medical domain. Medical imaging often involves different modalities (e.g., MRI, CT) and stricter privacy constraints that might complicate standard TTA updates.
Future work aims to adapt TRUST for these specialized settings, addressing data scarcity and the unique artifacts found in clinical data. Additionally, the authors suggest exploring how this traversal-based adaptation strategy might apply to other sequential architectures beyond Mamba.
Summary updated