Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

PrivCode++: Latent-Conditioned Differentially Private Code Generation for Comprehensive Guarantees

About

Large language models fine-tuned on instruction-code pairs may memorize and subsequently leak sensitive training data. Existing differentially private (DP) code generation methods primarily protect code snippets while assuming prompts are public, which fails in realistic scenarios where prompts may also contain sensitive information. When prompts cannot be explicitly learned or used during generation, code synthesis suffers from severe utility degradation as well as reduced diversity and fidelity. To address these challenges, we propose PrivCode-Plus, the first work to explore DP code generation where both prompts and code snippets are considered sensitive in LLM fine-tuning. PrivCode-Plus introduces a two-stage DP framework with a Privacy-Free Latent Conditioning module, enabling effective DP fine-tuning and data synthesis without direct access to sensitive prompts or code. Extensive experiments show that PrivCode-Plus achieves substantially higher utility than baselines, remains competitive with the method with relaxing privacy assumptions, and provides stronger privacy guarantees.

Zheng Liu, Chen Gong, Terry Yue Zhuo, Zhou Yang, Kecen Li, Wenlong Meng, Xinwen Hou, Yu Liu, Xiaochen Li• 2026

Related benchmarks

TaskDatasetResultRank
Canary Leakage EvaluationJoint Canary (train)
Leakage Rate0.00e+0
36
Canary Leakage EvaluationPrompt Canary (train)
Leakage Rate0.00e+0
36
Canary Leakage EvaluationCode Canary (train)
Leakage Rate0.00e+0
36
Code GenerationC++ code generation tasks (test)
Pass@122.6
24
Code GenerationRust
Pass@145.7
9
Code GenerationJava code generation
Pass@153.7
9
Membership Inference AttackMembership Inference Attack
TPR @ 10% FPR3.7
6
Synthetic Code Generation FidelityOriginal Code Dataset
BLEU-40.0162
3
Showing 8 of 8 rows

Other info

Follow for update