Papers › Distribution Alignment for Fully Test-Time Adaptation with Dynamic Online Data Streams

Distribution Alignment for Fully Test-Time Adaptation with Dynamic Online Data Streams

16 Jul 2024arXiv:2407.12128archive 2025-07-28

Ziqiang Wang, Zhixiang Chi, Yanan Wu, Li Gu, Zhi Liu, Konstantinos Plataniotis, Yang Wang

Given a model trained on source data, Test-Time Adaptation (TTA) enables adaptation and inference in test data streams with domain shifts from the source. Current methods predominantly optimize the model for each incoming test data batch using self-training loss. While these methods yield commendable results in ideal test data streams, where batches are independently and identically sampled from the target distribution, they falter under more practical test data streams that are not independent and identically distributed (non-i.i.d.). The data batches in a non-i.i.d. stream display prominent label shifts relative to each other. It leads to conflicting optimization objectives among batches during the TTA process. Given the inherent risks of adapting the source model to unpredictable test-time distributions, we reverse the adaptation process and propose a novel Distribution Alignment loss for TTA. This loss guides the distributions of test-time features back towards the source distributions, which ensures compatibility with the well-trained source model and eliminates the pitfalls associated with conflicting optimization objectives. Moreover, we devise a domain shift detection mechanism to extend the success of our proposed TTA method in the continual domain shift scenarios. Our extensive experiments validate the logic and efficacy of our method. On six benchmark datasets, we surpass existing methods in non-i.i.d. scenarios and maintain competitive performance under the ideal i.i.d. assumption.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 17 code samples harvested from 1 repository linked to this paper: 13 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 0 violated, 3 with no contract checked; 9 where Syntology's instrument failed) · 4 unverified. Where Syntology's instrument failed: 5 where our contract draft was wrong; 4 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 17 samples from 1 repository, 13 ran (4 with no instrument failure; 9 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 13 samples that ran has no recorded date.

WZq975/DA-TTA officialmentioned on GitHubpytorchMITSyntology: 17 samples, 13 ran (9 instrument-failed) · 4 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested: 13 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 0 violated, 3 with no contract checked; 9 where Syntology's instrument failed) · 4 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
5ran · our draft was wrong
4ran; the contract check could not run
3ran
4unverified

Licence: 3 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. For 3 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from WZq975/DA-TTA. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

WZq975/DA-TTA official repository 17 samples, 13 ran (9 instrument-failed) · 4 unverified
complete_data_dir_path in 9 papers conf.py ran · our draft was wrong MIT (permissive) · 00900164f55d3e7c · report fixture: signature root:str/0/str, dataset_name:str/0/str · returned str · level recorded 2026-09-24
create_file_list in 10 papers datasets/imagenet_subsets.py ran MIT (permissive) · ae33aa95d68dffd6 · report fixture: signature imagenet_root:str/0/str, imagenet_class_dirs:list/1/str, split:str/0/str · returned list · level recorded 2026-09-24
entropy_energy in 7 papers methods/lame.py ran · our draft was wrong fingerprinted MIT (permissive) · 473a24407468b75e · report fixture: signature Y:Tensor/2/float, unary:Tensor/2/float, pairwise:Tensor/2/float, bound_lambda:float/0/float · returned Tensor · level recorded 2026-09-24
get_num_classes in 26 papers conf.py ran · honoured contract MIT (permissive) · ad7ee34b3774e46a · report fixture: signature dataset_name:str/0/str · returned int · level recorded 2026-09-24
marginal_entropy in 5 papers methods/memo.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 8a657c2641647a46 · report fixture: signature outputs:Tensor/2/float · returned tuple · level recorded 2026-09-26
softmax_entropy in 54 papers
census: 18 implementations from 29 papers, 4 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 1 of 2, arg 1: rank 2, kind float, dtype float32
methods/datta.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant MIT (permissive) here; the stored copy is pointer only · 3078648c75e3e1e3 · report fixture: returned Tensor · level recorded, date not recorded
softmax_entropy in 54 papers
census: 18 implementations from 29 papers, 4 distinct outputs across 2 buckets, one shared input per bucket
methods/eata.py ran; the contract check could not run (RAISES) MIT (permissive) · 7b9d88d29b50aca6 · report fixture: returned Tensor · level recorded 2026-09-26
softmax_entropy_cifar in 7 papers methods/cotta.py ran; the contract check could not run (RAISES) MIT (permissive) · f0cf18b3022925f3 · report fixture: returned Tensor · level recorded 2026-09-24
softmax_entropy_imagenet in 7 papers methods/cotta.py ran; the contract check could not run (RAISES) MIT (permissive) · e2785d59d7e26ba2 · report fixture: returned Tensor · level recorded 2026-09-24
stat_loss methods/datta.py ran MIT (permissive) · 155e6f06ad63c237 · report fixture: signature stat:list/1/tuple, source_stat:dict/0/? · returned Tensor · level recorded 2026-09-24
tta methods/memo.py ran MIT (permissive) · eaa0b5d0d74c3ab3 · report fixture: signature image:Tensor/4/float, n_augmentations:int/0/int, aug:callable/0/? · returned Tensor · level recorded 2026-09-24
update_ema_variables in 17 papers methods/cotta.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · a77d556c0aea19c1 · report fixture: signature ema_model:callable/0/?, model:callable/0/?, alpha_teacher:float/0/float · returned SimpleModel · level recorded 2026-09-22
update_model_probs in 12 papers
census: 4 implementations from 5 papers, 3 distinct outputs across 3 buckets, one shared input per bucket
methods/eata.py ran · our draft was wrong fingerprinted MIT (permissive) · 182d3657a9eebb0d · report fixture: signature current_model_probs:Tensor/1/float, new_probs:Tensor/2/float · returned Tensor · level recorded 2026-09-26
batch_norm in 46 papers methods/datta.py unverified MIT (permissive) · fae69c4390cf3b2c · report
create_imagenet_subset in 8 papers datasets/imagenet_subsets.py unverified MIT (permissive) · 04cb16a031d4e8b2 · report
get_domain_sequence conf.py unverified MIT (permissive) · cfc577ab97377255 · report
laplacian_optimization in 6 papers methods/lame.py unverified MIT (permissive) · d2597d43cbd2fbca · report

Tasks

Test-time Adaptation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections