Derivative-free optimization searches for better decisions using evaluations of an objective without requiring the user to supply its derivatives. It is useful when an objective comes from a simulation, experiment or software component whose gradients are unavailable or unreliable. The gold standard is to make each evaluation count, preserve feasibility, distinguish genuine improvement from noise, and state clearly whether the result is a local candidate or a globally certified solution.
This guide explains the subject through original, reproducible calculations: a coordinate poll, a simplex reflection, a quadratic reconstructed from samples, a nonsmooth counterexample and a noisy comparison. The examples reveal why derivative-free does not mean assumption-free, why sample geometry matters, and why a small step or a solver’s success message is not automatically proof of optimality. All numerical cases are constructed teaching models rather than reported experimental results.
Use the Gold Standard master, Education parent and How X Works hub to connect this subject with dependable reasoning and transferable learning. The Trust-Region Methods root explains how local predictions are checked against actual objective values; the Nelder–Mead specialist article develops one particular search geometry in more detail.
Choose your derivative-free-optimization route
Chapters 1–3: Define evaluations and search
Chapters 4–6: Inspect directions and models
Chapters 7–9: Check geometry and constraints
Chapters 10–12: Scale, budget and validate
Chapter index
Define evaluations and search · Chapters 1–3
1. Begin with the evaluation contract
Inspect directions and models · Chapters 4–6
4. Why a failed poll is only conditional evidence
Check geometry and constraints · Chapters 7–9
7. Sample geometry can be more important than sample count
Scale, budget and validate · Chapters 10–12
10. Scaling, categories and the size of the search
Transfer and continue learning · Chapters 13–14
CHAPTER 1 OF 14 · Define evaluations and search
1. Begin with the evaluation contract
An optimizer needs a precise question. Let x represent a decision and f(x) its cost, with smaller values preferred. Specify which x values are allowed, what one evaluation returns, whether repeating it gives the same answer, and how much time or money it consumes. Without this contract, even a perfectly implemented search can compare incompatible results.
Imagine a simulation that returns travel time for a proposed control setting. Does each call use the same demand scenario? Does a failed simulation return an error or an invented large cost? Does the objective include energy consumption, or only travel time? These details determine what “better” means before an algorithm chooses its next point.
Four distinctions to preserve
Unavailable derivatives are not the same as nonexistent derivatives. A smooth simulator may hide its analytical derivative, while a nonsmooth function may expose meaningful directional information. Deterministic output is not the same as accurate output: a numerical simulator can repeat the same biased answer. A continuous variable is not the same as a category: replacing a material label with an integer does not create a meaningful numerical distance between materials.
The review by Larson, Menickelly and Wild separates methods by assumptions about objective functions, evaluations and constraints. Its scope is a useful reminder that derivative-free optimization is a family of approaches, not one algorithm with one universal guarantee.
For the first examples, assume continuous real variables, exact deterministic evaluations and explicitly stated domains. These assumptions make the arithmetic transparent. Later chapters change them deliberately so that the consequences remain visible rather than hidden inside a software option.
Keep a record of the original decision, objective value and evaluation status. A solver’s internal transformed coordinates are useful for computation, but the final answer must still be interpretable in the original variables. If a control setting is reported in scaled units, provide the conversion back to the actual setting.
CHAPTER 2 OF 14 · Define evaluations and search
2. When avoiding supplied derivatives makes sense
Before selecting a derivative-free method, ask whether useful derivatives can be obtained at reasonable cost. An analytical formula, automatic differentiation or a simulator’s sensitivity calculation may offer more information per unit of computation than repeated trial evaluations. The absence of a gradient in an initial interface does not establish that gradients are impossible.
Finite differences use function evaluations to estimate derivatives. For n coordinates, a basic forward-difference gradient needs n additional values if the current value is already known. A central-difference gradient commonly uses 2n values. These counts describe simple constructions; caching, parallel execution and shared computation can change their practical cost.
An exact calculation of the tradeoff
For f(x)=x² at x=1, the forward difference [f(1+h)−f(1)]/h equals 2+h. Its error relative to the derivative 2 is exactly h. Smaller positive h reduces that truncation error in exact arithmetic.
Now suppose each function evaluation has an unknown additive error bounded by ε. The difference of two errors can have magnitude up to 2ε, so division by h contributes at most 2ε/h. A bound on the total derivative error is h+2ε/h. This expression is minimised at h=√(2ε), not at h=0.
With ε=0.00005, that step is 0.01 and the bound is 0.02. At h=0.0001, the bound becomes 1.0001. An extremely small difference can therefore be less informative, even for this simple smooth function. The calculation does not prescribe a universal finite-difference step: it depends on the function’s curvature and a particular bounded-error model.
A derivative-free method may avoid explicitly forming this gradient, but it still relies on comparisons or models built from imperfect values. It cannot remove evaluation error by changing terminology. Its advantage must be assessed through the problem’s structure, available information and evaluation budget.
CHAPTER 3 OF 14 · Define evaluations and search
3. Direct search by a small set of trial moves
Consider F(x,y)=(x−1)²+4(y+2)². Start at (0,0), where F=17. Use a coordinate poll with step length one: test one positive and one negative move along each axis, keeping the other coordinate fixed. The four candidates are (1,0), (−1,0), (0,1) and (0,−1).
Their costs are 16,20,37 and 5 respectively. A complete poll followed by selection of the best candidate therefore moves to (0,−1). No derivatives were needed to make that decision. The evaluations themselves identified a substantially better point.
At (0,−1), the corresponding four candidates have costs F(1,−1)=4, F(−1,−1)=8, F(0,0)=17 and F(0,−2)=1. The best move reaches (0,−2). A further poll finds (1,−2), with cost zero. Because F is a sum of nonnegative squares, zero is a global lower bound, and the attained point is globally optimal.
The search and the certificate are different
The poll found the point; the square representation certified it. On an unknown simulator, the same pattern of decreasing evaluations would not provide that lower bound. This separation prevents a successful toy example from creating an unjustified expectation about arbitrary objectives.
An opportunistic poll might stop at the first acceptable improvement instead of evaluating all four directions. If it examines (1,0) first, it may accept cost 16 without seeing cost 5 in the same poll. That is not necessarily an error: it trades a cheaper immediate decision for less information about the alternatives.
Declare the acceptance rule and direction order when reproducing an experiment. Also distinguish attempted evaluations from new evaluations. The point (0,0) was already sampled, so a deterministic evaluator could reuse its value when it reappears. If the simulator changes with time or random seed, that reuse needs a different justification.
CHAPTER 4 OF 14 · Inspect directions and models
4. Why a failed poll is only conditional evidence
Suppose none of the coordinate moves improves the current point. One possible response is to reduce the step length and poll again. At a large step, the search may jump across a nearby valley; smaller moves can resolve it. But the interpretation depends on smoothness and the directions tested.
For a differentiable function, a nonzero gradient has at least one nonzero coordinate. Choosing the opposite sign of that coordinate gives a direction with negative directional derivative. Sufficiently small movement in that direction decreases the function. This elementary observation explains why both signs of each axis are informative in a smooth problem.
A nonsmooth counterexample
Let H(x,y)=max(x,y)+0.1(x²+y²), and start at (0,0), where H=0. A move to (h,0), with h>0, gives h+0.1h²>0. A move to (−h,0) gives 0.1h²>0. The corresponding two y-axis moves are also worse. Every coordinate poll fails, however small h is.
Yet moving diagonally to (−h,−h) gives H=−h+0.2h², which is negative for 0<h<5. At h=0.5, the cost is −0.45. The origin is not a local minimum even though every tested coordinate move is worse.
This example does not disprove every direct-search method. It disproves the particular inference that coordinate failure alone certifies local optimality for an arbitrary nonsmooth objective. A method designed for nonsmooth problems needs appropriate direction coverage and assumptions; adding one diagonal fixes this example but is not a general theorem.
The diagnostic lesson is practical. When a search repeatedly shrinks its steps without improvement, inspect the function’s structure and the geometry of the tested moves. Shrinking the same inadequate set of directions can reproduce the same blind spot indefinitely. A termination label should describe what was tested rather than claim more than those tests establish.
CHAPTER 5 OF 14 · Inspect directions and models
5. A simplex move you can audit by hand
In two dimensions, a simplex consists of three vertices. Nelder–Mead compares their objective values and uses geometric moves such as reflection, expansion, contraction and shrinkage. It is different from the simplex method of linear programming despite the shared word. The existing Nelder–Mead article explains the full sequence of decisions.
Use Q(x,y)=(x−2)²+(y−1)² and vertices A=(0,0), B=(1,0), C=(0,1). Their values are 5,2 and 4. Thus A is worst, B is best and C is intermediate. The centroid of the two better vertices is c=(0.5,0.5).
Reflect A through c using coefficient one: r=c+(c−A)=(1,1). Its cost is 1, better than the current best 2. Try an expansion with coefficient two relative to c: e=c+2(r−c)=(1.5,1.5). Its cost is 0.5, so this illustrative standard move keeps e in place of A.
Preserve the geometry and the evaluations
The new simplex is B,C,e. Its best cost is 0.5, but the true minimiser (2,1), with cost zero, is not yet a vertex. The successful expansion is progress, not a certificate that the method has finished.
The arithmetic provides simple implementation checks. The centroid excludes the worst vertex. Reflection uses that centroid and the worst point, not the best point alone. Expansion extends from the centroid through the reflected point. Mixing these reference points creates a different move.
For software use, inspect the actual implementation. The SciPy Nelder–Mead documentation exposes an initial simplex and separate evaluation and iteration limits; its bound handling clips vertices. Those details matter when reproducing a search near a boundary. A software option named bounds does not imply that every algorithm treats constrained geometry in the same way.
CHAPTER 6 OF 14 · Inspect directions and models
6. Reconstructing a quadratic from six values
A different approach fits a local model to sampled values. Consider a two-variable quadratic m(x,y)=a+bx+cy+dx²+exy+fy². There are six coefficients, so six appropriately placed noiseless samples can determine it. Six samples placed badly need not provide six independent pieces of information.
Take G(x,y)=(x−2)²+3(y+1)². Evaluate it at (0,0), (1,0), (−1,0), (0,1), (0,−1) and (1,1). The values are 7,4,12,16,4 and 13. We can reconstruct the coefficients without requesting a derivative.
At the origin, a=7. From the positive and negative x-axis points, b+d=−3 and −b+d=5, giving d=1 and b=−4. The y-axis points give c+f=9 and −c+f=−3, hence f=3 and c=6. Finally, the value at (1,1) gives 7−4+6+1+e+3=13, so e=0.
What the model has learned
The fitted expression is 7−4x+6y+x²+3y². Completing squares recovers (x−2)²+3(y+1)² exactly. Its minimiser is (2,−1), with cost zero. In this deliberately quadratic case, the model is valid everywhere because the original function has exactly the assumed form.
For a general simulator, matching six sampled values does not make a quadratic globally correct. A model may predict a promising point outside the sampled area and be badly wrong there. Evaluate the proposed point in the original function, then update the model or its trusted neighbourhood based on the result.
This is the link to Trust-Region Methods. Derivative-free model building changes how local information is obtained, while the need to test predictions remains. The fitted coefficients may resemble gradients and curvature, but their reliability depends on sample locations, evaluation quality and the region over which they are used.
CHAPTER 7 OF 14 · Check geometry and constraints
7. Sample geometry can be more important than sample count
Suppose all six samples in the previous chapter were taken on y=0. Then every sampled value would be independent of c,e and f. No amount of exact arithmetic could identify those coefficients from that data. Six rows in a file are not automatically six independent constraints on the model.
Even sampling near the x-axis can be troublesome. For a linear model a+bx+cy, use points (0,0), (1,0) and (1,δ), where δ is small. The difference between the last two values is cδ. Recovering c requires dividing that difference by δ.
If each value has error at most ε, the difference can have error up to 2ε, so the recovered c can have error up to 2ε/|δ|. With ε=0.0001 and δ=0.001, that bound is 0.2. With δ=0.1, it is 0.002. The same evaluation accuracy gives a hundredfold change in this coefficient bound purely because the points are better separated in the y direction.
A useful evaluation need not improve the objective
A new point that improves the geometry of a sample set can make subsequent predictions more dependable even if its own objective is not the lowest observed. This is why a model-based method may spend an evaluation on information rather than immediate improvement.
Record both purposes when reviewing a run. The best feasible point found so far is the incumbent. Other sampled points help describe the surrounding function. Replacing the incumbent with a worse information-gathering point would confuse these roles, but discarding all worse points would waste useful model information.
More data can help only if it adds relevant information. Repeating the same exact deterministic point does not improve spatial coverage. Repeating a noisy point can improve estimation of its value under appropriate sampling assumptions, but still does not reveal an unobserved direction. Geometry and replication solve different problems and should be budgeted separately.
CHAPTER 8 OF 14 · Check geometry and constraints
8. Comparing values when evaluations contain noise
Suppose an evaluator reports f̂(x)=f(x)+e(x), with |e(x)|≤ε. A reported improvement f̂(a)−f̂(b) can differ from the true improvement by as much as 2ε. Therefore a measured improvement greater than 2ε certifies a genuine improvement under this bounded-error assumption; a smaller measured improvement may be real, but the bound alone cannot establish it.
If ε=0.02 and the reported costs are 10.00 and 9.97, the observed reduction is 0.03. The true reduction can lie between −0.01 and 0.07. The second point might actually be worse. If its reported cost were 9.90, the reduction 0.10 would imply a true reduction of at least 0.06.
Repetition needs a statistical model
For independent, identically distributed, unbiased errors with finite variance σ², the mean of n repetitions has variance σ²/n. This familiar calculation does not remove a systematic bias, and independence can fail when simulations share state or experiments drift over time. Repeating a biased instrument reading many times can produce a precise estimate of the wrong quantity.
When comparing stochastic simulations, document seeds and scenario selection. Using the same scenarios for two candidates may reduce the variance of their difference if the outputs are positively correlated, but the covariance must be considered. For random values A and B, Var(A−B)=Var(A)+Var(B)−2Cov(A,B). The formula explains both the opportunity and the condition.
Keep the best observed value separate from an independently re-evaluated final candidate. Searching many noisy candidates tends to favour those that received unusually favourable errors. A fresh evaluation helps assess whether the apparent advantage persists rather than merely selecting the luckiest measurement.
Do not shrink a search step indefinitely while ignoring a fixed noise level. Smaller moves often produce smaller true changes, eventually making their ranking hard to resolve. At that stage, more accurate evaluations, a different sampling policy or an honest stop may be more useful than another decimal place in the parameter vector.
CHAPTER 9 OF 14 · Check geometry and constraints
9. Constraints belong to the original problem
An objective evaluator may accept a numerical input that is not a permissible decision. Suppose a design requires x≥0, y≥0 and x+y≤1. A trial at (0.8,0.8) lies within the separate coordinate bounds but violates the shared resource constraint. Checking only minimum and maximum values for each coordinate misses the actual restriction.
Consider minimising C(x,y)=−x−2y over that triangular feasible set. For any feasible point, x+2y≤2(x+y)≤2, so C≥−2. The point (0,1) attains −2 and is globally optimal. This certificate uses the original constraint, not the behaviour of a search routine.
A penalty can prefer an infeasible answer
Now allow the whole box [0,1]² and minimise Cμ=−x−2y+μ max(0,x+y−1). At the feasible optimum, Cμ(0,1)=−2. At the infeasible point (1,1), Cμ=−3+μ. If μ=0.5, the infeasible point has value −2.5 and beats the feasible optimum in the penalised problem.
The search has not necessarily failed. It may have correctly improved a different objective whose penalty was too weak to enforce the intended restriction. Reporting only the penalised value conceals the violation. Report original objective and original constraint residuals separately.
A failed simulation is another distinct state. It may mean the design is physically impossible, the numerical solver failed, or a temporary system error occurred. Assigning every failure the same arbitrary large cost erases those distinctions and can mislead a fitted model. Preserve the failure category and retry only when the evaluation contract warrants it.
If feasibility is essential during evaluation, use a formulation or method that respects it before calling the expensive system. Projecting a point back into a feasible set may be useful, but then record the point actually evaluated. Otherwise the optimizer can associate a value with coordinates that never produced it, corrupting its model and its audit trail.
CHAPTER 10 OF 14 · Scale, budget and validate
10. Scaling, categories and the size of the search
Suppose one variable ranges from zero to one and another from zero to ten thousand. A raw step of one spans the first variable’s whole range but only a tiny part of the second. Normalize meaningful continuous ranges when appropriate, and keep the inverse transformation so that decisions can be recovered in their original units.
For a variable x in [a,b], with b>a, the transformation u=(x−a)/(b−a) maps it to [0,1]. A normalized step of 0.05 corresponds to 5 percent of that declared range. This does not establish that the objective is equally sensitive to every coordinate, but it makes the initial geometry interpretable.
A category is not a short interval
If material A, B and C are coded as 1,2 and 3, a point at 1.7 has no automatic physical meaning. Rounding it to 2 introduces plateaus and changes the effective objective seen by the optimizer. Use a method or explicit enumeration strategy suitable for categorical or mixed decisions rather than assuming a continuous local model remains valid.
Dimension also changes the economics. Testing ten values for each of n variables on a full grid needs 10ⁿ combinations. For two variables that is 100; for six it is one million; for ten it is ten billion. At one second per evaluation, the last case is roughly 317 years of sequential work, using 365.25 days per year.
Parallel resources reduce elapsed time only to the extent that evaluations can run independently and resources are available. They do not reduce the total number of requested evaluations. Shared licenses, memory, queues or physical apparatus can limit actual concurrency.
Before selecting an elaborate search, inspect whether the problem can be simplified: remove fixed parameters, exploit known separability, eliminate redundant variables or use available analytical structure. Such reductions can be more valuable than switching between two black-box algorithms while leaving an unnecessarily large decision space intact.
The meaningful unit of work is often an objective evaluation, not an iteration. One method’s iteration may request one new value, another may evaluate a population, and a third may repeat measurements at several points. Comparing iteration counts alone can reverse the apparent efficiency of two approaches.
Suppose method A reaches cost 1.2 after 100 evaluations and method B reaches cost 1.0 after 1,000. Neither fact alone identifies the better choice under a 150-evaluation budget. Compare the best feasible cost available by the same budget, and account for setup, failed calls and repeated evaluations.
Reserve work for validation
For a hypothetical budget of 200 calls, one possible allocation is 20 initial exploratory calls, 140 adaptive search calls and 40 validation calls. This is an example accounting plan, not a universal recommended split. If evaluations are deterministic and exact, spending 40 calls repeating identical inputs may be wasteful. If they are noisy, final replication may be essential.
Caching exact deterministic results can save calls when a candidate reappears. The cache key should include every input affecting the value: parameters, data version, scenario, numerical tolerance and relevant software configuration. Reusing a value from a different simulator version is not caching the same mathematical function.
For stochastic algorithms, compare multiple runs under a declared seed policy and report variability rather than only the best run. A method that occasionally finds an excellent point but frequently fails can be unsuitable when only one deployment is possible. Equally, a reliable local method may miss distant alternatives that broader exploration can discover.
The Rios–Sahinidis comparison repository provides test problems and detailed results accompanying its research study. It illustrates reproducible comparison through shared problems and recorded outcomes. Its historical rankings should not be treated as a universal ranking for every new problem, budget, software version or hardware environment.
CHAPTER 12 OF 14 · Scale, budget and validate
12. What stopping can and cannot establish
A small simplex, a small poll step, a nearly unchanged objective and an exhausted evaluation budget are different stopping events. Each should be reported accurately. None automatically proves that every allowed alternative has a larger cost.
For the sum-of-squares example, a zero value establishes global optimality because an independent lower bound is available. For the triangular constrained example, the inequality C≥−2 supplies the certificate. For the nonsmooth coordinate example, a failed poll supplies no such certificate and actually occurs at a point with nearby improvements.
A simple limit on finite observations
Imagine sampling a continuous function at finitely many points in an interval. There is generally an unsampled subinterval. Without additional restrictions, another continuous function can agree at every sampled point yet contain a deeper narrow valley inside that unsampled interval. The observations alone cannot distinguish the two functions.
This is why global guarantees need assumptions or additional evidence, such as known convexity, valid lower bounds, a known regularity constant or an exhaustive finite search. Calling an algorithm global may describe its exploratory design without promising a global certificate after a particular finite run.
A useful final report identifies the best feasible candidate, original objective, constraint residuals, evaluation count, stopping reason and sensitivity to starts or random seeds. If the objective is noisy, include the validation procedure and uncertainty model. If a lower bound exists, state its source and the gap to the candidate.
Avoid overinterpreting precision. Printing x=0.999999999 does not mean the real decision is known to nine decimal places. The evaluation’s uncertainty, the model’s fidelity and the practical resolution of the control may support far fewer digits. Numerical formatting should reflect the evidence available rather than the number of digits a computer can display.
CHAPTER 13 OF 14 · Transfer and continue learning
13. Changed-context check: a new target and noisy values
Change the first poll objective to Fnew(x,y)=(x−0.3)²+4(y+1.7)². Start again at (0,0) with unit coordinate steps. The starting value is 11.65. The four trial values are 12.05 at (1,0), 13.25 at (−1,0), 29.25 at (0,1) and 2.05 at (0,−1). The best first move is still downward, but the target is no longer on the unit grid.
At (0,−2), the value is 0.45. Unit moves along either axis are all worse, so a unit poll stalls there even though the exact minimiser is (0.3,−1.7). A smaller step is now necessary to resolve the remaining displacement.
Calculate the half-step improvement
With step 0.5, the candidate (0.5,−2) has cost 0.4, while (0,−1.5) has cost 0.25. The best of these is (0,−1.5), an improvement of 0.2. Reducing the step revealed useful information that the unit poll could not see.
Now suppose each reported value has bounded error ε=0.06. A measured improvement of 0.05 for the first half-step candidate would not certify genuine improvement because 2ε=0.12. A measured improvement of 0.2 would imply a true improvement of at least 0.08. The same search geometry now needs an uncertainty-aware interpretation.
For a second transfer test, reconsider the interpolation model from Chapter 6. Move the sixth sample from (1,1) onto the x-axis. The mixed coefficient e is no longer identified by the original five axis samples plus another axis sample. Increasing the number of decimal places in those measurements cannot recover the missing cross-direction information.
A complete learner answer explains the changed target, recomputes actual costs, identifies why step refinement matters and distinguishes uncertainty from geometric inadequacy. Repeating the original answer (1,−2) or merely requesting more iterations does not demonstrate that the mechanism has been understood.
CHAPTER 14 OF 14 · Transfer and continue learning
14. Practical questions and next steps
Is derivative-free optimization random search?
Not necessarily. The coordinate polls, simplex moves and interpolation calculations above are deterministic when their rules and evaluations are deterministic. Other approaches use randomness. The phrase describes the information supplied to the method, not one compulsory search pattern.
Does derivative-free mean the function must be nonsmooth?
No. A smooth function may lack accessible derivatives. Conversely, a method whose guarantees assume smoothness does not become suitable for every nonsmooth problem merely because it requests only function values. Chapter 4 gives a concrete warning against that inference.
Should I use Nelder–Mead for every small problem?
No single choice follows from dimension alone. Inspect bounds, nonlinear constraints, evaluation noise, available structure and the quality of stopping evidence you need. The simplex calculation is a useful starting lesson, but it is not a universal method-selection rule. Check the current implementation’s documented behaviour rather than relying only on an algorithm name.
What should I practise first?
Reproduce the coordinate poll and the simplex reflection using a table of evaluated points. Then reconstruct the six quadratic coefficients from their samples. Finally introduce bounded evaluation errors and decide which comparisons remain justified. This sequence moves from arithmetic to geometry to uncertainty without hiding the mechanism inside a solver.
For a real project, write the evaluation contract before coding the optimizer. Specify units, valid inputs, failure handling, repeatability, budget and final validation. Begin with a small benchmark whose solution you can independently check. Keep an incumbent separately from exploratory samples, and preserve enough records to explain why each decision was accepted.
Primary references include the Larson–Menickelly–Wild review, the SciPy Nelder–Mead documentation and the Rios–Sahinidis reproducibility materials. The calculations here are original teaching cases, not performance results copied from those sources.
Continue through Trust-Region Methods for evaluating local model predictions and through the Nelder–Mead specialist guide for simplex mechanics. The shared discipline is to treat every function evaluation as evidence with a defined meaning, cost and limitation, then make claims no stronger than that evidence supports.
