{"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/tea-test-time-energy-adaptation","title":"TEA: Test-time Energy Adaptation","arxiv_id":"2311.14402","date":"2023-11-24","proceeding":"CVPR 2024 1","authors":["Yige Yuan","Bingbing Xu","Liang Hou","Fei Sun","HuaWei Shen","Xueqi Cheng"],"abstract":"Test-time adaptation (TTA) aims to improve model generalizability when test data diverges from training distribution, offering the distinct advantage of not requiring access to training data and processes, especially valuable in the context of large pre-trained models. However, current TTA methods fail to address the fundamental issue: covariate shift, i.e., the decreased generalizability can be attributed to the model's reliance on the marginal distribution of the training data, which may impair model calibration and introduce confirmation bias. To address this, we propose a novel energy-based perspective, enhancing the model's perception of target data distributions without requiring access to training data or processes. Building on this perspective, we introduce $\\textbf{T}$est-time $\\textbf{E}$nergy $\\textbf{A}$daptation ($\\textbf{TEA}$), which transforms the trained classifier into an energy-based model and aligns the model's distribution with the test data's, enhancing its ability to perceive test distributions and thus improving overall generalizability. Extensive experiments across multiple tasks, benchmarks and architectures demonstrate TEA's superior generalization performance against state-of-the-art methods. Further in-depth analyses reveal that TEA can equip the model with a comprehensive perception of test distribution, ultimately paving the way toward improved generalization and calibration.","url_abs":"https://arxiv.org/abs/2311.14402v2","url_pdf":"https://arxiv.org/pdf/2311.14402v2.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":"tea-test-time-energy-adaptation","repo_url":"https://github.com/yuanyige/tea","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"test-time-adaptation","task_name":"Test-time Adaptation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.14402","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.14402"}},"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/yuanyige/tea","reach":{"status":"ok"}}],"summary":{"ran":13,"ran_draft_wrong":1,"ran_fixture":1,"unverified":5},"by_repo_kind":{"official":{"samples":20,"ran":15,"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":20,"samples":[{"code_sha256_prefix":"a784a511d03ebe30","entry":"collect_params","repo":"yuanyige/tea","repo_kind":"official","path":"core/param.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/param.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a784a511d03ebe30"}},{"code_sha256_prefix":"c5f915703f30ab89","entry":"collect_stats","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/norm.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/norm.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c5f915703f30ab89"}},{"code_sha256_prefix":"8f537ee8d4a9b397","entry":"configure_model","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/norm.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/norm.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8f537ee8d4a9b397"}},{"code_sha256_prefix":"16a89171a04c1ac1","entry":"configure_model","repo":"yuanyige/tea","repo_kind":"official","path":"core/param.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/param.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"16a89171a04c1ac1"}},{"code_sha256_prefix":"d203451c6493f65d","entry":"copy_model_and_optimizer","repo":"yuanyige/tea","repo_kind":"official","path":"core/param.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/param.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d203451c6493f65d"}},{"code_sha256_prefix":"611482e1142a774f","entry":"forward_and_adapt_eata","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/eata.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/eata.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"611482e1142a774f"}},{"code_sha256_prefix":"b16160c62f8cd37e","entry":"forward_and_adapt_sar","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/sar.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/sar.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b16160c62f8cd37e"}},{"code_sha256_prefix":"fd187d75df206ce0","entry":"init_random","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/energy.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fd187d75df206ce0"}},{"code_sha256_prefix":"79f439c0ef7cb476","entry":"load_tin200","repo":"yuanyige/tea","repo_kind":"official","path":"core/data.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"79f439c0ef7cb476"}},{"code_sha256_prefix":"be1107d08d25a5b0","entry":"sample_p_0","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/energy.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"be1107d08d25a5b0"}},{"code_sha256_prefix":"c7bb6b60a3ef4df5","entry":"sample_q","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/energy.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c7bb6b60a3ef4df5"}},{"code_sha256_prefix":"e0b98f11d30aba61","entry":"set_transform","repo":"yuanyige/tea","repo_kind":"official","path":"core/data.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e0b98f11d30aba61"}},{"code_sha256_prefix":"b0b20bfb6ab94443","entry":"setup_optimizer","repo":"yuanyige/tea","repo_kind":"official","path":"core/optim.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/optim.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b0b20bfb6ab94443"}},{"code_sha256_prefix":"7dd97c802ed32b19","entry":"setup_source","repo":"yuanyige/tea","repo_kind":"official","path":"core/setada.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/setada.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7dd97c802ed32b19"}},{"code_sha256_prefix":"3078648c75e3e1e3","entry":"softmax_entropy","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/sar.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/sar.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3078648c75e3e1e3"}},{"code_sha256_prefix":"489e90fa2cfbabec","entry":"load_pacs","repo":"yuanyige/tea","repo_kind":"official","path":"core/data.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/data.py","link_basis":"first_harvest_node","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":"489e90fa2cfbabec"}},{"code_sha256_prefix":"2aca4c8f872ec672","entry":"plot_calibration_hist","repo":"yuanyige/tea","repo_kind":"official","path":"core/calibration.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/calibration.py","link_basis":"first_harvest_node","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":"2aca4c8f872ec672"}},{"code_sha256_prefix":"7b9d88d29b50aca6","entry":"softmax_entropy","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/eata.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/eata.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"}},{"code_sha256_prefix":"17259eab7993e1c7","entry":"update_ema","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/sar.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/sar.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":"17259eab7993e1c7"}},{"code_sha256_prefix":"182d3657a9eebb0d","entry":"update_model_probs","repo":"yuanyige/tea","repo_kind":"official","path":"core/adazoo/eata.py","file_url":"https://github.com/yuanyige/tea/blob/HEAD/core/adazoo/eata.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":"182d3657a9eebb0d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}