arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.05459cs.CR
收藏

PrivCode: 当代码生成遇见差分隐私

PrivCode: When Code Generation Meets Differential Privacy

University of Virginia(弗吉尼亚大学);Monash University and CSIRO’s Data61(蒙纳士大学和CSIRO数据61);Carnegie Mellon University(卡内基梅隆大学)

Zheng Liu, Chen Gong, Terry Yue Zhuo, Kecen Li, Weichen Yu, Matt Fredrikson, Tianhao Wang

AI总结:

PrivCode是一种专门设计用于代码数据集的差分隐私合成器,通过两阶段框架提升隐私和效用,生成高效用代码并保护敏感数据。

摘要:

大型语言模型(LLMs)在代码生成和补全方面表现出色。然而,对这些模型进行微调以适应私有数据集可能会引发隐私和专有性问题,例如敏感个人信息的泄露。差分隐私(DP)代码生成通过生成保留统计特性同时减少隐私泄露的合成数据集,为保护敏感代码提供了理论保障。然而,由于严格的语法依赖性和隐私-效用权衡,DP代码生成面临重大挑战。我们提出了PrivCode,这是首个专门针对代码数据集设计的DP合成器。它采用两阶段框架来提升隐私和效用。第一阶段称为

英文摘要:

Large language models (LLMs) have presented outstanding performance in code generation and completion. However, fine-tuning these models on private datasets can raise privacy and proprietary concerns, such as the leakage of sensitive personal information. Differentially private (DP) code generation provides theoretical guarantees for protecting sensitive code by generating synthetic datasets that preserve statistical properties while reducing privacy leakage concerns. However, DP code generation faces significant challenges due to the strict syntactic dependencies and the privacy-utility trade-off. We propose PrivCode, the first DP synthesizer specifically designed for code datasets. It incorporates a two-stage framework to improve both privacy and utility. In the first stage, termed "privacy-sanitizing", PrivCode generates DP-compliant synthetic code by training models using DP-SGD while introducing syntactic information to preserve code structure. The second stage, termed "utility-boosting", fine-tunes a larger pre-trained LLM on the synthetic privacy-free code to mitigate the utility loss caused by DP, enhancing the utility of the generated code. Extensive experiments on four LLMs show that PrivCode generates higher-utility code across various testing tasks under four benchmarks. The experiments also confirm its ability to protect sensitive data under varying privacy budgets. We provide the replication package at the code repository: https://github.com/Liuzzyg/PrivCode.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