ZoAQ: Adaptive Zeroth-Order Querying via Query-Reuse Coupling
Organizations: The Hong Kong University of Science and Technology (Guangzhou)
Abstract
Zeroth-order optimization (ZOO) estimates updates from function evaluations, making perturbation queries a primary cost. Fixed budgets spend the same number of queries at every step, while adaptive controllers may offset their savings by using additional oracle calls to test estimator reliability. We introduce ZoAQ, an adaptive ZOO method built around query reuse. Rather than discarding past evaluations after each step, ZoAQ makes them useful for both the next update and the decision to query further. This enables adaptive query allocation without extra validation queries. Our analysis characterizes when this agreement identifies an update that supports descent and guides the controller to a sufficient query budget. On synthetic objectives, ZoAQ reduces queries by 43-48% relative to fixed baselines using 1.2M queries. In black-box attacks, it reaches 100% success with 320 and 625 average queries on MNIST and CIFAR-10, respectively. Across four OPT fine-tuning settings, ZoAQ saves 43-46% forward evaluations relative to fixed K=4, with accuracy changes within tasks ranging from -0.018 to +0.010.
Figures & tables
| Dataset | R-AdaZO ( ) | StatZO ( ) | ZoAQ ( ) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Success | Avg | Std | Speedup | Success | Avg | Std | Speedup | Success | Avg | Std | Speedup | |
| MNIST | 100% | 1,527 | 701 | 1.00 | 100% | 1,996 | 1,231 | 0.77 | 100% | 320 | 45 | 4.77 |
| CIFAR-10 | 100% | 1,006 | 100 | 1.00 | 100% | 964 | 28 | 1.04 | 100% | 625 | 15 | 1.61 |
| Model | Task | Method | Total FE | FE Savings | Best Eval Loss | Accuracy |
|---|---|---|---|---|---|---|
| OPT-1.3B | SST-2 | R-AdaZO | 40000 0 | 0.00 0.00% | 0.198 0.002 | 0.920 0.004 |
| StatZO | 30746 412 | 23.14 1.03% | 0.206 0.005 | 0.910 0.007 | ||
| ZoAQ | 21714 318 | 45.72 0.80% | 0.195 0.003 | 0.920 0.005 | ||
| COPA | R-AdaZO | 40000 0 | 0.00 0.00% | 0.431 0.004 | 0.780 0.010 | |
| StatZO | 30498 505 | 23.76 1.26% | 0.461 0.007 | 0.790 0.014 | ||
| ZoAQ | 21946 345 | 45.14 0.86% | 0.485 0.005 | 0.790 0.012 |
Appendix figures & tables28 assets
Supplementary material from the paper’s appendix.
Appendix
| Success | Avg | Std | Speedup vs ZoAQ | |
|---|---|---|---|---|
| 2 | 100% | 6,212 | 675 | 0.05 |
| 4 | 100% | 4,382 | 511 | 0.07 |
| 6 | 100% | 7,349 | 1,714 | 0.04 |
| 8 | 100% | 7,424 | 588 | 0.04 |
| 10 | 100% | 10,022 | 1,316 | 0.03 |
| Success | Avg | Std | Speedup vs ZoAQ | |
|---|---|---|---|---|
| 2 | 100% | 1,996 | 1,231 | 0.16 |
| 4 | 100% | 4,089 | 953 | 0.08 |
| 6 | 100% | 5,137 | 2,004 | 0.06 |
| 8 | 100% | 3,937 | 1,802 | 0.08 |
| 10 | 100% | 4,572 | 2,189 | 0.07 |
| Success | Avg Queries | Std | Speedup vs ZoAQ | |
|---|---|---|---|---|
| 2 | 100% | 964 | 28 | 0.65 |
| 4 | 100% | 1,134 | 73 | 0.55 |
| 6 | 100% | 1,148 | 37 | 0.54 |
| 8 | 100% | 1,229 | 68 | 0.51 |
| 10 | 100% | 1,361 | 41 | 0.46 |
| Regime | Evidence used | Claim boundary |
|---|---|---|
| Synthetic mechanisms | Convergence traces, sweep over fixed budgets, ablation of the norm trigger, and cosine diagnostics. | Query reductions are measured relative to the fixed protocol using 1.2M queries; cosine diagnostics measure observable consistency with the anchor. |
| Black-box attacks | MNIST and CIFAR-10 attacks under a common stabilized R-AdaZO backbone. | The result concerns black-box optimization under query constraints, with success and query counts reported under the stated protocol. |
| LLM fine-tuning | OPT-1.3B and OPT-13B LoRA fine-tuning measured by cumulative forward evaluations and task metrics. | Savings are FE reductions with loss and accuracy trade-offs that vary by task. |
| Stress checks | Controlled objective switch, history window, reset policy, threshold, and StatZO diagnostics. | These checks show how the mechanism behaves across the tested settings and parameter choices. |
| Asset | Version | Source | License | Terms-of-use note |
|---|---|---|---|---|
| MNIST | Original train/test split | MNIST database ( LeCun et al. 1998 ) | Source terms; no explicit single license | Public benchmark use; no data redistribution |
| CIFAR-10 | CIFAR-10 Python version | CIFAR page and report ( Krizhevsky & Hinton 2009 ) | Source terms; no explicit single license | Public benchmark use; no data redistribution |
| GLUE/SST-2 | GLUE SST-2 task | GLUE benchmark ( Wang et al. 2018 ) | GLUE/SST-2 source terms | Downstream evaluation only |
| COPA | COPA benchmark task | COPA release ( Roemmele et al. 2011 ) | COPA source terms | Downstream evaluation only |
| OPT checkpoints | OPT-1.3B and OPT-13B | Meta OPT release ( Zhang et al. 2022 ) ; HF cards | OPT model license | LoRA fine-tuning; no checkpoint redistribution |
| Method | Role in experiments | Backbone/update rule | Query rule | Selection/reporting rule |
|---|---|---|---|---|
| ZO-AdaMM | Legacy synthetic reference | Adam-style ZOO | Fixed in source run | Reference curve only |
| R-AdaZO | Fixed-budget baseline | Rectified adaptive ZOO | Fixed : synthetic 10, attack 2, LLM 4 | Protocol-fixed |
| ZoAR | Reuse diagnostic | History reuse without ZoAQ gate | Source-recorded reuse/fixed budget | Separates reuse from control |
| StatZO | Statistics-based adaptive baseline | Stabilized R-AdaZO; original diagnostic only | Synthetic ; attack cap sweep; LLM | Best cap in sweep |
| MeZO | LLM fixed-budget baseline | Forward-only MeZO/LoRA | Fixed | LLM FE reference |
| ZoAQ | Ours | Stabilized adaptive ZO + query-reuse gate | Synthetic ; attack ; LLM or | Matched seeds; no extra validation |
| Parameter | Description | Value |
|---|---|---|
| Total iterations | 60,000 | |
| Dimension | 100 | |
| num_runs | Number of independent runs | 5 |
| (lr) | Learning rate | 0.001 |
| Momentum coefficients | (0.9, 0.99) | |
| Smoothing parameter | 0.005 |
| Algorithm | Parameter | Value |
| Non-Adaptive Baselines | ||
| R-AdaZO | Fixed queries per iteration, | 10 |
| Statistics-Based Adaptive SOTA | ||
| StatZO | Query range, | [1, 10] |
| Variance-to-norm threshold | 0.5 | |
| Our Proposal | ||
| Dataset | R-AdaZO ( ) | ZoAR ( ) | ZoAR ( ) | ZoAQ |
|---|---|---|---|---|
| MNIST | ||||
| CIFAR-10 |
| Category | Parameter | Value |
| Common | Models | OPT-1.3B, OPT-13B |
| Tasks | SST-2, COPA | |
| Seeds | 3 | |
| Training Steps | 5,000 | |
| Evaluation Interval | 250 steps | |
| Batch Size | 16 |
| Model | Task | Method | Total FE | Avg | FE Savings | Best Eval Loss | Last Eval Loss | Accuracy | Dev Acc | Train Loss |
|---|---|---|---|---|---|---|---|---|---|---|
| OPT-1.3B | SST-2 | MeZO | 40000 0 | 4.00 0.00 | 0.00 0.00% | 0.240 0.003 | 0.240 0.003 | 0.910 0.005 | 0.910 0.005 | 0.476 0.012 |
| R-AdaZO | 40000 0 | 4.00 0.00 | 0.00 0.00% | 0.198 0.002 | 0.199 0.003 | 0.920 0.004 | 0.910 0.006 | 0.288 0.008 | ||
| StatZO | 30746 412 | 3.07 0.04 | 23.14 1.03% | 0.206 0.005 | 0.240 0.006 | 0.910 0.007 | 0.880 0.010 | 0.302 0.015 | ||
| ZoAQ | 12662 235 | 1.27 0.02 | 68.35 0.59% | 0.209 0.004 | 0.237 0.005 | 0.870 0.011 | 0.910 0.008 | 0.335 0.014 | ||
| ZoAQ | 21714 318 | 2.17 0.03 | 45.72 0.80% | 0.195 0.003 | 0.198 0.004 | 0.920 0.005 | 0.910 0.005 | 0.285 0.010 | ||
| COPA | MeZO | 40000 0 | 4.00 0.00 | 0.00 0.00% | 0.532 0.006 | 0.532 0.006 | 0.770 0.012 | 0.750 0.015 | 0.537 0.018 |
| Task | FE vs. 15 | Best Loss vs. 15 | Accuracy vs. 15 | Immediate-Accept Rate | |
|---|---|---|---|---|---|
| SST-2 | 8 | ( ) | |||
| SST-2 | 24 | ( ) | |||
| COPA | 8 | ( ) | |||
| COPA | 24 | ( ) |
| Function | Method | Final Gap | Queries |
|---|---|---|---|
| Quadratic | ZoAQ (Adaptive) | 6.35E-04 | 590,024 |
| R-AdaZO ( ) | 7.52E-02 | 240,000 | |
| R-AdaZO ( ) | 7.35E-03 | 480,000 | |
| R-AdaZO ( ) | 6.15E-03 | 960,000 | |
| Levy | ZoAQ (Adaptive) | 1.50E+02 | 588,591 |
| R-AdaZO ( ) | 3.45E+02 | 240,000 |
| Function | Variant | Final Gap | Total Queries |
|---|---|---|---|
| Quadratic | Adaptive | 3.16e-03 | 623,893 |
| Quadratic | AlwaysMomentum | 6.90e-02 | 573,652 |
| Quadratic | AlwaysGradient | 6.49e-03 | 605,827 |
| Rosenbrock | Adaptive | 66.89 | 632,483 |
| Rosenbrock | AlwaysMomentum | 94.50 | 568,096 |
| Rosenbrock | AlwaysGradient | 71.21 | 615,656 |
| Function | Final Gap | Total Queries | |
|---|---|---|---|
| Quadratic | -0.5 | 3.16e-03 | 623,893 |
| Quadratic | -0.1 | 3.16e-03 | 623,893 |
| Quadratic | 0.0 | 3.16e-03 | 623,893 |
| Quadratic | 0.3 | 3.53e-03 | 623,749 |
| Quadratic | 0.5 | 7.33e-03 | 622,775 |
| Quadratic | 1.0 (default) | 6.35e-04 | 590,024 |
| Avg Queries | Std Queries | |
|---|---|---|
| 4 | 374.4 | 126.9 |
| 6 | 362.0 | 57.6 |
| 8 | 319.6 | 44.8 |
| 10 | 335.6 | 65.7 |
| 12 | 349.2 | 88.5 |
| Function | Strategy | Final Gap | Total Queries |
|---|---|---|---|
| Quadratic | min | 6.345e-04 | 590,024 |
| Quadratic | half | 6.194e-04 | 676,337 |
| Quadratic | linear | 3.131e-04 | 1,064,733 |
| Cubic | min | 6.460e-04 | 590,098 |
| Cubic | half | 6.100e-04 | 674,920 |
| Cubic | linear | 3.588e-04 | 1,063,694 |
Zeroth-Order Optimization
Zeroth-order optimization uses function values or comparisons, rather than gradients, to optimize objectives when differentiation is unavailable or costly.
See all 86 papers