Derivative-free optimization (DFO) is the family of methods that search for the minimum or maximum of an objective function using only function evaluations, never gradients or Hessians. In optimization for artificial intelligence, it is the standard approach when the objective is a black box: a simulation, a training run, a physical experiment or any program whose derivatives are unavailable, unreliable or too expensive to compute.
The field is also called black-box optimization, gradient-free optimization or zeroth-order optimization. Its central challenge is sample efficiency: when a single evaluation can take minutes or days, the quality of a method is judged by how much progress it makes per evaluation, not per second of computation.
How derivative-free methods search without gradients
A derivative-free method replaces gradient information with structured sampling of the objective. It proposes candidate points, observes their values and uses the comparison between those values to decide where to sample next. The algorithms differ mainly in what they infer from past evaluations: some only rank points, others fit a local or global model of the function.
Three mechanisms cover most practical methods. Direct search compares values on a geometric pattern, such as a simplex or a coordinate stencil, and moves or shrinks the pattern. Model-based methods build a surrogate, for example a quadratic interpolation model inside a trust region or a Gaussian process, and optimize that cheaper model instead. Population-based methods maintain a set of candidates and update it through selection, recombination or sampling from an adapted distribution.
The following table summarizes the information each mechanism extracts from evaluations and the resulting behavior.
| Mechanism | Information used | Typical behavior |
|---|---|---|
| Direct search | Ordering of function values | Robust, slow in high dimensions |
| Model-based trust region | Interpolated local model | Fast local convergence on smooth problems |
| Bayesian optimization | Global probabilistic surrogate | Very few evaluations, limited dimensions |
| Evolution strategies | Statistics of a sampled population | Parallel, tolerant of noise |
| Finite-difference estimates | Approximate gradient from perturbations | Cheap to add, sensitive to noise |
Main families of derivative-free algorithms
Practitioners usually choose among a small set of well-established algorithm families, each with a characteristic dimension range and evaluation budget. The ranges below are typical working limits, not hard boundaries, because performance depends strongly on smoothness, noise and the cost of each evaluation.
| Family | Representative methods | Typical dimensions | Best suited to |
|---|---|---|---|
| Simplex and pattern search | Nelder-Mead, generalized pattern search, MADS | Up to about 10-20 | Cheap, low-dimensional problems |
| Trust-region interpolation | COBYLA, NEWUOA, BOBYQA | Up to a few hundred | Smooth objectives with moderate cost |
| Bayesian optimization | Gaussian process with expected improvement, TPE | Usually below 20-30 | Very expensive evaluations |
| Evolution strategies | CMA-ES, natural evolution strategies | Tens to thousands | Rugged or noisy landscapes |
| Random and grid search | Uniform sampling, Latin hypercube | Any | Baselines and broad screening |
CMA-ES (covariance matrix adaptation evolution strategy) deserves special mention because it learns the shape of the search distribution, effectively approximating second-order curvature from samples. Zeroth-order gradient estimation, which perturbs parameters with random directions and differences the results, scales to millions of parameters and is used to fine-tune language models when backpropagation is impractical.
How derivative-free optimization compares with gradient-based methods
Derivative-free optimization is not a replacement for gradient descent when gradients are available. On smooth, high-dimensional problems such as neural network training, a gradient delivers information about every coordinate in a single backward pass, while a zeroth-order method needs on the order of one evaluation per dimension to recover comparable information.
| Property | Derivative-free optimization | Gradient-based optimization |
|---|---|---|
| Required information | Function values only | Gradients, sometimes Hessians |
| Scaling with dimension | Degrades noticeably | Scales to billions of parameters |
| Noise and discontinuities | Often tolerated | Can break convergence |
| Parallelism | Natural across evaluations | Within a single gradient step |
| Convergence guarantees | Weaker, method-specific | Well developed for smooth cases |
Neighboring methods in the topic overlap with this family. Grid search and random search are the simplest derivative-free strategies, Hyperband adds early stopping of weak candidates, and simulated annealing or other metaheuristics can be seen as derivative-free searches with a stochastic acceptance rule.
Where derivative-free optimization is used in AI
The most common application is hyperparameter tuning, where the objective is validation performance after a full training run and its dependence on the learning rate or architecture choices has no usable gradient. Other uses include neural architecture search, policy search in reinforcement learning, adversarial attacks on black-box models, prompt and configuration tuning for language models, and calibration of physical simulators.
Choosing a method is largely a question of evaluation cost and dimension. The decision table below reflects common practice.
| Situation | Recommended choice | Reason |
|---|---|---|
| Evaluation takes hours, under 20 parameters | Bayesian optimization | Maximizes information per evaluation |
| Smooth simulation, 10-200 parameters | Trust-region interpolation | Fast local convergence |
| Noisy, multimodal, cheap evaluations | CMA-ES | Robust global exploration |
| Large cluster, many parallel workers | Random search with Hyperband | Simple and highly parallel |
| Millions of parameters, no backpropagation | Zeroth-order gradient estimation | Memory-efficient approximation |
Limitations and common mistakes
The main limitation is the curse of dimensionality: the number of evaluations needed to locate a good region grows rapidly with the number of variables. Most DFO methods also offer only local convergence guarantees, so a good result on a non-convex landscape depends on starting points and restarts.
- Ignoring noise: comparing single noisy evaluations can make a method chase random fluctuations; repeated sampling or noise-aware surrogates help.
- Poor scaling of variables: parameters with very different ranges distort simplex and trust-region steps; normalize or use log scales.
- Unbounded budgets: without a fixed evaluation budget and a strong random-search baseline, it is hard to judge whether a sophisticated method adds value.
- Using DFO where gradients exist: automatic differentiation is usually orders of magnitude more efficient for differentiable models.
The short version
Some problems only tell you how good an answer is. They do not tell you which way to move to improve it. Derivative-free optimization handles exactly those problems.
Think of tuning an old radio without a signal meter. You turn the knob a little, listen, and keep the setting that sounds clearer. Smarter versions remember what they heard and guess where the best setting probably lies. The key idea is simple: try carefully chosen settings, compare the results and spend each costly test wisely.
Where it makes a difference
A machine learning team is tuning a speech recognition model whose single training run takes about six hours on a GPU cluster. They want to choose the learning rate, weight decay, dropout, warmup length and batch size, five parameters in total, and they can afford roughly 40 training runs before a release deadline.
A grid with only four values per parameter would need 1,024 runs, which is impossible. The team instead uses Bayesian optimization with a Gaussian process surrogate and an expected improvement acquisition function, running four evaluations in parallel. After ten initial random configurations, the method concentrates its proposals near a narrow band of learning rates and a moderate dropout value.
Within the 40-run budget, the best configuration lowers the word error rate by about one percentage point compared with the default settings, and the team avoids weeks of manual trial and error.