{"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/meft-memory-efficient-fine-tuning-through","title":"MEFT: Memory-Efficient Fine-Tuning through Sparse Adapter","arxiv_id":"2406.04984","date":"2024-06-07","proceeding":null,"authors":["Jitai Hao","Weiwei Sun","Xin Xin","Qi Meng","Zhumin Chen","Pengjie Ren","Zhaochun Ren"],"abstract":"Parameter-Efficient Fine-tuning (PEFT) facilitates the fine-tuning of Large Language Models (LLMs) under limited resources. However, the fine-tuning performance with PEFT on complex, knowledge-intensive tasks is limited due to the constrained model capacity, which originates from the limited number of additional trainable parameters. To overcome this limitation, we introduce a novel mechanism that fine-tunes LLMs with adapters of larger size yet memory-efficient. This is achieved by leveraging the inherent activation sparsity in the Feed-Forward Networks (FFNs) of LLMs and utilizing the larger capacity of Central Processing Unit (CPU) memory compared to Graphics Processing Unit (GPU). We store and update the parameters of larger adapters on the CPU. Moreover, we employ a Mixture of Experts (MoE)-like architecture to mitigate unnecessary CPU computations and reduce the communication volume between the GPU and CPU. This is particularly beneficial over the limited bandwidth of PCI Express (PCIe). Our method can achieve fine-tuning results comparable to those obtained with larger memory capacities, even when operating under more limited resources such as a 24GB memory single GPU setup, with acceptable loss in training efficiency. Our codes are available at https://github.com/CURRENTF/MEFT.","url_abs":"https://arxiv.org/abs/2406.04984v1","url_pdf":"https://arxiv.org/pdf/2406.04984v1.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":"meft-memory-efficient-fine-tuning-through","repo_url":"https://github.com/currentf/meft","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":null,"task_name":"CPU"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":"parameter-efficient-fine-tuning","task_name":"parameter-efficient fine-tuning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.04984","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.04984"}},"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/currentf/meft","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/CURRENTF/MEFT","reach":{"status":"ok"}}],"summary":{"ran":7,"unverified":5},"by_repo_kind":{"official":{"samples":12,"ran":7,"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":12,"samples":[{"code_sha256_prefix":"0d19dfb6e1a61d7b","entry":"augment_xb","repo":"currentf/meft","repo_kind":"official","path":"modeling/faiss_vector_database.py","file_url":"https://github.com/currentf/meft/blob/HEAD/modeling/faiss_vector_database.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0d19dfb6e1a61d7b"}},{"code_sha256_prefix":"b7bec8d0218b66a2","entry":"augment_xq","repo":"currentf/meft","repo_kind":"official","path":"modeling/faiss_vector_database.py","file_url":"https://github.com/currentf/meft/blob/HEAD/modeling/faiss_vector_database.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b7bec8d0218b66a2"}},{"code_sha256_prefix":"5ed93c8ef12816a8","entry":"generate_prompt","repo":"currentf/meft","repo_kind":"official","path":"full_finetune.py","file_url":"https://github.com/currentf/meft/blob/HEAD/full_finetune.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":"5ed93c8ef12816a8"}},{"code_sha256_prefix":"684008276c2e318f","entry":"get_phi","repo":"currentf/meft","repo_kind":"official","path":"modeling/faiss_vector_database.py","file_url":"https://github.com/currentf/meft/blob/HEAD/modeling/faiss_vector_database.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"684008276c2e318f"}},{"code_sha256_prefix":"816b6e96d472615a","entry":"hash_string","repo":"currentf/meft","repo_kind":"official","path":"finetune.py","file_url":"https://github.com/currentf/meft/blob/HEAD/finetune.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"816b6e96d472615a"}},{"code_sha256_prefix":"5441306e849e2601","entry":"make_str_by_dict","repo":"currentf/meft","repo_kind":"official","path":"finetune.py","file_url":"https://github.com/currentf/meft/blob/HEAD/finetune.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":"5441306e849e2601"}},{"code_sha256_prefix":"8ac2d521295a4d00","entry":"my_prepare_model_for_int8_training","repo":"currentf/meft","repo_kind":"official","path":"mistral_finetune.py","file_url":"https://github.com/currentf/meft/blob/HEAD/mistral_finetune.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":"8ac2d521295a4d00"}},{"code_sha256_prefix":"a862da4beb100ff4","entry":"KVLlamaMLP","repo":"CURRENTF/MEFT","repo_kind":"official","path":"modeling/my_llama.py","file_url":"https://github.com/CURRENTF/MEFT/blob/HEAD/modeling/my_llama.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":"a862da4beb100ff4"}},{"code_sha256_prefix":"2fc4082861047a90","entry":"create_faiss_index","repo":"currentf/meft","repo_kind":"official","path":"modeling/hnswlib_vector_database.py","file_url":"https://github.com/currentf/meft/blob/HEAD/modeling/hnswlib_vector_database.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":"2fc4082861047a90"}},{"code_sha256_prefix":"dddd6c6269fb7396","entry":"ffn_transfer","repo":"CURRENTF/MEFT","repo_kind":"official","path":"modeling/my_llama.py","file_url":"https://github.com/CURRENTF/MEFT/blob/HEAD/modeling/my_llama.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":"dddd6c6269fb7396"}},{"code_sha256_prefix":"9e0c2a8bd5d9a627","entry":"get_IVFxPQy","repo":"currentf/meft","repo_kind":"official","path":"modeling/hnswlib_vector_database.py","file_url":"https://github.com/currentf/meft/blob/HEAD/modeling/hnswlib_vector_database.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":"9e0c2a8bd5d9a627"}},{"code_sha256_prefix":"5b7dee34064b4f2d","entry":"train","repo":"currentf/meft","repo_kind":"official","path":"full_finetune.py","file_url":"https://github.com/currentf/meft/blob/HEAD/full_finetune.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":"5b7dee34064b4f2d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}