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

Zheng Liu, Chen Gong, Terry Yue Zhuo, Zhou Yang, Kecen Li, Wenlong Meng, Xinwen Hou, Yu Liu, Xiaochen Li
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:76332-76353, 2026.

Abstract

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++, the first work to explore DP code generation where both prompts and code snippets are considered sensitive in LLM fine-tuning. PrivCode++ 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++ achieves substantially higher utility than baselines, remains competitive with the method with relaxing privacy assumptions, and provides stronger privacy guarantees.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-liu26ao, title = {{P}riv{C}ode++: Latent-Conditioned Differentially Private Code Generation for Comprehensive Guarantees}, author = {Liu, Zheng and Gong, Chen and Zhuo, Terry Yue and Yang, Zhou and Li, Kecen and Meng, Wenlong and Hou, Xinwen and Liu, Yu and Li, Xiaochen}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {76332--76353}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/liu26ao/liu26ao.pdf}, url = {https://proceedings.mlr.press/v306/liu26ao.html}, abstract = {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++, the first work to explore DP code generation where both prompts and code snippets are considered sensitive in LLM fine-tuning. PrivCode++ 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++ achieves substantially higher utility than baselines, remains competitive with the method with relaxing privacy assumptions, and provides stronger privacy guarantees.} }
Endnote
%0 Conference Paper %T PrivCode++: Latent-Conditioned Differentially Private Code Generation for Comprehensive Guarantees %A Zheng Liu %A Chen Gong %A Terry Yue Zhuo %A Zhou Yang %A Kecen Li %A Wenlong Meng %A Xinwen Hou %A Yu Liu %A Xiaochen Li %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-liu26ao %I PMLR %P 76332--76353 %U https://proceedings.mlr.press/v306/liu26ao.html %V 306 %X 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++, the first work to explore DP code generation where both prompts and code snippets are considered sensitive in LLM fine-tuning. PrivCode++ 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++ achieves substantially higher utility than baselines, remains competitive with the method with relaxing privacy assumptions, and provides stronger privacy guarantees.
APA
Liu, Z., Gong, C., Zhuo, T.Y., Yang, Z., Li, K., Meng, W., Hou, X., Liu, Y. & Li, X.. (2026). PrivCode++: Latent-Conditioned Differentially Private Code Generation for Comprehensive Guarantees. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:76332-76353 Available from https://proceedings.mlr.press/v306/liu26ao.html.

Related Material