利用差分隐私保护IDE自动补全中的私有代码 Protecting Private Code in IDE Autocomplete using Differential Privacy 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-01-30
👁️ 预览文献
💡 AI 中文简介
本研究探讨了在IDE代码自动补全功能中,如何利用差分隐私(DP)技术保护用户代码隐私。研究者对Mellum模型进行微调,用于Kotlin代码补全,并评估其隐私与效用。结果表明,DP能有效抵御成员推理攻击,将攻击成功率从0.901降至0.606,接近随机猜测,同时模型性能几乎不受影响,即使训练数据减少100倍,效用仍与非隐私模型相当。这表明DP是一种实用且有效的解决方案,可构建私密且可信的AI驱动IDE功能。
领域隐私保护机器学习 / 软件工程
适合谁读需要一定专业背景(了解差分隐私、语言模型和代码补全)
核心贡献1. 首次将差分隐私应用于Kotlin代码补全任务,并系统评估其隐私与效用权衡;2. 证明差分隐私能显著降低成员推理攻击成功率,且模型性能损失极小,甚至在使用100倍更少数据时仍保持可比效用。
关键数据成员推理攻击AUC从0.901降至0.606;DP模型在100倍更少数据下效用与非隐私模型相当。
推荐理由如果你关心AI编程助手如何保护你的代码隐私,这篇论文给出了一个既安全又实用的答案。
关键词["差分隐私", "代码自动补全", "大型语言模型", "成员推理攻击", "隐私保护", "集成开发环境"]

原文摘要

查看英文原文摘要

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.