{"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/xft-unlocking-the-power-of-code-instruction","title":"XFT: Unlocking the Power of Code Instruction Tuning by Simply Merging Upcycled Mixture-of-Experts","arxiv_id":"2404.15247","date":"2024-04-23","proceeding":null,"authors":["Yifeng Ding","Jiawei Liu","Yuxiang Wei","Terry Yue Zhuo","Lingming Zhang"],"abstract":"We introduce XFT, a simple yet powerful training scheme, by simply merging upcycled Mixture-of-Experts (MoE) to unleash the performance limit of instruction-tuned code Large Language Models (LLMs). While vanilla sparse upcycling fails to improve instruction tuning, XFT introduces a shared expert mechanism with a novel routing weight normalization strategy into sparse upcycling, which significantly boosts instruction tuning. After fine-tuning the upcycled MoE model, XFT introduces a learnable model merging mechanism to compile the upcycled MoE model back to a dense model, achieving upcycled MoE-level performance with only dense-model compute. By applying XFT to a 1.3B model, we create a new state-of-the-art tiny code LLM (<3B) with 67.1 and 64.6 pass@1 on HumanEval and HumanEval+ respectively. With the same data and model architecture, XFT improves supervised fine-tuning (SFT) by 13% on HumanEval+, along with consistent improvements from 2% to 13% on MBPP+, MultiPL-E, and DS-1000, demonstrating its generalizability. XFT is fully orthogonal to existing techniques such as Evol-Instruct and OSS-Instruct, opening a new dimension for improving code instruction tuning. Codes are available at https://github.com/ise-uiuc/xft.","url_abs":"https://arxiv.org/abs/2404.15247v2","url_pdf":"https://arxiv.org/pdf/2404.15247v2.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":"xft-unlocking-the-power-of-code-instruction","repo_url":"https://github.com/ise-uiuc/xft","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"humaneval","task_name":"HumanEval"},{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":null,"task_name":"mbpp"}],"methods":[{"method_slug":"moe","method_name":"MoE"},{"method_slug":"weight-normalization","method_name":"Weight Normalization"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.15247","atlas_url":"https://app.syntology.ai/?focus=2404.15247","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.15247"}},"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/ise-uiuc/xft","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":9,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":14,"ran":11,"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":"fd880e76becf098a","entry":"detect_codeblocks","repo":"ise-uiuc/xft","repo_kind":"official","path":"src/magicoder/clean_data.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/src/magicoder/clean_data.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":"fd880e76becf098a"}},{"code_sha256_prefix":"5a60645429ce510e","entry":"filter_same_seed_problem_solution","repo":"ise-uiuc/xft","repo_kind":"official","path":"src/magicoder/clean_data.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/src/magicoder/clean_data.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":"5a60645429ce510e"}},{"code_sha256_prefix":"ebc8b39c9a484052","entry":"get_docstring_summary","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/extract_function_comment_pairs.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/extract_function_comment_pairs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ebc8b39c9a484052"}},{"code_sha256_prefix":"52a867386608a548","entry":"get_language","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/avg_multipl_e.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/avg_multipl_e.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":"52a867386608a548"}},{"code_sha256_prefix":"917a729e9d2282f6","entry":"map_humaneval_problem","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/text2code.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/text2code.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":"917a729e9d2282f6"}},{"code_sha256_prefix":"1173d57fe1b4d158","entry":"postprocess","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/ds_1000.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/ds_1000.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1173d57fe1b4d158"}},{"code_sha256_prefix":"f8e7806484bcc9a6","entry":"preprocess","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/train_comment_code_pairs.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/train_comment_code_pairs.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":"f8e7806484bcc9a6"}},{"code_sha256_prefix":"956cd0aa1cec0821","entry":"preprocess_completion_prompt","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/ds_1000.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/ds_1000.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"956cd0aa1cec0821"}},{"code_sha256_prefix":"61194aba1f41bd36","entry":"process_data","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/train_comment_code_pairs.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/train_comment_code_pairs.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":"61194aba1f41bd36"}},{"code_sha256_prefix":"c31a9474a257aaab","entry":"remove_all_whitespaces","repo":"ise-uiuc/xft","repo_kind":"official","path":"src/magicoder/clean_data.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/src/magicoder/clean_data.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":"c31a9474a257aaab"}},{"code_sha256_prefix":"29080cd7e5b82ee7","entry":"strip_c_style_comment_delimiters","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/extract_function_comment_pairs.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/extract_function_comment_pairs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"29080cd7e5b82ee7"}},{"code_sha256_prefix":"d711ab82d48bbdd3","entry":"extract_methods","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/extract_function_comment_pairs.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/extract_function_comment_pairs.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":"d711ab82d48bbdd3"}},{"code_sha256_prefix":"2157c279da567204","entry":"get_dataset","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/collect_seed_documents.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/collect_seed_documents.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":"2157c279da567204"}},{"code_sha256_prefix":"f95fb439168f8d49","entry":"map_mbpp_problem","repo":"ise-uiuc/xft","repo_kind":"official","path":"experiments/text2code.py","file_url":"https://github.com/ise-uiuc/xft/blob/HEAD/experiments/text2code.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":"f95fb439168f8d49"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}