{"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/dpzero-dimension-independent-and","title":"DPZero: Private Fine-Tuning of Language Models without Backpropagation","arxiv_id":"2310.09639","date":"2023-10-14","proceeding":null,"authors":["Liang Zhang","Bingcong Li","Kiran Koshy Thekumparampil","Sewoong Oh","Niao He"],"abstract":"The widespread practice of fine-tuning large language models (LLMs) on domain-specific data faces two major challenges in memory and privacy. First, as the size of LLMs continues to grow, the memory demands of gradient-based training methods via backpropagation become prohibitively high. Second, given the tendency of LLMs to memorize training data, it is important to protect potentially sensitive information in the fine-tuning data from being regurgitated. Zeroth-order methods, which rely solely on forward passes, substantially reduce memory consumption during training. However, directly combining them with standard differentially private gradient descent suffers more as model size grows. To bridge this gap, we introduce DPZero, a novel private zeroth-order algorithm with nearly dimension-independent rates. The memory efficiency of DPZero is demonstrated in privately fine-tuning RoBERTa and OPT on several downstream tasks. Our code is available at https://github.com/Liang137/DPZero.","url_abs":"https://arxiv.org/abs/2310.09639v3","url_pdf":"https://arxiv.org/pdf/2310.09639v3.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":"dpzero-dimension-independent-and","repo_url":"https://github.com/liang137/dpzero","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"opt","method_name":"OPT"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"roberta","method_name":"RoBERTa"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.09639","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.09639"}},"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":"deterministic:regex_extraction","url":"https://github.com/Liang137/DPZero","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/liang137/dpzero","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"ran_draft_wrong":2,"unverified":10},"by_repo_kind":{"official":{"samples":17,"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":0,"samples":[{"code_sha256_prefix":"7c5d9ba063f6642c","entry":"encode_prompt","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/utils.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/utils.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":"7c5d9ba063f6642c"}},{"code_sha256_prefix":"b5adfd6ac99a1b18","entry":"find_module","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/lora.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/lora.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b5adfd6ac99a1b18"}},{"code_sha256_prefix":"da6c8809e7b9fce0","entry":"forward_wrap_with_option_len_dpzero","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/utils.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/utils.py","link_basis":"first_harvest_node","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":"da6c8809e7b9fce0"}},{"code_sha256_prefix":"e768e25ca95f70cd","entry":"input_example_to_string","repo":"Liang137/DPZero","repo_kind":"official","path":"roberta/src/dataset.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/roberta/src/dataset.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":"e768e25ca95f70cd"}},{"code_sha256_prefix":"fbef70dc7c700501","entry":"input_example_to_tuple","repo":"Liang137/DPZero","repo_kind":"official","path":"roberta/src/dataset.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/roberta/src/dataset.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":"fbef70dc7c700501"}},{"code_sha256_prefix":"e7e75981cb464788","entry":"normalize_answer","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/metrics.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7e75981cb464788"}},{"code_sha256_prefix":"9a62fa939fc563a4","entry":"tokenize_multipart_input","repo":"Liang137/DPZero","repo_kind":"official","path":"roberta/src/dataset.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/roberta/src/dataset.py","link_basis":"first_harvest_node","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":"9a62fa939fc563a4"}},{"code_sha256_prefix":"6819ef75ae988d6e","entry":"AsymmetricLstsqKernelSolver","repo":"liang137/dpzero","repo_kind":"official","path":"roberta/src/kernel_solvers.py","file_url":"https://github.com/liang137/dpzero/blob/HEAD/roberta/src/kernel_solvers.py","link_basis":"first_harvest_node","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":"6819ef75ae988d6e"}},{"code_sha256_prefix":"e4ad3f4b56f8bf3e","entry":"BaseKernelSolver","repo":"liang137/dpzero","repo_kind":"official","path":"roberta/src/kernel_solvers.py","file_url":"https://github.com/liang137/dpzero/blob/HEAD/roberta/src/kernel_solvers.py","link_basis":"first_harvest_node","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":"e4ad3f4b56f8bf3e"}},{"code_sha256_prefix":"4d101a4f2733809f","entry":"LstsqKernelSolver","repo":"liang137/dpzero","repo_kind":"official","path":"roberta/src/kernel_solvers.py","file_url":"https://github.com/liang137/dpzero/blob/HEAD/roberta/src/kernel_solvers.py","link_basis":"first_harvest_node","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":"4d101a4f2733809f"}},{"code_sha256_prefix":"bdb460cb247501dc","entry":"attn_forward_hook","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/prefix.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/prefix.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":"bdb460cb247501dc"}},{"code_sha256_prefix":"84c658f2c9252878","entry":"calculate_metric","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/metrics.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/metrics.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":"84c658f2c9252878"}},{"code_sha256_prefix":"b989d4bce26f77ce","entry":"f1","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/metrics.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/metrics.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":"b989d4bce26f77ce"}},{"code_sha256_prefix":"f7c384f1e681ea7a","entry":"get_task","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/tasks.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/tasks.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":"f7c384f1e681ea7a"}},{"code_sha256_prefix":"84920a8095dca4fa","entry":"prepare_inputs_for_generation","repo":"Liang137/DPZero","repo_kind":"official","path":"opt/src/prefix.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/opt/src/prefix.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":"84920a8095dca4fa"}},{"code_sha256_prefix":"c239cb1add74b809","entry":"tensor_all_gather","repo":"Liang137/DPZero","repo_kind":"official","path":"roberta/src/linearhead_trainer.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/roberta/src/linearhead_trainer.py","link_basis":"first_harvest_node","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":"c239cb1add74b809"}},{"code_sha256_prefix":"734d0491ecbc7841","entry":"varsize_tensor_all_gather","repo":"Liang137/DPZero","repo_kind":"official","path":"roberta/src/linearhead_trainer.py","file_url":"https://github.com/Liang137/DPZero/blob/HEAD/roberta/src/linearhead_trainer.py","link_basis":"first_harvest_node","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":"734d0491ecbc7841"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}