Vitalverse MBZUAI

Learning Where to Adapt
Learned Subspace Test-Time Adaptation for Medical Time Series

Preprint, 2026
Adinath Dukre1,2* Sandun Herath2* Imran Razzak1,2
1Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, UAE  •  2Vitalverse
*Equal contribution
Paper (arXiv soon) Code 🤗 Model
Overview of LSTA
Figure 1. Overview of LSTA. (a) Premise: recordings from different subjects differ through a few shared factors such as gain, baseline and electrical axis (schematic; traces are illustrative, not measured data). (b) Entropy-based test-time adaptation moves every LayerNorm parameter along the model's uncertainty, whereas LSTA restricts the update of a new subject to a low-rank subspace meta-learned from past subjects. (c) Measured worst-case change in macro-F1 relative to the frozen backbone across the eight datasets; LSTA is the only method that never falls below the frozen model.

Abstract

Test-time adaptation (TTA) promises to personalize medical time series classifiers to a new subject from a few unlabeled recordings. Its standard recipe, entropy minimization over normalization parameters, follows the model's uncertainty rather than the ways in which subjects actually differ, and with few windows it can turn correct predictions into errors. We argue that where to adapt should itself be learned. Because inter-subject shift is plausibly driven by a few shared physiological and recording factors, we propose Learned Subspace Test-Time Adaptation (LSTA), which meta-learns from past subjects a low-rank space of LayerNorm updates and restricts each new subject's adaptation to it. During meta-training, unlabeled support windows determine an entropy step within this space, and the classification loss on labeled query windows from the same subject shapes it. At test time the space is fixed, the parameters outside LayerNorm remain frozen, and each subject adapts from at most eight unlabeled windows. On five EEG and ECG benchmarks with subject-exclusive splits, LSTA obtains the highest mean accuracy and macro-F1 among seven TTA baselines, and a learned subspace outperforms a random one in 22 of 25 dataset-seed pairs. Across all eight datasets we evaluate, LSTA is the only method whose macro-F1 never falls below that of the frozen model, and under contaminated support it degrades far less than direct LayerNorm adaptation and turns fewer correct predictions into errors. On clean data, its gain over direct LayerNorm adaptation is concentrated on one dataset.

Method

LSTA learns, from past subjects, the directions in which a new subject's LayerNorm parameters are allowed to move, and adapts only along them.

LSTA framework
Figure 2. (a) Learning the adaptation subspace: unlabeled support windows determine an entropy-based LayerNorm update within a shared low-dimensional space. Classification loss on separate labeled query windows trains the adaptation basis, while the pretrained source parameters remain fixed. (b) Subject-specific test-time adaptation: the learned basis is frozen, and unlabeled support windows from an unseen subject determine the LayerNorm update used to classify that subject's query windows.

Learned subspace

Inter-subject shift is plausibly driven by a few shared physiological and recording factors, so subject-specific LayerNorm updates are restricted to a shared low-rank subspace.

Meta-training

Unlabeled support windows of a training subject determine an entropy step within the subspace; the classification loss on labeled query windows from the same subject shapes it.

Test time

The subspace is fixed, all parameters outside LayerNorm stay frozen, and each new subject adapts from at most eight unlabeled windows.

Results

Macro-F1 on five subject-labeled EEG and ECG benchmarks (mean over five backbone seeds). All numbers are from the paper.

