Towards hyperparameter-free optimization with differential privacy

Ruixuan Liu, Zhiqi Bu

Abstract

Training deep learning models under Differential Privacy (DP) constraints typically incurs a significant "privacy tax." Practitioners must either exhaust their limited privacy budget on hyperparameter tuning or accept sub-optimal model performance. This paper introduces HyFreeDP, a framework designed to eliminate manual hyperparameter tuning by automatically and privately estimating the optimal learning rate and clipping threshold. By leveraging the low-dimensional nature of loss functions, HyFreeDP achieves state-of-the-art results across vision and language tasks with negligible computational overhead.

Introduction

In standard deep learning, finding the optimal learning rate (LR) often requires extensive grid searching. In the context of Differential Privacy, this challenge is compounded. Hyperparameter tuning on private data is itself a privacy-leaking process; to maintain rigorous guarantees, a portion of the privacy budget ($\epsilon$) must be allocated to the tuning phase, leaving less budget for actual training.

Furthermore, DP-Stochastic Gradient Descent (DP-SGD) introduces a critical second hyperparameter: the clipping threshold ($R_g$). If $R_g$ is too small, the gradient signal is stifled; if it is too large, the injected noise—which scales with $R_g$—overwhelms the signal. HyFreeDP addresses these challenges by providing a truly hyperparameter-free DP optimization method that maintains high accuracy without sacrificing the privacy budget.

The HyFreeDP Framework

HyFreeDP combines two primary innovations to automate the optimization process:

1. Automatic Gradient Clipping

Rather than treating the clipping threshold $R_g$ as a hyperparameter to be tuned, HyFreeDP utilizes a technique where the threshold is effectively set to zero ($R_g \to 0^+$). This approach transforms standard clipping into per-sample gradient normalization. By normalizing the gradients, the algorithm removes the need to manually search for a stable $R_g$, simplifying the optimization landscape.

2. Privatized Learning Rate Estimation (GeN-DP)

To determine the learning rate ($\eta$) dynamically, the authors adapt the "Generalized Newton" (GeN) approach for private settings. GeN uses a Taylor expansion to approximate the loss function as a quadratic curve. By performing a few additional "probes" (forward passes) around the current model weights, the algorithm calculates the curvature of the loss and estimates the step size required to reach the local minimum.

3. Efficient Loss Privatization

Because the loss values used to estimate the LR are derived from private data, they must be privatized. HyFreeDP exploits the "Scalar Advantage": while gradients are high-dimensional (often millions of parameters), the loss is a single scalar. This allows the framework to spend the vast majority (~99%) of the privacy budget on gradients and a tiny fraction (<1%) on the loss. To minimize bias in these estimates, the authors implement an auto-regressive clipping threshold ($R_l$) for the loss values, which adapts based on previous privatized observations.

Experimental Evaluation

The researchers evaluated HyFreeDP across diverse architectures and tasks:

  • Computer Vision: Benchmarks on CIFAR-10, CIFAR-100, SVHN, GTSRB, and Food101 using Vision Transformers (ViT-Small and ViT-Base).
  • Natural Language Processing: Table-to-text (E2E) and abstract generation (PubMed) using GPT-2 and Llama2-7B.
  • Fine-tuning Methods: The framework was tested with full fine-tuning, BitFit (bias-only tuning), and Low-Rank Adaptation (LoRA).

Key Insights

  • Automated Scheduling: HyFreeDP naturally discovers an "increase-then-decrease" learning rate trajectory. This mirrors the manually engineered "warmup and decay" schedules used by human experts, but it emerges automatically from the loss curvature.
  • Performance vs. Manual Tuning: In several benchmarks, HyFreeDP matched or exceeded the performance of a "Non-DP Grid Search"—a theoretical baseline where the best LR is found without any privacy cost.
  • Scalability and Efficiency: The method scales to massive models like Llama2-7B. When updating the LR every $K=10$ steps, the computational overhead is approximately 10% compared to standard DP-SGD, a small price to pay compared to the cost of multiple grid-search training runs.

Conclusion and Limitations

HyFreeDP represents a significant step toward making private deep learning more accessible by removing the burden of hyperparameter tuning. While the method is robust, it still relies on a reasonable initial LR guess and the choice of the update interval $K$. Additionally, the quadratic approximation used for LR estimation assumes a relatively smooth loss surface, which may vary in more complex optimization landscapes. Future research may explore higher-order approximations to further refine the optimization process in chaotic environments.

Summary updated

BibTeX
@inproceedings{liu2025towards,
  author = {Ruixuan Liu and Zhiqi Bu},
  title = {{Towards hyperparameter-free optimization with differential privacy}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=2kGKsyhtvh},
}
Figure