{"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/dp-opt-make-large-language-model-your-privacy","title":"DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer","arxiv_id":"2312.03724","date":"2023-11-27","proceeding":null,"authors":["Junyuan Hong","Jiachen T. Wang","Chenhui Zhang","Zhangheng Li","Bo Li","Zhangyang Wang"],"abstract":"Large Language Models (LLMs) have emerged as dominant tools for various tasks, particularly when tailored for a specific target by prompt tuning. Nevertheless, concerns surrounding data privacy present obstacles due to the tuned prompts' dependency on sensitive private information. A practical solution is to host a local LLM and optimize a soft prompt privately using data. Yet, hosting a local model becomes problematic when model ownership is protected. Alternative methods, like sending data to the model's provider for training, intensify these privacy issues facing an untrusted provider. In this paper, we present a novel solution called Differentially-Private Offsite Prompt Tuning (DP-OPT) to address this challenge. Our approach involves tuning a discrete prompt on the client side and then applying it to the desired cloud models. We demonstrate that prompts suggested by LLMs themselves can be transferred without compromising performance significantly. To ensure that the prompts do not leak private information, we introduce the first private prompt generation mechanism, by a differentially-private (DP) ensemble of in-context learning with private demonstrations. With DP-OPT, generating privacy-preserving prompts by Vicuna-7b can yield competitive performance compared to non-private in-context learning on GPT3.5 or local private prompt tuning. Codes are available at https://github.com/VITA-Group/DP-OPT .","url_abs":"https://arxiv.org/abs/2312.03724v2","url_pdf":"https://arxiv.org/pdf/2312.03724v2.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":"dp-opt-make-large-language-model-your-privacy","repo_url":"https://github.com/vita-group/dp-opt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"privacy-preserving","task_name":"Privacy Preserving"},{"task_slug":"prompt-engineering","task_name":"Prompt Engineering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2312.03724","atlas_url":"https://app.syntology.ai/?focus=2312.03724","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.03724"}},"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":"deterministic:regex_extraction","url":"https://github.com/VITA-Group/DP-OPT","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vita-group/dp-opt","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"ran_fixture":2,"unverified":2},"by_repo_kind":{"official":{"samples":12,"ran":10,"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":"49e3eb8f0fe43edf","entry":"approxRDP_to_approxDP","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/dp_accountant.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/dp_accountant.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":"49e3eb8f0fe43edf"}},{"code_sha256_prefix":"b7d6c49bbd645641","entry":"eval_logprobs","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/evaluate.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/evaluate.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":"b7d6c49bbd645641"}},{"code_sha256_prefix":"2df54cf24d3a227c","entry":"evaluate_target_logprob","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/evaluate.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/evaluate.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":"2df54cf24d3a227c"}},{"code_sha256_prefix":"7c7f1ed45f1edb37","entry":"exam_privacy_leakage","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/dln.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/dln.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":"7c7f1ed45f1edb37"}},{"code_sha256_prefix":"3d25c1239ecb50e8","entry":"gpt_get_estimated_cost","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/openai_llm.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/openai_llm.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":"3d25c1239ecb50e8"}},{"code_sha256_prefix":"9c180f733a5d21d9","entry":"poisson_subsample","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/data.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/data.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":"9c180f733a5d21d9"}},{"code_sha256_prefix":"cf9a23776086ea5a","entry":"rdp_to_approxdp","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/dp_accountant.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/dp_accountant.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":"cf9a23776086ea5a"}},{"code_sha256_prefix":"a3f04e7c0dcb75ed","entry":"sample_demos","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/data.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/data.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":"a3f04e7c0dcb75ed"}},{"code_sha256_prefix":"859460a043fd4d59","entry":"test_interface","repo":"VITA-Group/DP-OPT","repo_kind":"official","path":"web_demo.py","file_url":"https://github.com/VITA-Group/DP-OPT/blob/HEAD/web_demo.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"DEP_MISSING","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"859460a043fd4d59"}},{"code_sha256_prefix":"90e0f4319272b6de","entry":"train_interface","repo":"VITA-Group/DP-OPT","repo_kind":"official","path":"web_demo.py","file_url":"https://github.com/VITA-Group/DP-OPT/blob/HEAD/web_demo.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"DEP_MISSING","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"90e0f4319272b6de"}},{"code_sha256_prefix":"9795aa421d054e30","entry":"init_dataset","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/dln_data.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/dln_data.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":"9795aa421d054e30"}},{"code_sha256_prefix":"fd383ae7444969b9","entry":"openai_complete","repo":"vita-group/dp-opt","repo_kind":"official","path":"utils/evaluate.py","file_url":"https://github.com/vita-group/dp-opt/blob/HEAD/utils/evaluate.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":"fd383ae7444969b9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}