79.23
mean macro-F1 of LSTA
(frozen backbone: 74.10)
22 / 25
dataset-seed pairs where the learned subspace beats a random one
8 / 8
datasets where LSTA never falls below the frozen model
≤ 8
unlabeled windows per new subject
MethodADFTDAPAVATDBrainPTBPTB-XLMean
Frozen backbone48.44±1.7285.71±0.4992.36±1.2781.60±2.3162.39±0.3074.10
Tent52.70±3.0088.17±2.0095.14±2.0581.54±2.6364.10±0.4576.33
T3A49.95±2.6087.64±1.2892.66±1.3281.70±2.9464.44±0.4275.28
SAR50.54±3.4787.25±2.5297.18±0.5681.68±2.7163.81±0.3876.09
MemBN45.93±1.8481.05±0.7289.42±1.1772.99±3.6657.95±0.4969.47
SHOT50.73±3.2188.64±1.9494.22±1.6980.99±2.7863.97±0.4675.71
UCon51.70±3.3689.05±3.6492.92±3.3582.02±1.7264.62±0.4476.06
MedTS-TTT48.80±2.7973.15±9.2596.88±2.8673.89±4.4963.33±1.0071.21
LSTA (ours)55.32±1.8693.18±3.6098.88±0.7684.09±3.5364.66±0.5179.23
Macro-F1 (%, mean ± s.d. over five backbone seeds). All methods adapt the same frozen TeCh checkpoints with the same support draws and query windows, except MedTS-TTT, which uses its own backbone. Best in bold, second-best underlined.
VariantAPAVATDBrainPTBADFTDPTB-XLMean
Frozen Backbone85.71±0.4992.36±1.2781.60±2.3148.44±1.7262.39±0.3074.10
LN-TTA92.36±3.6898.91±0.7983.56±3.2751.42±3.7164.71±0.4578.19
LSTA93.18±3.6098.88±0.7684.09±3.5355.32±1.8664.66±0.5179.23
Random-Subspace91.07±5.9698.65±0.9881.47±4.3151.08±3.4664.06±0.4477.26
LN-TTA-Learnable92.41±3.7598.93±0.7983.60±3.2552.51±3.3964.71±0.4678.43
Test F1 (×100, mean ± s.d. over 5 seeds). Top: components added in turn. Bottom: LSTA's meta-learned rank-8 subspace replaced. Bold: best variant per column.

Robustness and Efficiency

Robustness to support contamination
Figure 3. Robustness to support contamination across six subject-labeled datasets. 0%, 25% or 50% of the support windows are replaced with windows from another subject of a different diagnostic class. Curves show mean macro-F1 across five backbone seeds and five support draws per seed. Among the plotted variants, LSTA achieves the highest macro-F1 at 50% contamination on all six datasets.
Performance and efficiency on TDBRAIN
Figure 4. Performance and efficiency on TDBRAIN. Test macro-F1 against inference time per test episode (log scale); bubble size indicates FLOPs, and the upper-left corner is better.

Appendix: Additional Analyses

Figures and tables from the paper's appendix. Click any image to open it at full resolution.

Figure 5. t-SNE of pre-classifier features on APAVA
Figure 5. t-SNE of pre-classifier features on APAVA
Figure 6. Effect of the adaptation subspace rank
Figure 6. Effect of the adaptation subspace rank
Figure 7. Effect of the number of unlabeled support windows
Figure 7. Effect of the number of unlabeled support windows
Figure 8. Effect of the number of test-time adaptation steps
Figure 8. Effect of the number of test-time adaptation steps
Figure 9. Sensitivity to the adaptation step size
Figure 9. Sensitivity to the adaptation step size
Figure 10. Robustness to test-time signal corruption
Figure 10. Robustness to test-time signal corruption
Figure 11. Distributions of LayerNorm updates
Figure 11. Distributions of LayerNorm updates
Figure 12. t-SNE of representations for the frozen backbone and adaptation methods
Figure 12. t-SNE of representations for the frozen backbone and adaptation methods
Figure 13. t-SNE of ADFTD pre-classifier features
Figure 13. t-SNE of ADFTD pre-classifier features
Table 3. Comparison with published classifiers on the five subject-labeled datasets
Table 3. Comparison with published classifiers on the five subject-labeled datasets
Table 4. Dataset summary
Table 4. Dataset summary
Table 5. Window-labeled datasets (MIT-BIH, Sleep-EDF) and HPP
Table 5. Window-labeled datasets (MIT-BIH, Sleep-EDF) and HPP
Table 6. F1 on HPP under support contamination
Table 6. F1 on HPP under support contamination
Table 7. Component ablation on HPP, MIT-BIH and Sleep-EDF
Table 7. Component ablation on HPP, MIT-BIH and Sleep-EDF
Table 8. Full comparison with TTA and source-free baselines
Table 8. Full comparison with TTA and source-free baselines

BibTeX

@article{dukre2026lsta,
  title={Learning Where to Adapt: Learned Subspace Test-Time Adaptation for Medical Time Series},
  author={Dukre, Adinath and Herath, Sandun and Razzak, Imran},
  journal={arXiv preprint},
  year={2026}
}