Differentially Private Zeroth-Order Methods for Scalable Large Language Model Finetuning

📄 arXiv: 2402.07818v6 📥 PDF

作者: Z Liu, J Lou, W Bao, Y Hu, B Li, Z Qin, K Ren

分类: cs.LG, cs.AI, cs.CL

发布日期: 2024-02-12 (更新: 2025-03-10)


💡 一句话要点

提出差分隐私零阶方法以提升大语言模型微调效率

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 差分隐私 大语言模型 微调 零阶方法 可扩展性 隐私保护 自然语言处理

📋 核心要点

  1. 现有的DP-SGD方法在微调大语言模型时存在固有的低效性,限制了其在大规模任务中的应用。
  2. 本文提出了一种新的阶段性DP零阶方法(DP-ZOSO),通过动态调度超参数来优化微调过程,提升效率。
  3. 实验结果表明,与DPZero相比,DP-ZOPO在多个任务上显著提升了性能,如在SST-5上提高4.5%,在MNLI上提高5.5%。

📝 摘要(中文)

在特定任务数据集上进行微调是利用预训练大语言模型(LLMs)强大能力的普遍方法。由于微调的普及及其隐私问题,差分隐私(DP)微调已广泛应用于保护任务特定数据集的隐私。现有方法多基于DP-SGD,尽管在可扩展性上取得了一定进展,但DP-SGD的固有低效性限制了其应用。本文探讨了DP零阶方法在LLM微调中的潜力,通过更高效的零阶梯度近似,避免了SGD的可扩展性瓶颈。我们提出了动态调度关键超参数的阶段性DP零阶方法(DP-ZOSO),并在理论和实证上进行了全面研究,展示了其在可扩展性和效用上的显著提升。

🔬 方法详解

问题定义:本文旨在解决现有DP-SGD方法在大语言模型微调中的低效性问题,尤其是在处理大规模数据集时的可扩展性瓶颈。

核心思路:提出DP零阶方法,通过近似梯度计算,避免了SGD的固有低效性。设计了阶段性DP零阶方法(DP-ZOSO),动态调度超参数以优化微调过程。

技术框架:整体架构包括两个主要模块:第一,DP随机扰动与零阶方法的梯度近似相结合;第二,动态调度超参数以适应不同的微调阶段。

关键创新:最重要的创新在于提出了DP-ZOSO方法,通过动态调度超参数,提升了微调的效率和效果,区别于传统的静态超参数设置。

关键设计:关键设计包括超参数的动态调度策略、损失函数的选择,以及在不同任务中采用的网络结构调整,以适应不同的微调需求。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,DP-ZOPO在多个任务上均表现出色,相较于基线DPZero,在SST-5上提升4.5%,在MNLI上提升5.5%,在更复杂的任务上如CB和BoolQ也分别提升了9.2%和3.9%。这些结果表明该方法在可扩展性和效用上的显著优势。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的各种任务,如文本分类、问答系统和对话生成等。通过提升大语言模型的微调效率,能够更好地保护用户隐私,同时提高模型在特定任务上的性能,具有重要的实际价值和广泛的应用前景。

📄 摘要(原文)

Fine-tuning on task-specific datasets is a widely-embraced paradigm of harnessing the powerful capability of pretrained LLMs for various downstream tasks. Due to the popularity of LLMs fine-tuning and its accompanying privacy concerns, differentially private (DP) fine-tuning of pretrained LLMs has been widely used to safeguarding the privacy of task-specific datasets. Lying at the design core of DP LLM fine-tuning methods is the satisfactory tradeoff among privacy, utility, and scalability. Most existing methods build upon the seminal work of DP-SGD. Despite pushing the scalability of DP-SGD to its limit, DP-SGD-based fine-tuning methods are unfortunately limited by the inherent inefficiency of SGD. In this paper, we investigate the potential of DP zeroth-order methods for LLM pretraining, which avoids the scalability bottleneck of SGD by approximating the gradient with the more efficient zeroth-order gradient. Rather than treating the zeroth-order method as a drop-in replacement for SGD, this paper presents a comprehensive study both theoretically and empirically. First, we propose the stagewise DP zeroth-order method (DP-ZOSO) that dynamically schedules key hyperparameters. This design is grounded on the synergy between DP random perturbation and the gradient approximation error of the zeroth-order method, and its effect on fine-tuning trajectory. We provide theoretical analysis for both proposed methods. We conduct extensive empirical analysis on both encoder-only masked language model and decoder-only autoregressive language model, achieving impressive results in terms of scalability and utility regardless of the class of tasks (compared with DPZero, DP-ZOPO improves $4.5\%$ on SST-5, $5.5\%$ on MNLI with RoBERTa-Large and 9.2\% on CB, 3.9\% on BoolQ with OPT-2.7b when $ε=4$, demonstrates more significant enhancement in performance on more complicated tasks).