Perturbation-efficient Zeroth-order Optimization for Hardware-friendly On-device Training

Qitao Tan, Sung-En Chang, Rui Xia, Huidong Ji, Chence Yang, Ci Zhang, Jun Liu, Zheng Zhan, Zhenman Fang, Zhuo Zou, Yanzhi Wang, Jin Lu, Geng Yuan

Abstract

Training large language models (LLMs) on edge devices is constrained by the memory overhead of backpropagation and the computational cost of high-quality random number generation required for zeroth-order (ZO) optimization. This paper introduces PeZO (Perturbation-efficient Zeroth-order Optimization), a framework that optimizes the random number bottleneck. By implementing innovative reuse strategies and replacing complex Gaussian generators with hardware-friendly uniform distributions and adaptive scaling, PeZO reduces power consumption by up to 86% and hardware resource usage by nearly 50% while maintaining accuracy within 0.5% of state-of-the-art baselines.

Introduction

On-device training for deep neural networks (DNNs) is essential for enhancing privacy and enabling personalization. However, traditional gradient-based training is often infeasible on resource-constrained hardware like FPGAs or ASICs due to the massive memory required to store activations and gradients. Zeroth-order (ZO) optimization offers a memory-efficient alternative by estimating gradients through forward passes with random weight perturbations.

Despite its memory benefits, standard ZO optimization introduces a new challenge: the "random number bottleneck." It requires a unique Gaussian random number for every model weight at every step, which is prohibitively expensive to generate on-chip. PeZO addresses this by bridging the gap between ZO algorithms and hardware reality.

Methodology

PeZO introduces two primary innovations to make ZO optimization hardware-friendly: random number reuse and adaptive modulus scaling.

Random Number Reuse Strategies

Instead of generating a unique number for every weight, PeZO utilizes two strategies to create diverse perturbations from a limited set of values:

  1. Pre-generation: A small pool of random numbers is stored in on-chip BRAM. These numbers are "shifted" or rotated to create unique perturbation patterns for different weights.
  2. On-the-fly Generation: A small array of simple generators produces numbers that are rotated and concatenated every clock cycle. This ensures irregularity and diversity without the overhead of thousands of independent generators.

Hardware-friendly Adaptive Modulus Scaling

Gaussian Random Number Generators (GRNGs) are complex to implement in hardware. PeZO replaces them with simple uniform generators (like LFSRs). To maintain the mathematical stability of Gaussian noise, PeZO applies an adaptive scaling factor so the uniform numbers' magnitude (modulus) matches the expected magnitude of a Gaussian distribution. These scaling factors are pre-computed and stored in a small Look-Up Table (LUT) for rapid access.

Experimental Evaluation

The researchers evaluated PeZO across several NLP benchmarks (SST-2, SST-5, TREC, MNLI, RTE, etc.) using multiple model architectures, including RoBERTa (base/large), OPT (1.3B/2.7B), and Llama-3 (1B/3B). The experiments focused on few-shot learning scenarios, which are highly relevant for on-device fine-tuning.

Key Insights

  • Scale Over Shape: Empirical results suggest that the specific shape of the noise distribution (Gaussian vs. Uniform) is less critical than the magnitude of the perturbation. Matching the expected modulus allows for hardware efficiency without sacrificing performance.
  • Precision Requirements: Larger models (e.g., OPT) require higher precision for random numbers (up to 14-bit) to prevent training collapse, whereas medium models (e.g., RoBERTa) perform well with 8-bit noise.

Results

PeZO demonstrates significant improvements in hardware efficiency and power consumption without compromising model performance.

  • Hardware Savings: PeZO reduced the required Look-Up Tables (LUTs) by 48.6% and Flip-Flops (FFs) by 12.7% compared to standard implementations of the MeZO algorithm.
  • Power and Speed: The framework achieved up to 86% power savings in the random number generation component and allowed hardware to run at a higher maximum frequency (700 MHz vs. 500 MHz).
  • Accuracy: Across most tasks, PeZO maintained accuracy within 0.5% of the hardware-heavy baseline, proving that high-fidelity noise is not strictly necessary for effective ZO optimization.

Conclusion

PeZO makes on-device training of large language models practical by solving the computational overhead of random number generation. While currently focused on NLP, future work may extend these strategies to computer vision and integrate PeZO with other parameter-efficient fine-tuning methods like LoRA to further optimize edge learning.

Summary updated

BibTeX
@inproceedings{tan2025perturbation,
  author = {Qitao Tan and Sung-En Chang and Rui Xia and Huidong Ji and Chence Yang and Ci Zhang and Jun Liu and Zheng Zhan and Zhenman Fang and Zhuo Zou and Yanzhi Wang and Jin Lu and Geng Yuan},
  title = {{Perturbation-efficient Zeroth-order Optimization for Hardware-friendly On-device Training}},
  booktitle = {ICCAD},
  year = {2025},
}
Figure