Random
Uniform random sampling. A surprisingly tough baseline.
- Quality
- Medium
- Speed
- Fast
- Budget
- O(N)
How it works
Random search is the honest baseline. Each cycle it picks a brand new, fully independent set of values from your ranges. No memory, no learning, no pattern.
It sounds naive, but it is genuinely hard to beat for a quick read on a new strategy, and it never gets stuck the way a structured search can.
Think of it as the control group: if a smarter method cannot beat random on your strategy, that tells you something useful about the landscape.
Under the hood
Every parameter is sampled independently each cycle: a step-aligned uniform draw for numerics and a 50/50 coin flip for booleans. There is zero correlation between cycles.
Bergstra and Bengio showed in 2012 that random search beats grid search for high-dimensional tuning, because it does not waste cycles re-testing the same value of one parameter. TPE in turn beats random by learning, which is why TPE is the default.
TPE itself falls back to random before it has enough history to model, so random is also the warm-up that bootstraps the smarter method.
- Memory
- None
- Numeric draw
- Uniform, step-aligned
- Boolean draw
- 50 / 50
When to use it
Reach for it when
- A fast, unbiased first read on a new strategy
- A baseline to measure smarter methods against
Reach for something else when
- When you want to converge on the best settings (use TPE)
- Expensive cycles where sample efficiency matters
Want to see optimization in action? Browse our real strategy backtests vs buy and hold on NVDA, TSLA, and AAPL.
New to this? Read how to run your first optimization or learn how to choose the right optimization method for your strategy.
Related methods
-
Recommended
TPE (Bayesian)
Builds a probabilistic model of what works and spends your cycles where the payoff is most likely.
Quality 5 of 5Speed 5 of 5O(N) How it works -
Simulated Annealing
Wanders widely at first, then settles toward an optimum as the acceptance temperature drops.
Quality 4 of 5Speed 3 of 5O(N) How it works