{"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/llamafactory-unified-efficient-fine-tuning-of","title":"LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models","arxiv_id":"2403.13372","date":"2024-03-20","proceeding":null,"authors":["Yaowei Zheng","Richong Zhang","Junhao Zhang","Yanhan Ye","Zheyan Luo","Zhangchi Feng","Yongqiang Ma"],"abstract":"Efficient fine-tuning is vital for adapting large language models (LLMs) to downstream tasks. However, it requires non-trivial efforts to implement these methods on different models. We present LlamaFactory, a unified framework that integrates a suite of cutting-edge efficient training methods. It provides a solution for flexibly customizing the fine-tuning of 100+ LLMs without the need for coding through the built-in web UI LlamaBoard. We empirically validate the efficiency and effectiveness of our framework on language modeling and text generation tasks. It has been released at https://github.com/hiyouga/LLaMA-Factory and received over 25,000 stars and 3,000 forks.","url_abs":"https://arxiv.org/abs/2403.13372v4","url_pdf":"https://arxiv.org/pdf/2403.13372v4.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":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/hiyouga/llama-factory","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/BachOzean/TadE","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/Rcrossmeister/Knowledge-to-SQL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/Rcrossmeister/RLQG","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/chen-gx/toolevo","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/hiyouga/hiyouga","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/juyongjiang/codeup","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"llamafactory-unified-efficient-fine-tuning-of","repo_url":"https://github.com/smelliecat/aaemime","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.13372","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.13372"}},"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/BachOzean/TadE","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Rcrossmeister/Knowledge-to-SQL","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chen-gx/toolevo","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Rcrossmeister/RLQG","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hiyouga/llama-factory","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/juyongjiang/codeup","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/smelliecat/aaemime","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hiyouga/hiyouga","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/hiyouga/LLaMA-Factory","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":3,"unverified":14},"by_repo_kind":{"listed":{"samples":17,"ran":3,"repositories":3}},"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":"5067a5823022c273","entry":"apply_rotary_pos_emb_single","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"model/src/api/attn_and_long_ctx_patches.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/model/src/api/attn_and_long_ctx_patches.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":"5067a5823022c273"}},{"code_sha256_prefix":"f31c69421a40b0a4","entry":"create_score_evaluation_response","repo":"BachOzean/TadE","repo_kind":"listed","path":"src/llamafactory/api/chat.py","file_url":"https://github.com/BachOzean/TadE/blob/HEAD/src/llamafactory/api/chat.py","link_basis":"harvester_set","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":"f31c69421a40b0a4"}},{"code_sha256_prefix":"57583cf880d95444","entry":"jsonify","repo":"BachOzean/TadE","repo_kind":"listed","path":"src/llamafactory/api/common.py","file_url":"https://github.com/BachOzean/TadE/blob/HEAD/src/llamafactory/api/common.py","link_basis":"harvester_set","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":"57583cf880d95444"}},{"code_sha256_prefix":"bcfa7233bbbd6056","entry":"adaptive_ntk_forward","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"model/src/api/attn_and_long_ctx_patches.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/model/src/api/attn_and_long_ctx_patches.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":"bcfa7233bbbd6056"}},{"code_sha256_prefix":"e03cb2df2255bfe4","entry":"calculate_similarity","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"model/collector.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/model/collector.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":"e03cb2df2255bfe4"}},{"code_sha256_prefix":"b508d81907f540d0","entry":"content_overlap_ratio","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"evaluation/utils.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/evaluation/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":"b508d81907f540d0"}},{"code_sha256_prefix":"6f15166ed679f5d3","entry":"convert_examples_to_features_sequence","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"dataset/utils/loader.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/dataset/utils/loader.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":"6f15166ed679f5d3"}},{"code_sha256_prefix":"87aa9acaa81294f5","entry":"dictify","repo":"BachOzean/TadE","repo_kind":"listed","path":"src/llamafactory/api/common.py","file_url":"https://github.com/BachOzean/TadE/blob/HEAD/src/llamafactory/api/common.py","link_basis":"harvester_set","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":"87aa9acaa81294f5"}},{"code_sha256_prefix":"f561697841f2d428","entry":"exact_match_accuracy","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"evaluation/utils.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/evaluation/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":"f561697841f2d428"}},{"code_sha256_prefix":"dd1bd4b20b76b8bd","entry":"load_chat","repo":"smelliecat/aaemime","repo_kind":"listed","path":"new/src/gen_for_coraal.py","file_url":"https://github.com/smelliecat/aaemime/blob/HEAD/new/src/gen_for_coraal.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":"dd1bd4b20b76b8bd"}},{"code_sha256_prefix":"4ea843747b80c800","entry":"load_sentences","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"dataset/utils/loader.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/dataset/utils/loader.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":"4ea843747b80c800"}},{"code_sha256_prefix":"0c5d5a49e28081e7","entry":"load_template","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"dataset/utils/loader.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/dataset/utils/loader.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":"0c5d5a49e28081e7"}},{"code_sha256_prefix":"e9a8c69747eb64a7","entry":"process_sentence","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"dataset/RAMS/rams_load.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/dataset/RAMS/rams_load.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":"e9a8c69747eb64a7"}},{"code_sha256_prefix":"147f30501936b7f3","entry":"read_json","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"model/converter.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/model/converter.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":"147f30501936b7f3"}},{"code_sha256_prefix":"2a7c632d17841b02","entry":"read_jsonl","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"model/converter.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/model/converter.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":"2a7c632d17841b02"}},{"code_sha256_prefix":"05cd11daf8842801","entry":"rmANS","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"evaluation/llama2_qa.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/evaluation/llama2_qa.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":"05cd11daf8842801"}},{"code_sha256_prefix":"7385dc9c056d4dc9","entry":"xformers_forward","repo":"Rcrossmeister/RLQG","repo_kind":"listed","path":"model/src/api/attn_and_long_ctx_patches.py","file_url":"https://github.com/Rcrossmeister/RLQG/blob/HEAD/model/src/api/attn_and_long_ctx_patches.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":"7385dc9c056d4dc9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}