Derivative-free optimization

Also known as: black-box optimization · gradient-free optimization · zeroth-order optimization

On this page 7

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.

MechanismInformation usedTypical behavior
Direct searchOrdering of function valuesRobust, slow in high dimensions
Model-based trust regionInterpolated local modelFast local convergence on smooth problems
Bayesian optimizationGlobal probabilistic surrogateVery few evaluations, limited dimensions
Evolution strategiesStatistics of a sampled populationParallel, tolerant of noise
Finite-difference estimatesApproximate gradient from perturbationsCheap to add, sensitive to noise
Core mechanisms of derivative-free optimization

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.

FamilyRepresentative methodsTypical dimensionsBest suited to
Simplex and pattern searchNelder-Mead, generalized pattern search, MADSUp to about 10-20Cheap, low-dimensional problems
Trust-region interpolationCOBYLA, NEWUOA, BOBYQAUp to a few hundredSmooth objectives with moderate cost
Bayesian optimizationGaussian process with expected improvement, TPEUsually below 20-30Very expensive evaluations
Evolution strategiesCMA-ES, natural evolution strategiesTens to thousandsRugged or noisy landscapes
Random and grid searchUniform sampling, Latin hypercubeAnyBaselines and broad screening
Common algorithm families and their working ranges

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.

PropertyDerivative-free optimizationGradient-based optimization
Required informationFunction values onlyGradients, sometimes Hessians
Scaling with dimensionDegrades noticeablyScales to billions of parameters
Noise and discontinuitiesOften toleratedCan break convergence
ParallelismNatural across evaluationsWithin a single gradient step
Convergence guaranteesWeaker, method-specificWell developed for smooth cases
Derivative-free and gradient-based optimization compared

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.

SituationRecommended choiceReason
Evaluation takes hours, under 20 parametersBayesian optimizationMaximizes information per evaluation
Smooth simulation, 10-200 parametersTrust-region interpolationFast local convergence
Noisy, multimodal, cheap evaluationsCMA-ESRobust global exploration
Large cluster, many parallel workersRandom search with HyperbandSimple and highly parallel
Millions of parameters, no backpropagationZeroth-order gradient estimationMemory-efficient approximation
Choosing a derivative-free method

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.