{"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/udalm-unsupervised-domain-adaptation-through","title":"UDALM: Unsupervised Domain Adaptation through Language Modeling","arxiv_id":"2104.07078","date":"2021-04-14","proceeding":"NAACL 2021 4","authors":["Constantinos Karouzos","Georgios Paraskevopoulos","Alexandros Potamianos"],"abstract":"In this work we explore Unsupervised Domain Adaptation (UDA) of pretrained language models for downstream tasks. We introduce UDALM, a fine-tuning procedure, using a mixed classification and Masked Language Model loss, that can adapt to the target domain distribution in a robust and sample efficient manner. Our experiments show that performance of models trained with the mixed loss scales with the amount of available target data and the mixed loss can be effectively used as a stopping criterion during UDA training. Furthermore, we discuss the relationship between A-distance and the target error and explore some limitations of the Domain Adversarial Training approach. Our method is evaluated on twelve domain pairs of the Amazon Reviews Sentiment dataset, yielding $91.74\\%$ accuracy, which is an $1.11\\%$ absolute improvement over the state-of-the-art.","url_abs":"https://arxiv.org/abs/2104.07078v1","url_pdf":"https://arxiv.org/pdf/2104.07078v1.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":"udalm-unsupervised-domain-adaptation-through","repo_url":"https://github.com/ckarouzos/slp_daptmlm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"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":"sentiment-analysis","task_name":"Sentiment Analysis"},{"task_slug":"unsupervised-domain-adaptation","task_name":"Unsupervised Domain Adaptation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/sentiment-analysis-on-multi-domain-sentiment","task":"Sentiment Analysis","dataset":"Multi-Domain Sentiment Dataset","model":"UDALM: Unsupervised Domain Adaptation through Language Modeling","rank_in_archive_order":1,"of":6,"metrics":{"Average":"91.74","Books":"90.63","DVD":"89.78","Electronics":"92.78","Kitchen":"93.77"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2104.07078","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.07078"}},"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/ckarouzos/slp_daptmlm","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":5},"by_repo_kind":{"official":{"samples":5,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"92922b17d42a862b","entry":"calc_scores","repo":"ckarouzos/slp_daptmlm","repo_kind":"official","path":"slp/modules/attention.py","file_url":"https://github.com/ckarouzos/slp_daptmlm/blob/HEAD/slp/modules/attention.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"92922b17d42a862b"}},{"code_sha256_prefix":"77d46d2160bbc40b","entry":"grad_reverse","repo":"ckarouzos/slp_daptmlm","repo_kind":"official","path":"slp/modules/vada.py","file_url":"https://github.com/ckarouzos/slp_daptmlm/blob/HEAD/slp/modules/vada.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77d46d2160bbc40b"}},{"code_sha256_prefix":"62e9134723ffd1e5","entry":"pad_mask","repo":"ckarouzos/slp_daptmlm","repo_kind":"official","path":"slp/modules/util.py","file_url":"https://github.com/ckarouzos/slp_daptmlm/blob/HEAD/slp/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62e9134723ffd1e5"}},{"code_sha256_prefix":"954e586d3e2cd51c","entry":"repeat_layer","repo":"ckarouzos/slp_daptmlm","repo_kind":"official","path":"slp/modules/util.py","file_url":"https://github.com/ckarouzos/slp_daptmlm/blob/HEAD/slp/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"954e586d3e2cd51c"}},{"code_sha256_prefix":"e4690c3c87fb3420","entry":"subsequent_mask","repo":"ckarouzos/slp_daptmlm","repo_kind":"official","path":"slp/modules/util.py","file_url":"https://github.com/ckarouzos/slp_daptmlm/blob/HEAD/slp/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e4690c3c87fb3420"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}