ZOQO: Zero-Order Quantized Optimization

Noga Bar, Raja Giryes · DOI

TL;DR

ZOQO (Zero-Order Quantized Optimization) is a novel framework that enables training and fine-tuning deep learning models using only quantized operations and forward passes. By eliminating the need for backpropagation and full-precision gradient storage, ZOQO significantly reduces the computational and memory footprint of model optimization, making it viable for extreme resource-constrained environments like edge devices.

What Problem Does This Paper Address?

The "arms race" in deep learning has led to models that are increasingly massive, demanding immense computational power and memory. While researchers have tackled this using two main strategies—Quantization (using low-precision numbers) and Zero-Order (ZO) Optimization (estimating gradients using only forward passes to avoid backpropagation)—these two fields have largely remained separate.

Existing "quantization-aware training" methods often still rely on high-precision (floating-point) calculations for gradients and parameter updates. Conversely, standard ZO methods typically use continuous Gaussian noise and floating-point updates. This paper addresses the gap: How do we perform optimization when everything—from the parameters to the update steps—must stay within a low-precision, quantized format?

Methods

The authors introduce ZOQO, which builds upon the ZO-SignSGD algorithm. Standard ZO-SignSGD estimates the sign of a gradient by perturbing parameters with noise and observing the change in loss.

The ZOQO framework (right) compared to standard full-precision parameter updates (left).

As illustrated in Figure 1, ZOQO introduces two critical adaptations to make this fully quantized:

  1. Quantized Noise Injection: Instead of using normally distributed (Gaussian) noise, which is continuous and requires high precision, ZOQO samples noise from a discrete set of quantized steps ($u_t$). This ensures that the "perturbed" model used for gradient estimation remains strictly within the quantized domain.
  2. Quantized Learning Rate Scaling: The learning rate is adjusted to be a multiple of the quantization scale. This ensures that when a parameter is updated, it "lands" exactly on another valid quantized value, preventing the accumulation of rounding errors that would otherwise require floating-point precision to track.

By using only the sign of the loss difference between two forward passes, the method avoids the need to store or calculate high-precision gradient vectors ($O(d)$ memory savings).

Datasets

The authors evaluated ZOQO across two distinct domains:

  • Adversarial Attacks: Tested on MNIST, CIFAR-10, and ImageNet (using Inception v3). They used these datasets to see if a quantized attacker could successfully find "blind spots" in models.
  • LLM Fine-tuning: Used the SST2 (Stanford Sentiment Treebank) dataset to fine-tune the OPT-1.3b large language model using LoRA (Low-Rank Adaptation).

Key Insights and Ideas

  • "Sign is Enough": One of the most powerful realizations is that you don't need the exact value of the loss to update a model; you only need to know if a perturbation made the loss go up or down. This "comparison-based" approach is inherently more robust to the noise introduced by quantization.
  • Discrete Noise Works: The paper demonstrates that the "smoothness" of Gaussian noise isn't strictly necessary for gradient estimation. Discretized noise, if scaled correctly, provides a sufficient approximation for the gradient sign.
  • Memory Efficiency: Because ZOQO doesn't store full-precision gradients or optimizer states (like Adam's moments), the memory savings are massive.
  • Vulnerability Exposure: The results show that quantized models are highly vulnerable to black-box attacks, even when the attacker is also operating under strict quantization constraints.

Key Results

  • Adversarial Robustness: In black-box attacks, ZOQO achieved failure rates comparable to full-precision (FP) methods. For example, on MNIST with 8-bit quantization, ZOQO's performance was nearly identical to the FP baseline.
  • LLM Fine-tuning: When fine-tuning OPT-1.3b on SST2, ZOQO at 8-bit achieved 89.68% accuracy, coming remarkably close to the full-precision ZO-Sign baseline of 91.28%. At 4-bit quantization, ZOQO significantly outperformed "naive" approaches, maintaining performance (64.34%) where other methods saw accuracy collapse.
  • Hardware Friendly: A simulation of a 3-layer network showed that ZOQO significantly reduced peak memory usage.
Extracted table from page 4 of ZOQO: Zero-Order Quantized Optimization

As shown in Figure 5, peak memory usage dropped from 903.71 MB (FP) to 371.21 MB (ZOQO), a reduction of nearly 60%.

Limitations and Future Work

  • The 4-bit Gap: While ZOQO performs better than baselines at 4-bit, there is still a significant performance drop compared to 8-bit or FP. Aggressive quantization remains a challenge for complex tasks like LLM fine-tuning.
  • Loss Calculation: The current framework still assumes the loss function itself (e.g., Cross-Entropy) is calculated in higher precision, even if the model's internal operations are quantized.
  • Future Directions: The authors suggest exploring "human comparison feedback" as a way to further remove the need for exact loss calculations. They also aim to develop a more rigorous convergence theory for quantized zero-order methods.

Summary updated

BibTeX
@inproceedings{bar2025zoqo,
  author = {Noga Bar and Raja Giryes},
  title = {{ZOQO: Zero-Order Quantized Optimization}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2025},
  doi = {10.1109/icassp49660.2025.10887815},
}
Figure