用随机投影替代梯度奇异值分解,大幅降低差分隐私训练内存开销。
Memory-Efficient Differentially Private Training with Gradient Random Projection
- 用随机高斯矩阵替代SVD子空间,避免昂贵计算
- 预训练ViT内存减少63%以上,微调RoBERTa-Large减70%以上
- 可支持高达67亿参数模型的差分隐私微调,适合大模型场景
差分隐私(DP)保护神经网络训练中的敏感数据,但标准方法如DP-Adam因每样本梯度裁剪导致高内存开销,限制了可扩展性。我们提出DP-GRAPE(Gradient RAndom ProjEction),一种显著降低内存使用且保持与一阶DP方法相当性能的DP训练方法。其动机源于发现隐私化会平滑梯度奇异值谱,使基于SVD的投影(如GaLore (Zhao et al., 2024))不再必要。因此,DP-GRAPE采用三个关键设计:(1) 用随机高斯矩阵替代SVD子空间;(2) 投影后才进行梯度隐私化;(3) 在反向传播中应用投影。这些改进消除了昂贵的SVD计算,实现显著内存节省并提升实用性。尽管在低维子空间运行,理论分析表明其隐私-效用权衡与DP-SGD相当。大量实验证明,DP-GRAPE能显著降低DP训练内存开销而不牺牲准确率或训练时间。尤其在预训练Vision Transformers时内存减少超63%,微调RoBERTa-Large时减少超70%,性能相近。我们进一步证明其可扩展至含67亿参数的OPT模型微调,而传统DP-Adam因内存限制无法实现。代码已开源:https://github.com/alexmul1114/DP_GRAPE。
原文摘要 · Abstract (English)
Differential privacy (DP) protects sensitive data during neural network training, but standard methods like DP-Adam suffer from high memory overhead due to per-sample gradient clipping, limiting scalability. We introduce DP-GRAPE (Gradient RAndom ProjEction), a DP training method that significantly reduces memory usage while maintaining utility on par with first-order DP approaches. DP-GRAPE is motivated by our finding that privatization flattens the gradient singular value spectrum, making SVD-based projections (as in GaLore (Zhao et al., 2024)) unnecessary. Consequently, DP-GRAPE employs three key components: (1) random Gaussian matrices replace SVD-based subspaces, (2) gradients are privatized after projection, and (3) projection is applied during backpropagation. These contributions eliminate the need for costly SVD computations, enable substantial memory savings, and lead to improved utility. Despite operating in lower-dimensional subspaces, our theoretical analysis shows that DP-GRAPE achieves a privacy-utility tradeoff comparable to DP-SGD. Our extensive empirical experiments show that DP-GRAPE can significantly reduce the memory footprint of DP training without sacrificing accuracy or training time. In particular, DP-GRAPE reduces memory usage by over 63% when pre-training Vision Transformers and over 70% when fine-tuning RoBERTa-Large as compared to DP-Adam, while achieving similar performance. We further demonstrate that DP-GRAPE scales to fine-tuning large models such as OPT with up to 6.7 billion parameters, a scale at which DP-Adam fails due to memory constraints. Our code is available at https://github.com/alexmul1114/DP_GRAPE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。