{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/test-time-model-adaptation-with-only-forward","title":"Test-Time Model Adaptation with Only Forward Passes","arxiv_id":"2404.01650","date":"2024-04-02","proceeding":null,"authors":["Shuaicheng Niu","Chunyan Miao","Guohao Chen","Pengcheng Wu","Peilin Zhao"],"abstract":"Test-time adaptation has proven effective in adapting a given trained model to unseen test samples with potential distribution shifts. However, in real-world scenarios, models are usually deployed on resource-limited devices, e.g., FPGAs, and are often quantized and hard-coded with non-modifiable parameters for acceleration. In light of this, existing methods are often infeasible since they heavily depend on computation-intensive backpropagation for model updating that may be not supported. To address this, we propose a test-time Forward-Optimization Adaptation (FOA) method. In FOA, we seek to solely learn a newly added prompt (as model's input) via a derivative-free covariance matrix adaptation evolution strategy. To make this strategy work stably under our online unsupervised setting, we devise a novel fitness function by measuring test-training statistic discrepancy and model prediction entropy. Moreover, we design an activation shifting scheme that directly tunes the model activations for shifted test samples, making them align with the source training domain, thereby further enhancing adaptation performance. Without using any backpropagation and altering model weights, FOA runs on quantized 8-bit ViT outperforms gradient-based TENT on full-precision 32-bit ViT, while achieving an up to 24-fold memory reduction on ImageNet-C.","url_abs":"https://arxiv.org/abs/2404.01650v2","url_pdf":"https://arxiv.org/pdf/2404.01650v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"test-time-model-adaptation-with-only-forward","repo_url":"https://github.com/mr-eggplant/foa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"test-time-adaptation","task_name":"Test-time Adaptation"},{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.01650","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.01650"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mr-eggplant/foa","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":4,"unverified":1},"by_repo_kind":{"official":{"samples":5,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"d442b8bf91400cd9","entry":"copy_model_only","repo":"mr-eggplant/foa","repo_kind":"official","path":"tta_library/foa_bp.py","file_url":"https://github.com/mr-eggplant/foa/blob/HEAD/tta_library/foa_bp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"d442b8bf91400cd9"}},{"code_sha256_prefix":"890d94991798f654","entry":"tensor_rot_180","repo":"mr-eggplant/foa","repo_kind":"official","path":"dataset/selectedRotateImageFolder.py","file_url":"https://github.com/mr-eggplant/foa/blob/HEAD/dataset/selectedRotateImageFolder.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"890d94991798f654"}},{"code_sha256_prefix":"599b8f7cc5b4ef6d","entry":"tensor_rot_270","repo":"mr-eggplant/foa","repo_kind":"official","path":"dataset/selectedRotateImageFolder.py","file_url":"https://github.com/mr-eggplant/foa/blob/HEAD/dataset/selectedRotateImageFolder.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"599b8f7cc5b4ef6d"}},{"code_sha256_prefix":"de9a9c1253646b04","entry":"tensor_rot_90","repo":"mr-eggplant/foa","repo_kind":"official","path":"dataset/selectedRotateImageFolder.py","file_url":"https://github.com/mr-eggplant/foa/blob/HEAD/dataset/selectedRotateImageFolder.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"de9a9c1253646b04"}},{"code_sha256_prefix":"7b9d88d29b50aca6","entry":"softmax_entropy","repo":"mr-eggplant/foa","repo_kind":"official","path":"tta_library/foa.py","file_url":"https://github.com/mr-eggplant/foa/blob/HEAD/tta_library/foa.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7b9d88d29b50aca6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}