DPZero: Private Fine-Tuning of Language Models without Backpropagation

Liang Zhang,Bingcong Li,Kiran Koshy Thekumparampil,Sewoong Oh,Niao He
2024-06-06
Abstract:The widespread practice of fine-tuning large language models (LLMs) on domain-specific data faces two major challenges in memory and privacy. First, as the size of LLMs continues to grow, the memory demands of gradient-based training methods via backpropagation become prohibitively high. Second, given the tendency of LLMs to memorize training data, it is important to protect potentially sensitive information in the fine-tuning data from being regurgitated. Zeroth-order methods, which rely solely on forward passes, substantially reduce memory consumption during training. However, directly combining them with standard differentially private gradient descent suffers more as model size grows. To bridge this gap, we introduce DPZero, a novel private zeroth-order algorithm with nearly dimension-independent rates. The memory efficiency of DPZero is demonstrated in privately fine-tuning RoBERTa and OPT on several downstream tasks. Our code is available at <a class="link-external link-https" href="https://github.com/Liang137/DPZero" rel="external noopener nofollow">this https URL</a>.
Machine Learning,Cryptography and Security,Optimization and Control
What problem does this paper attempt to address?
The problems that this paper attempts to solve mainly focus on two major challenges in the fine - tuning process of large - language models (LLMs): memory requirements and privacy protection. 1. **Memory Requirement Problem**: - As the scale of LLMs continues to increase, the memory required for gradient - based training methods (such as backpropagation) becomes extremely high and, in some cases, cannot be carried out on existing hardware. This limits the wide application of LLMs, especially in resource - limited environments. - The paper points out that zeroth - order methods significantly reduce memory consumption during training by relying only on forward passes, thus solving this problem. 2. **Privacy Protection Problem**: - LLMs tend to memorize training data, which may lead to the leakage of sensitive information during the fine - tuning process. Therefore, it is crucial to protect potential sensitive information in the fine - tuning data. - Differential Privacy (DP) is a widely accepted mathematical framework for ensuring privacy and preventing attackers from identifying entities participating in training. However, most existing differential privacy optimization methods focus on first - order algorithms, and directly combining standard differential privacy gradient descent with zeroth - order methods will perform worse as the model scale increases. To solve the above problems, the paper introduces a new private zeroth - order algorithm **DPZero**, which has a convergence rate that is almost independent of dimension. Specifically: - **DPZero** demonstrates its memory efficiency when privatizing and fine - tuning models such as RoBERTa and OPT. - The algorithm overcomes the dimension - dependence of traditional methods through the following two key insights: 1. **Scalar Privacy Noise**: Decompose the zeroth - order gradient into direction and magnitude, and only privatize the magnitude, while the direction is public information. This significantly improves the performance of the algorithm. 2. **Tighter Clipping Threshold**: By more precisely analyzing the upper bound of the finite - difference term, select a smaller clipping threshold, thereby further reducing the impact of noise. Overall, the goal of the paper is to develop an efficient algorithm that can save memory and protect privacy when fine - tuning large - scale language models. The proposal of DPZero provides an innovative solution to these two key problems.