{"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-adaptation-of-discriminative-models","title":"Diffusion-TTA: Test-time Adaptation of Discriminative Models via Generative Feedback","arxiv_id":"2311.16102","date":"2023-11-27","proceeding":null,"authors":["Mihir Prabhudesai","Tsung-Wei Ke","Alexander C. Li","Deepak Pathak","Katerina Fragkiadaki"],"abstract":"The advancements in generative modeling, particularly the advent of diffusion models, have sparked a fundamental question: how can these models be effectively used for discriminative tasks? In this work, we find that generative models can be great test-time adapters for discriminative models. Our method, Diffusion-TTA, adapts pre-trained discriminative models such as image classifiers, segmenters and depth predictors, to each unlabelled example in the test set using generative feedback from a diffusion model. We achieve this by modulating the conditioning of the diffusion model using the output of the discriminative model. We then maximize the image likelihood objective by backpropagating the gradients to discriminative model's parameters. We show Diffusion-TTA significantly enhances the accuracy of various large-scale pre-trained discriminative models, such as, ImageNet classifiers, CLIP models, image pixel labellers and image depth predictors. Diffusion-TTA outperforms existing test-time adaptation methods, including TTT-MAE and TENT, and particularly shines in online adaptation setups, where the discriminative model is continually adapted to each example in the test set. We provide access to code, results, and visualizations on our website: https://diffusion-tta.github.io/.","url_abs":"https://arxiv.org/abs/2311.16102v2","url_pdf":"https://arxiv.org/pdf/2311.16102v2.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-adaptation-of-discriminative-models","repo_url":"https://github.com/mihirp1998/Diffusion-TTA","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"test-time-adaptation","task_name":"Test-time Adaptation"}],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2311.16102","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.16102"}},"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/mihirp1998/Diffusion-TTA","reach":null}],"summary":{"ran_honours":1,"ran":2,"unverified":1},"by_repo_kind":{"listed":{"samples":4,"ran":3,"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":4,"samples":[{"code_sha256_prefix":"7666a4df4f4179de","entry":"initiate_time_steps","repo":"mihirp1998/Diffusion-TTA","repo_kind":"listed","path":"diff_tta/engine.py","file_url":"https://github.com/mihirp1998/Diffusion-TTA/blob/HEAD/diff_tta/engine.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7666a4df4f4179de"}},{"code_sha256_prefix":"ef0bd03ca6a006c4","entry":"prepare_total_timesteps","repo":"mihirp1998/Diffusion-TTA","repo_kind":"listed","path":"diff_tta/engine.py","file_url":"https://github.com/mihirp1998/Diffusion-TTA/blob/HEAD/diff_tta/engine.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":"ef0bd03ca6a006c4"}},{"code_sha256_prefix":"03e86eb4d45d839e","entry":"prepare_vae_latent","repo":"mihirp1998/Diffusion-TTA","repo_kind":"listed","path":"diff_tta/engine.py","file_url":"https://github.com/mihirp1998/Diffusion-TTA/blob/HEAD/diff_tta/engine.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":"03e86eb4d45d839e"}},{"code_sha256_prefix":"63aa2bea30b7e528","entry":"tta_one_image_by_gradient_descent","repo":"mihirp1998/Diffusion-TTA","repo_kind":"listed","path":"diff_tta/engine.py","file_url":"https://github.com/mihirp1998/Diffusion-TTA/blob/HEAD/diff_tta/engine.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"63aa2bea30b7e528"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}