arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2601.22935cs.CRcs.AI
收藏

在IDE自动补全中使用差分隐私保护私有代码

Protecting Private Code in IDE Autocomplete using Differential Privacy

JetBrains Research(JetBrains研究)

Evgeny Grigorenko, David Stanojević, David Ilić, Egor Bogomolov, Kostadin Cvejoski

AI总结:

本文提出利用差分隐私保护IDE自动补全中用户代码隐私,通过DP训练模型有效防御成员推断攻击,同时保持模型性能。

摘要:

现代集成开发环境(IDEs)越来越多地利用大型语言模型(LLMs)提供高级功能,如代码自动补全。尽管强大,但这些模型在用户编写代码上进行训练会引入显著的隐私风险,使模型本身成为一种新的数据漏洞。恶意行为者可以利用这一点通过发起攻击来重建敏感的训练数据或推断特定代码片段是否用于训练。本文研究了将差分隐私(DP)作为训练Kotlin代码补全LLM的稳健防御机制的使用。我们通过DP对Mellum模型进行微调,并对其隐私和实用性进行了全面评估。我们的结果表明,DP对成员推断攻击(MIAs)提供了强大的防御,将攻击的成功率降低到接近随机猜测(AUC从0.901降至0.606)。此外,我们还显示,这种隐私保障对模型性能的代价很小,DP训练的模型在训练数据减少100倍的情况下,实用性得分与非隐私模型相当。我们的发现表明,DP是构建私有且可信的人工智能驱动的IDE功能的实用且有效的解决方案。

英文摘要:

Modern Integrated Development Environments (IDEs) increasingly leverage Large Language Models (LLMs) to provide advanced features like code autocomplete. While powerful, training these models on user-written code introduces significant privacy risks, making the models themselves a new type of data vulnerability. Malicious actors can exploit this by launching attacks to reconstruct sensitive training data or infer whether a specific code snippet was used for training. This paper investigates the use of Differential Privacy (DP) as a robust defense mechanism for training an LLM for Kotlin code completion. We fine-tune a \texttt{Mellum} model using DP and conduct a comprehensive evaluation of its privacy and utility. Our results demonstrate that DP provides a strong defense against Membership Inference Attacks (MIAs), reducing the attack's success rate close to a random guess (AUC from 0.901 to 0.606). Furthermore, we show that this privacy guarantee comes at a minimal cost to model performance, with the DP-trained model achieving utility scores comparable to its non-private counterpart, even when trained on 100x less data. Our findings suggest that DP is a practical and effective solution for building private and trustworthy AI-powered IDE features.

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

↑