{"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/enhancing-domain-adaptation-through-prompt","title":"Enhancing Domain Adaptation through Prompt Gradient Alignment","arxiv_id":"2406.09353","date":"2024-06-13","proceeding":null,"authors":["Hoang Phan","Lam Tran","Quyen Tran","Trung Le"],"abstract":"Prior Unsupervised Domain Adaptation (UDA) methods often aim to train a domain-invariant feature extractor, which may hinder the model from learning sufficiently discriminative features. To tackle this, a line of works based on prompt learning leverages the power of large-scale pre-trained vision-language models to learn both domain-invariant and specific features through a set of domain-agnostic and domain-specific learnable prompts. Those studies typically enforce invariant constraints on representation, output, or prompt space to learn such prompts. In contrast, we cast UDA as a multiple-objective optimization problem in which each objective is represented by a domain loss. Under this new framework, we propose to align per-objective gradients to foster consensus between them. Additionally, to prevent potential overfitting when fine-tuning this deep learning architecture, we penalize the norm of these gradients. To achieve these goals, we devise a practical gradient update procedure that can work under both single-source and multi-source UDA. Empirically, our method consistently outperforms other vision-language model adaptation methods. The implementation is available at https://github.com/VietHoang1512/PGA.","url_abs":"https://arxiv.org/abs/2406.09353v3","url_pdf":"https://arxiv.org/pdf/2406.09353v3.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":"enhancing-domain-adaptation-through-prompt","repo_url":"https://github.com/viethoang1512/pga","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"multi-source-unsupervised-domain-adaptation","task_name":"Multi-Source Unsupervised Domain Adaptation"},{"task_slug":"prompt-learning","task_name":"Prompt Learning"},{"task_slug":"unsupervised-domain-adaptation","task_name":"Unsupervised Domain Adaptation"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"mpga","method_name":"MPGA"},{"method_slug":"pga","method_name":"PGA"}],"datasets_introduced":[],"methods_introduced":[{"slug":"mpga","name":"MPGA","full_name":"Multi Prompt Gradient Alignment"},{"slug":"pga","name":"PGA","full_name":"Prompt Gradient Alignment"}],"results":[{"leaderboard":"/sota/domain-adaptation-on-office-home","task":"Domain Adaptation","dataset":"Office-Home","model":"PGA (ViT-L/14)","rank_in_archive_order":3,"of":29,"metrics":{"Accuracy":"89.4"},"uses_additional_data":false},{"leaderboard":"/sota/domain-adaptation-on-office-home","task":"Domain Adaptation","dataset":"Office-Home","model":"PGA (ViT-B/16)","rank_in_archive_order":7,"of":29,"metrics":{"Accuracy":"85.1"},"uses_additional_data":false},{"leaderboard":"/sota/domain-adaptation-on-office-home","task":"Domain Adaptation","dataset":"Office-Home","model":"PGA (RN50)","rank_in_archive_order":11,"of":29,"metrics":{"Accuracy":"75.8"},"uses_additional_data":false},{"leaderboard":"/sota/domain-adaptation-on-s2rda-49","task":"Domain Adaptation","dataset":"S2RDA-49","model":"PGA","rank_in_archive_order":1,"of":1,"metrics":{"Accuracy":"74.1"},"uses_additional_data":false},{"leaderboard":"/sota/domain-adaptation-on-s2rda-ms-39","task":"Domain Adaptation","dataset":"S2RDA-MS-39","model":"PGA","rank_in_archive_order":1,"of":1,"metrics":{"Accuracy":"38"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.09353","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.09353"}},"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":"deterministic:regex_extraction","url":"https://github.com/VietHoang1512/PGA","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/viethoang1512/pga","reach":{"status":"ok"}}],"summary":{"ran":4,"ran_draft_wrong":1,"ran_honours":1,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"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":12,"samples":[{"code_sha256_prefix":"f1188d085e216ee3","entry":"check_isfile","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/dataset.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/dataset.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":"f1188d085e216ee3"}},{"code_sha256_prefix":"bf4375591fccddac","entry":"entropy_loss","repo":"viethoang1512/pga","repo_kind":"official","path":"LA/main_uda.py","file_url":"https://github.com/viethoang1512/pga/blob/HEAD/LA/main_uda.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bf4375591fccddac"}},{"code_sha256_prefix":"1d67fe6fb333ae8e","entry":"load_data","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/dataloader.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/dataloader.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":"1d67fe6fb333ae8e"}},{"code_sha256_prefix":"f6df3bd3264e9f51","entry":"load_svhn","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/digit5.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/digit5.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":"f6df3bd3264e9f51"}},{"code_sha256_prefix":"7a92bf4975eb29ec","entry":"read_image","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/dataset.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/dataset.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":"7a92bf4975eb29ec"}},{"code_sha256_prefix":"6301fb5daaeef4c9","entry":"test","repo":"viethoang1512/pga","repo_kind":"official","path":"LA/main_uda.py","file_url":"https://github.com/viethoang1512/pga/blob/HEAD/LA/main_uda.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6301fb5daaeef4c9"}},{"code_sha256_prefix":"40418fa224950340","entry":"build_model","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/clip_custom/model.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/clip_custom/model.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":"40418fa224950340"}},{"code_sha256_prefix":"135b3dc835ffe6ad","entry":"get_confirm_token","repo":"VietHoang1512/PGA","repo_kind":"official","path":"download.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/download.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":"135b3dc835ffe6ad"}},{"code_sha256_prefix":"7de13fad99cbd042","entry":"get_google_drive_stream","repo":"VietHoang1512/PGA","repo_kind":"official","path":"download.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/download.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":"7de13fad99cbd042"}},{"code_sha256_prefix":"fe317c3d4d24147a","entry":"listdir_nohidden","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/dataset.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/dataset.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":"fe317c3d4d24147a"}},{"code_sha256_prefix":"342c0c85275110c4","entry":"load_mnist","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/digit5.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/digit5.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":"342c0c85275110c4"}},{"code_sha256_prefix":"46957f35cb27059c","entry":"load_mnist_m","repo":"VietHoang1512/PGA","repo_kind":"official","path":"LA/digit5.py","file_url":"https://github.com/VietHoang1512/PGA/blob/HEAD/LA/digit5.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":"46957f35cb27059c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}