{"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/knowledge-fusion-by-evolving-weights-of","title":"Knowledge Fusion By Evolving Weights of Language Models","arxiv_id":"2406.12208","date":"2024-06-18","proceeding":null,"authors":["Guodong Du","Jing Li","Hanting Liu","Runhua Jiang","Shuyang Yu","Yifei Guo","Sim Kuan Goh","Ho-Kin Tang"],"abstract":"Fine-tuning pre-trained language models, particularly large language models, demands extensive computing resources and can result in varying performance outcomes across different domains and datasets. This paper examines the approach of integrating multiple models from diverse training scenarios into a unified model. This unified model excels across various data domains and exhibits the ability to generalize well on out-of-domain data. We propose a knowledge fusion method named Evolver, inspired by evolutionary algorithms, which does not need further training or additional training data. Specifically, our method involves aggregating the weights of different language models into a population and subsequently generating offspring models through mutation and crossover operations. These offspring models are then evaluated against their parents, allowing for the preservation of those models that show enhanced performance on development datasets. Importantly, our model evolving strategy can be seamlessly integrated with existing model merging frameworks, offering a versatile tool for model enhancement. Experimental results on mainstream language models (i.e., encoder-only, decoder-only, encoder-decoder) reveal that Evolver outperforms previous state-of-the-art models by large margins. The code is publicly available at {https://github.com/duguodong7/model-evolution}.","url_abs":"https://arxiv.org/abs/2406.12208v1","url_pdf":"https://arxiv.org/pdf/2406.12208v1.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":"knowledge-fusion-by-evolving-weights-of","repo_url":"https://github.com/duguodong7/model-evolution","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"evolutionary-algorithms","task_name":"Evolutionary Algorithms"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.12208","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.12208"}},"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/duguodong7/model-evolution","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"ran_draft_wrong":5,"unverified":1},"by_repo_kind":{"official":{"samples":10,"ran":9,"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":"1958130a31c6b14f","entry":"MaxMinNorm_Sigmoid","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/evolver.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/evolver.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1958130a31c6b14f"}},{"code_sha256_prefix":"af8fc9a6b079dd80","entry":"filter_modules_by_regex","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/misc.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/misc.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"af8fc9a6b079dd80"}},{"code_sha256_prefix":"542bdbc6b44e26fe","entry":"filter_params_to_merge","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/misc.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/misc.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"542bdbc6b44e26fe"}},{"code_sha256_prefix":"89e8e1726d953764","entry":"fmt","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/base.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/base.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"89e8e1726d953764"}},{"code_sha256_prefix":"9c4701cb9ebe6693","entry":"fmt","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/evolver.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/evolver.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9c4701cb9ebe6693"}},{"code_sha256_prefix":"38bc054d5c96e237","entry":"get_optim_param_groups","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/local_trainer.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/local_trainer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"38bc054d5c96e237"}},{"code_sha256_prefix":"d150cc5adcf9981b","entry":"get_reweight_factor","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/net.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/net.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d150cc5adcf9981b"}},{"code_sha256_prefix":"253168af406c0497","entry":"get_submodule","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/ot_merger.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/ot_merger.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"253168af406c0497"}},{"code_sha256_prefix":"2ed51eac60e5be2a","entry":"most_common","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/ensembler.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/ensembler.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2ed51eac60e5be2a"}},{"code_sha256_prefix":"4ab1c0097d7c1338","entry":"create_stl_model","repo":"duguodong7/model-evolution","repo_kind":"official","path":"src/model_merge/net.py","file_url":"https://github.com/duguodong7/model-evolution/blob/HEAD/src/model_merge/net.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":"4ab1c0097d7c1338"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}