arXiv:2507.01154cs.LGcs.CR2025-07被引 2

提出高效私有训练大模型的新方法,显著降低内存和计算开销。

FlashDP: Private Training Large Language Models with Efficient DP-SGD

  • 将梯度计算与裁剪融合为单次任务,减少重复计算。
  • 相比旧方法内存移动减少50%,冗余计算降低20%。
  • 在保持隐私和精度前提下,训练吞吐率达非私有方法的90%。

随着大语言模型(LLMs)在技术进步中扮演愈发关键角色,其训练数据的隐私保护成为核心关切。差分隐私(DP)作为严格的保护机制,通过差分私有随机梯度下降(DP-SGD)实现,但面临每样本梯度裁剪带来的复杂性挑战。现有显式方法(如Opacus)需存储大量逐样本梯度,大幅增加内存开销;隐式方法(如GhostClip)虽减少存储,却因多次重新计算梯度导致计算效率低下。本文提出FlashDP,一种面向层的缓存友好型DP-SGD方法,将必要操作融合为单一任务,仅进行一次梯度计算。该方法使内存移动减少高达50%,冗余计算降低20%,且不增加内存需求。在四张A100系统上预训练Llama-13B模型时,其吞吐量达到非私有方法的90%,同时在准确率上与标准逐层裁剪的DP-SGD持平。这一成果为高效、可扩展的私有化大模型训练提供了关键进展。代码已开源:https://github.com/kaustpradalab/flashdp。

原文摘要 · Abstract (English)

As large language models (LLMs) increasingly underpin technological advancements, the privacy of their training data emerges as a critical concern. Differential Privacy (DP) serves as a rigorous mechanism to protect this data, yet its integration via Differentially Private Stochastic Gradient Descent (DP-SGD) introduces substantial challenges, primarily due to the complexities of per-sample gradient clipping. Current explicit methods, such as Opacus, necessitate extensive storage for per-sample gradients, significantly inflating memory requirements. Conversely, implicit methods like GhostClip reduce storage needs by recalculating gradients multiple times, which leads to inefficiencies due to redundant computations. This paper introduces FlashDP, an innovative cache-friendly per-layer DP-SGD that consolidates necessary operations into a single task, calculating gradients only once in a fused manner. This approach not only diminishes memory movement by up to \textbf{50\%} but also cuts down redundant computations by \textbf{20\%}, compared to previous methods. Consequently, FlashDP does not increase memory demands and achieves a \textbf{90\%} throughput compared to the Non-DP method on a four-A100 system during the pre-training of the Llama-13B model, while maintaining parity with standard per-layer clipped DP-SGD in terms of accuracy. These advancements establish FlashDP as a pivotal development for efficient and privacy-preserving training of LLMs. FlashDP's code has been open-sourced in https://github.com/kaustpradalab/flashdp.

隐私训练大模型差分隐私高效算法

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。