Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Tuning by trying
Suppose you’re tuning the three knobs of a controller, and the only thing you can do is run a test and read a score. No formula, no slope, just “try settings, get a number”. You can still improve: try nearby settings and keep what’s better, nudge in the direction that helped, or shrink your search when you’re close.
That’s derivative-free (or zeroth-order) optimization: optimizing with function values alone.
Controller gains tuned on hardware, simulator parameters fitted to flight data, CFD shapes, and hyperparameters of learning systems are all black boxes. Derivative-free methods are the honest tool when gradients are unavailable, unreliable or too costly. Their scaling with dimension tells you when to switch to Bayesian optimization (A6.4-2) or evolution strategies (A6.4-3).
- 1. A derivative-free method uses…
- 2. Which is a black-box objective?
- 3. Compared with gradient methods, derivative-free methods usually need…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Finite differences
- Forward: , with error and evaluations per gradient.
- Central: , with error and evaluations.
Smaller reduces truncation error but amplifies floating-point rounding. The best forward step is about , and for central differences about . With noisy objectives, must be much larger.
Direct search
Nelder–Mead keeps a simplex of points. It reflects the worst point through the centroid of the others, expands if that helps a lot, contracts if not, and shrinks toward the best point if all else fails. It’s simple and robust for small and non-smooth costs, but has no general convergence guarantee. Pattern (compass) search tries steps along each axis and halves the step when nothing improves. It provably converges for smooth functions.
- 1. Central differences have error…
- 2. A Nelder–Mead simplex in d dimensions has…
- 3. Making h extremely small in finite differences…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Random-direction gradient estimators
Draw and estimate
It’s an unbiased estimate of , the gradient of the Gaussian-smoothed , at a cost of 2 evaluations. Plugging it into SGD gives zeroth-order SGD. Its variance scales like , so convergence needs about times more iterations than GD (Nesterov and Spokoiny, 2017). This factor-d penalty is unavoidable for zeroth-order methods in general (Duchi et al., 2015).
Choosing a derivative-free method
| Situation | Good choice |
|---|---|
| d ≲ 10, cheap, non-smooth | Nelder–Mead, pattern search |
| d ≲ 20, expensive, smooth-ish | Bayesian optimization (A6.4-2), model-based trust region |
| d large, parallel evaluations, noisy | Evolution strategies / CMA-ES (A6.4-3), ZO-SGD |
| gradients available but slow | automatic or adjoint differentiation instead |
Noise
With measurement noise , finite-difference error grows like . Use larger , average repeated evaluations, or fit a local model (regression over many points), as in trust-region DFO methods like COBYLA and BOBYQA (Powell, 2009).
- 1. The two-point random-direction estimator is unbiased for the gradient of…
- 2. Zeroth-order SGD typically needs about … more iterations than GD
- 3. For noisy black boxes, finite-difference steps should be…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Error of forward differences
Taylor: , so the truncation error is . Rounding error in each evaluation is about , which contributes . Minimizing gives . For unit scales that’s . ∎ For central differences the terms cancel, leaving .
Unbiasedness of the smoothed estimator
By Stein’s lemma, for , . By symmetry, . Subtracting and dividing by gives . ∎ Also , so small keeps the bias small.
Why the factor d?
For a linear , , so . The estimate is times noisier than the true gradient, so the step size must shrink by about , and the iteration count grows by . ∎
Exercise 3.1: Best forward-difference step with ε = 10⁻¹⁶ and unit scales
.
- 1. The optimal forward-difference step scales as…
- 2. Unbiasedness of the smoothed estimator follows from…
- 3. For linear f, E‖ĝ‖² equals…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Tuning a PID controller as a black box
The plant is a lightly damped second-order system with a saturating actuator. The cost is the integrated squared error plus an overshoot penalty plus control effort, measured by simulating a step response. The cost isn’t differentiable (saturation, max), so treat it as a black box. Starting from hand-picked gains, Nelder–Mead cuts the cost by about 4× in roughly 225 simulations and beats random search with the same budget. This is how gains are often refined on test rigs and in simulation-in-the-loop design.
Derivative-free optimization in AI, robotics and aerospace
- Controller and gait tuning on hardware, where every evaluation is a real experiment (Calandra et al., 2016, BO for bipedal gaits).
- Aerodynamic shape and mission design with black-box CFD or trajectory tools: direct search and surrogate models (Conn, Scheinberg and Vicente, 2009).
- Black-box adversarial attacks and prompt tuning use ZO gradient estimators (Chen et al., 2017, ZOO).
- Memory-efficient fine-tuning: MeZO fine-tunes large language models with zeroth-order SGD using only forward passes (Malladi et al., 2023).
References
- J. Nelder, R. Mead (1965). “A simplex method for function minimization.” The Computer Journal, 7(4).
- A. Conn, K. Scheinberg, L. Vicente (2009). Introduction to Derivative-Free Optimization. SIAM.
- Y. Nesterov, V. Spokoiny (2017). “Random gradient-free minimization of convex functions.” Foundations of Computational Mathematics, 17.
- J. Duchi, M. Jordan, M. Wainwright, A. Wibisono (2015). “Optimal rates for zero-order convex optimization: the power of two function evaluations.” IEEE Transactions on Information Theory, 61(5).
- M. J. D. Powell (2009). “The BOBYQA algorithm for bound constrained optimization without derivatives.” Cambridge NA Report NA2009/06.
- J. Larson, M. Menickelly, S. Wild (2019). “Derivative-free optimization methods.” Acta Numerica, 28.
- R. Calandra, A. Seyfarth, J. Peters, M. Deisenroth (2016). “Bayesian optimization for learning gaits under uncertainty.” Annals of Mathematics and Artificial Intelligence, 76.
- P.-Y. Chen et al. (2017). “ZOO: zeroth order optimization based black-box attacks to deep neural networks.” AISec.
- S. Malladi et al. (2023). “Fine-tuning language models with just forward passes.” NeurIPS (MeZO).
- C. Stein (1981). “Estimation of the mean of a multivariate normal distribution.” Annals of Statistics, 9(6).