{"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/idani-inference-time-domain-adaptation-via","title":"IDANI: Inference-time Domain Adaptation via Neuron-level Interventions","arxiv_id":"2206.00259","date":"2022-06-01","proceeding":"DeepLo 2022 7","authors":["Omer Antverg","Eyal Ben-David","Yonatan Belinkov"],"abstract":"Large pre-trained models are usually fine-tuned on downstream task data, and tested on unseen data. When the train and test data come from different domains, the model is likely to struggle, as it is not adapted to the test domain. We propose a new approach for domain adaptation (DA), using neuron-level interventions: We modify the representation of each test example in specific neurons, resulting in a counterfactual example from the source domain, which the model is more familiar with. The modified example is then fed back into the model. While most other DA methods are applied during training time, ours is applied during inference only, making it more efficient and applicable. Our experiments show that our method improves performance on unseen domains.","url_abs":"https://arxiv.org/abs/2206.00259v1","url_pdf":"https://arxiv.org/pdf/2206.00259v1.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":"idani-inference-time-domain-adaptation-via","repo_url":"https://github.com/technion-cs-nlp/idani","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2206.00259","atlas_url":"https://app.syntology.ai/?focus=2206.00259","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2206.00259"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/technion-cs-nlp/idani","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"official":{"samples":9,"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":0,"samples":[{"code_sha256_prefix":"4f505c72f37e9ae5","entry":"deltas","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/analysis.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/analysis.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4f505c72f37e9ae5"}},{"code_sha256_prefix":"ed196cca71d0c484","entry":"get_max_diff","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/analysis.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/analysis.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ed196cca71d0c484"}},{"code_sha256_prefix":"b5fb6c6efe3a3938","entry":"get_top_neurons","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/IDANI.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/IDANI.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b5fb6c6efe3a3938"}},{"code_sha256_prefix":"a6e33369736b7b36","entry":"get_top_neurons_per_tag","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/IDANI.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/IDANI.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a6e33369736b7b36"}},{"code_sha256_prefix":"002ff84db109928a","entry":"linear","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/IDANI.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/IDANI.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"002ff84db109928a"}},{"code_sha256_prefix":"9d3248b9abfd2262","entry":"process_file","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/analysis.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/analysis.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d3248b9abfd2262"}},{"code_sha256_prefix":"89e891a1f2418927","entry":"compute_metrics","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/fineTuning.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/fineTuning.py","link_basis":"harvester_set","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":"89e891a1f2418927"}},{"code_sha256_prefix":"42f600ff66c5d8b2","entry":"load_domain_data","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/data_utils.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/data_utils.py","link_basis":"harvester_set","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":"42f600ff66c5d8b2"}},{"code_sha256_prefix":"dde94ad51338f55b","entry":"load_task_data","repo":"technion-cs-nlp/idani","repo_kind":"official","path":"code/data_utils.py","file_url":"https://github.com/technion-cs-nlp/idani/blob/HEAD/code/data_utils.py","link_basis":"harvester_set","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":"dde94ad51338f55b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}