{"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/merging-by-matching-models-in-task-subspaces","title":"Merging by Matching Models in Task Parameter Subspaces","arxiv_id":"2312.04339","date":"2023-12-07","proceeding":null,"authors":["Derek Tam","Mohit Bansal","Colin Raffel"],"abstract":"Model merging aims to cheaply combine individual task-specific models into a single multitask model. In this work, we view past merging methods as leveraging different notions of a ''task parameter subspace'' in which models are matched before being merged. We connect the task parameter subspace of a given model to its loss landscape and formalize how this approach to model merging can be seen as solving a linear system of equations. While past work has generally been limited to linear systems that have a closed-form solution, we consider using the conjugate gradient method to find a solution. We show that using the conjugate gradient method can outperform closed-form solutions, enables merging via linear systems that are otherwise intractable to solve, and flexibly allows choosing from a wide variety of initializations and estimates for the ''task parameter subspace''. We ultimately demonstrate that our merging framework called ''Matching Models in their Task Parameter Subspace'' (MaTS) achieves state-of-the-art results in multitask and intermediate-task model merging. We release all of the code and checkpoints used in our work at https://github.com/r-three/mats.","url_abs":"https://arxiv.org/abs/2312.04339v2","url_pdf":"https://arxiv.org/pdf/2312.04339v2.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":"merging-by-matching-models-in-task-subspaces","repo_url":"https://github.com/r-three/mats","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.04339","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.04339"}},"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/r-three/mats","reach":{"status":"ok"}}],"summary":{"ran":2,"unverified":6},"by_repo_kind":{"official":{"samples":8,"ran":2,"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":8,"samples":[{"code_sha256_prefix":"65659f0a52551e43","entry":"concatenate_scores","repo":"r-three/mats","repo_kind":"official","path":"src/eval/utils.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/eval/utils.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":"65659f0a52551e43"}},{"code_sha256_prefix":"001b8f851cad7c3e","entry":"prepare_batchOfEvalInfo","repo":"r-three/mats","repo_kind":"official","path":"src/eval/utils.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/eval/utils.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":"001b8f851cad7c3e"}},{"code_sha256_prefix":"1f58f45fd3f59164","entry":"average","repo":"r-three/mats","repo_kind":"official","path":"src/merging/average.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/merging/average.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":"1f58f45fd3f59164"}},{"code_sha256_prefix":"8f9e07b0e7fec4c9","entry":"cg_forward","repo":"r-three/mats","repo_kind":"official","path":"src/merging/conjugateGradient_average.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/merging/conjugateGradient_average.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":"8f9e07b0e7fec4c9"}},{"code_sha256_prefix":"4ee4acc1889850cd","entry":"cg_forwardBackward","repo":"r-three/mats","repo_kind":"official","path":"src/merging/conjugateGradient_fisherMerging.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/merging/conjugateGradient_fisherMerging.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":"4ee4acc1889850cd"}},{"code_sha256_prefix":"b4a85591e4919f77","entry":"conjugateGradient_average","repo":"r-three/mats","repo_kind":"official","path":"src/merging/conjugateGradient_average.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/merging/conjugateGradient_average.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":"b4a85591e4919f77"}},{"code_sha256_prefix":"9562fd0d3e9b02ab","entry":"conjugateGradient_diagonalFisher","repo":"r-three/mats","repo_kind":"official","path":"src/merging/conjugateGradient_diagonalFisher.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/merging/conjugateGradient_diagonalFisher.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":"9562fd0d3e9b02ab"}},{"code_sha256_prefix":"18db893c37a2f806","entry":"conjugateGradient_fisherMerging","repo":"r-three/mats","repo_kind":"official","path":"src/merging/conjugateGradient_fisherMerging.py","file_url":"https://github.com/r-three/mats/blob/HEAD/src/merging/conjugateGradient_fisherMerging.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":"18db893c37a2f806"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}