{"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/large-language-models-can-be-good-privacy","title":"PrivacyMind: Large Language Models Can Be Contextual Privacy Protection Learners","arxiv_id":"2310.02469","date":"2023-10-03","proceeding":null,"authors":["Yijia Xiao","Yiqiao Jin","Yushi Bai","Yue Wu","Xianjun Yang","Xiao Luo","Wenchao Yu","Xujiang Zhao","Yanchi Liu","Quanquan Gu","Haifeng Chen","Wei Wang","Wei Cheng"],"abstract":"The proliferation of Large Language Models (LLMs) has driven considerable interest in fine-tuning them with domain-specific data to create specialized language models. Nevertheless, such domain-specific fine-tuning data often contains contextually sensitive personally identifiable information (PII). Direct fine-tuning of LLMs on this data without privacy protection poses a risk of data leakage of sensitive PII during inference time. To address this challenge, we introduce Contextual Privacy Protection Language Models (PrivacyMind), a novel paradigm for fine-tuning LLMs that effectively injects domain-specific knowledge while safeguarding inference-time data privacy. Our work offers a theoretical analysis for model design and benchmarks various techniques such as corpus curation, penalty-based unlikelihood in training loss, instruction-based tuning, etc. Extensive experiments across diverse datasets and scenarios demonstrate the effectiveness of our approaches. In particular, instruction tuning with both positive and negative examples stands out as a promising method, effectively protecting private data while enhancing the model's knowledge. Our work underscores the potential for Large Language Models as robust contextual privacy protection learners. The complete code and data for the work can be found at https://github.com/Yijia-Xiao/PrivacyMind.","url_abs":"https://arxiv.org/abs/2310.02469v3","url_pdf":"https://arxiv.org/pdf/2310.02469v3.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":"large-language-models-can-be-good-privacy","repo_url":"https://github.com/yijia-xiao/pplm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"large-language-models-can-be-good-privacy","repo_url":"https://github.com/yijia-xiao/privacymind","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2310.02469","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.02469"}},"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/yijia-xiao/privacymind","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yijia-xiao/pplm","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":2,"unverified":2},"by_repo_kind":{"official":{"samples":4,"ran":2,"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":4,"samples":[{"code_sha256_prefix":"b4c052fb373aef07","entry":"load_llama_from_config","repo":"yijia-xiao/pplm","repo_kind":"official","path":"inference/model_utils.py","file_url":"https://github.com/yijia-xiao/pplm/blob/HEAD/inference/model_utils.py","link_basis":"harvester_set","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":"b4c052fb373aef07"}},{"code_sha256_prefix":"6d5ba8546b6aad2c","entry":"load_peft_model","repo":"yijia-xiao/pplm","repo_kind":"official","path":"inference/model_utils.py","file_url":"https://github.com/yijia-xiao/pplm/blob/HEAD/inference/model_utils.py","link_basis":"harvester_set","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":"6d5ba8546b6aad2c"}},{"code_sha256_prefix":"efea256714a4cb99","entry":"load_model","repo":"yijia-xiao/pplm","repo_kind":"official","path":"inference/model_utils.py","file_url":"https://github.com/yijia-xiao/pplm/blob/HEAD/inference/model_utils.py","link_basis":"harvester_set","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":"efea256714a4cb99"}},{"code_sha256_prefix":"abd14de7398ccffe","entry":"load_sharded_model_single_gpu","repo":"yijia-xiao/pplm","repo_kind":"official","path":"model_checkpointing/checkpoint_handler.py","file_url":"https://github.com/yijia-xiao/pplm/blob/HEAD/model_checkpointing/checkpoint_handler.py","link_basis":"harvester_set","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":"abd14de7398ccffe"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}