{"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/composing-parameter-efficient-modules-with","title":"Composing Parameter-Efficient Modules with Arithmetic Operations","arxiv_id":"2306.14870","date":"2023-06-26","proceeding":null,"authors":["Jinghan Zhang","Shiqi Chen","Junteng Liu","Junxian He"],"abstract":"As an efficient alternative to conventional full finetuning, parameter-efficient finetuning (PEFT) is becoming the prevailing method to adapt pretrained language models. In PEFT, a lightweight module is learned on each dataset while the underlying pretrained language model remains unchanged, resulting in multiple compact modules representing diverse skills when applied to various domains and tasks. In this paper, we propose to compose these parameter-efficient modules through linear arithmetic operations in the weight space, thereby integrating different module capabilities. Specifically, we first define addition and negation operators for the module, and then further compose these two basic operators to perform flexible arithmetic. Our approach requires \\emph{no additional training} and enables highly flexible module composition. We apply different arithmetic operations to compose the parameter-efficient modules for (1) distribution generalization, (2) multi-tasking, (3) unlearning, and (4) domain transfer. Additionally, we extend our approach to detoxify Alpaca-LoRA, the latest instruction-tuned large language model based on LLaMA. Empirical results demonstrate that our approach produces new and effective parameter-efficient modules that significantly outperform existing ones across all settings.","url_abs":"https://arxiv.org/abs/2306.14870v2","url_pdf":"https://arxiv.org/pdf/2306.14870v2.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":"composing-parameter-efficient-modules-with","repo_url":"https://github.com/hkust-nlp/pem_composition","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":null},{"paper_slug":"composing-parameter-efficient-modules-with","repo_url":"https://github.com/sjtu-lit/pem_composition","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"negation","task_name":"Negation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.14870","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.14870"}},"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/hkust-nlp/pem_composition","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sjtu-lit/pem_composition","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_honours":1,"unverified":9},"by_repo_kind":{"official":{"samples":10,"ran":1,"repositories":2}},"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":"440751480098ee7d","entry":"adjust_length_to_model","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"exps/composition_for_unlearning/gpt2_scale.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/exps/composition_for_unlearning/gpt2_scale.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"440751480098ee7d"}},{"code_sha256_prefix":"950ec6a2194fb76d","entry":"adapter_negation","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"exps/composition_for_unlearning/gpt2_scale.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/exps/composition_for_unlearning/gpt2_scale.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"950ec6a2194fb76d"}},{"code_sha256_prefix":"b3615647974036c4","entry":"adjust_tensors_for_parallel","repo":"hkust-nlp/pem_composition","repo_kind":"official","path":"src/transformers/adapters/composition.py","file_url":"https://github.com/hkust-nlp/pem_composition/blob/HEAD/src/transformers/adapters/composition.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b3615647974036c4"}},{"code_sha256_prefix":"f8ef77acae8f9f42","entry":"adjust_tensors_for_parallel","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"src/transformers/adapters/composition.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/src/transformers/adapters/composition.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f8ef77acae8f9f42"}},{"code_sha256_prefix":"2c77d7dc5a31d431","entry":"compute_pairwise_coefficient_sets","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"merge.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/merge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"2c77d7dc5a31d431"}},{"code_sha256_prefix":"ba7e81c71b1fb5f1","entry":"find_incomplete_sentence","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"AlpacaLoRAcomposition/detoxify_api.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/AlpacaLoRAcomposition/detoxify_api.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"ba7e81c71b1fb5f1"}},{"code_sha256_prefix":"0ca28293fa42b301","entry":"load_input_text","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"exps/composition_for_unlearning/run_prediction.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/exps/composition_for_unlearning/run_prediction.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0ca28293fa42b301"}},{"code_sha256_prefix":"42dd792cf7755f82","entry":"load_input_text","repo":"sjtu-lit/pem_composition","repo_kind":"official","path":"AlpacaLoRAcomposition/detoxify_api.py","file_url":"https://github.com/sjtu-lit/pem_composition/blob/HEAD/AlpacaLoRAcomposition/detoxify_api.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"42dd792cf7755f82"}},{"code_sha256_prefix":"fd2a1edfdefc5de3","entry":"parse_composition","repo":"hkust-nlp/pem_composition","repo_kind":"official","path":"src/transformers/adapters/composition.py","file_url":"https://github.com/hkust-nlp/pem_composition/blob/HEAD/src/transformers/adapters/composition.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fd2a1edfdefc5de3"}},{"code_sha256_prefix":"ae8bbe37a1f80e76","entry":"parse_heads_from_composition","repo":"hkust-nlp/pem_composition","repo_kind":"official","path":"src/transformers/adapters/composition.py","file_url":"https://github.com/hkust-nlp/pem_composition/blob/HEAD/src/transformers/adapters/composition.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ae8bbe37a1f80e76"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}