# 随机优化

随机优化是一种用于数值优化的无导数随机直接搜索方法：在每次迭代中，它对当前最优点进行随机扰动，只有当目标值改善时才移动到新点。它适用于结构不良的黑箱问题，这类问题的目标函数在连续、离散或混合域上可能是非凸、不可微或不连续的，且梯度不可用。<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup> 该方法由Matyás针对多变量情形提出，他给出了随机状态序列收敛到最优状态的论证；原始证明存在缺陷，修正后的证明确立了依概率收敛。<sup>[2](https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=at&paperid=11288&option_lang=eng)</sup> 在无导数优化文献中，它表现为局部化随机搜索，即随机搜索族中具有改进性质的那一类，区别于纯随机搜索——后者采样点与所有先前迭代无关。<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> 现代处理将其归类为直接搜索方法，这类方法在一组点上评估目标函数，仅依据这些函数值行动，而不近似导数。<sup>[4](https://link.springer.com/article/10.1007/s10107-026-02404-7)</sup>

| 关键事实 | 详情 |
|---|---|
| 问题类别 | 黑箱最小化；目标函数可能非凸、不可微或不连续<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup> |
| 开创性论文 | Matyás，《随机优化》，Avtomat. i Telemekh. 26:2 (1965)，246–253<sup>[2](https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=at&paperid=11288&option_lang=eng)</sup> |
| 接受规则 | 仅在严格改进时移动；与模拟退火不同，不允许上坡移动<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup> |
| 收敛性 | 对连续损失函数配合高斯扰动具有依概率全局收敛性；证明由Baba等人修正(1977)<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> |
| 维度限制 | 在固定精度下，从1维到10维，盲随机搜索需要大约\( 10^{10} \)倍的评估次数增长<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> |
| 噪声 | 在带噪声的损失评估下，该方法一般不能在严格意义上收敛<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> |

## 工作原理

其机制是扰动-接受更新。给定当前迭代点\( X_{k} \)，算法采样一个随机偏差，形成候选点\( V_{k+1} = X_{k} + d_{k} \)，并应用严格改进规则

\[ X_{k+1} = \begin{cases} V_{k+1} & \text{若 } f(V_{k+1}) < f(X_{k}) \\ X_{k} & \text{否则.} \end{cases} \]

因此迄今找到的最佳函数值永不退化。<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup>

严格改进规则是随机优化与[模拟退火](https://www.edgepedia.org/zh/simulated-annealing)的分界线——后者以[Metropolis](https://www.edgepedia.org/zh/metropolis)概率（一种让退火有时接受较差移动的接受规则）\( \min\{1, \exp((f(X_{k}) - f(V_{k+1}))/T_{k})\} \)接受非改进候选点，允许上坡移动以逃离局部最优。<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup> 现代直接搜索表述将严格改进替换为充分下降条件：当\( f(x_{k} + s) < f(x_{k}) - \rho(\alpha_{k}) \)时接受试探点\( x_{k} + s \)，然后将步长\( \alpha_{k} \)增大一个因子；否则减小步长。<sup>[5](https://arxiv.org/abs/2403.05322)</sup>

Matyás定理给出了局部化搜索的全局收敛性：当损失\( L \)在有界域上连续且扰动为独立同分布\( N(0, I_{p}) \)时，收敛是在“依概率”意义下的，原始证明包含错误，后由Baba等人(1977)修正。<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> 后续工作扩展了该理论：Baba证明了随机优化方法对约束优化问题的收敛性（Journal of Optimization Theory and Applications, 1981），<sup>[6](https://doi.org/10.1007/bf00935752)</sup> Solis和Wets在Mathematics of Operations Research (1981)中给出了局部化随机搜索算法的一般全局收敛定理，<sup>[7](https://doi.org/10.1287/moor.6.1.19)</sup> Dorea分析了该方法的期望步数(1983)，<sup>[8](https://doi.org/10.1007/bf00934526)</sup> 并有人为该算法提出了另一种采样策略。<sup>[9](https://doi.org/10.1007/bf00939677)</sup> 所有此类保证都是概率性的：最优解的保证仅在概率意义下提供，依赖于经典零一律论证。<sup>[10](https://ar5iv.labs.arxiv.org/html/2209.05759)</sup>

## 实施方法

通用的随机搜索循环包含三个步骤：从采样分布生成候选点，根据候选点和先前迭代更新当前点及算法参数，当满足停止准则时停止。<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup> 实践中，使用者选取初始点\( x_{0} \)，然后反复采样随机方向，在扰动点处评估目标函数，仅在改善时保留。一个经典教学版本在单位球面上采样方向\( u_{t} \)，通过精确线搜索设定步长\( \eta_{t} = \operatorname{argmin}_{\eta > 0} f(x_{t} - \eta u_{t}) \)，并更新\( x_{t+1} = x_{t} - \eta_{t} u_{t} \)。<sup>[11](https://gene.ttic.edu/pdfs/lecture_5_draft.pdf)</sup>

停止通常依据最大函数评估次数或目标值上的满意准则。<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> 步长可以固定、根据观察到的改进自适应调整，或沿每个方向优化。据报道，一种优化步长变体的收敛性对随机方向生成器的标准差不太敏感，这减轻了调参负担。<sup>[12](https://people.duke.edu/~hpgavin/cee251/Sheela-1979.pdf)</sup>

## 起源

Matyás的论文《随机优化》发表于Avtomatika i Telemekhanika第26卷第2期(1965)，第246–253页；该文提出了针对多变量的自适应随机优化方法，证明了随机状态序列收敛到最优状态，并描述了一种实现该方法的模拟电路。<sup>[2](https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=at&paperid=11288&option_lang=eng)</sup>

若干先驱工作塑造了这一背景。纯随机搜索简单地采样点并记录最佳值。<sup>[13](http://dspace.mit.edu/bitstream/handle/1721.1/49082/stochasticapproa00rinn.pdf%3Bsequence%3D1)</sup> White 1971年的综述梳理了这一研究方向，并将不等式约束、噪声测量和全局最优定位确定为该领域的核心问题。<sup>[14](https://journals.sagepub.com/doi/10.1177/003754977101700504)</sup> 在确定性方面，[Enrico Fermi](https://www.edgepedia.org/zh/enrico-fermi)和[Nicholas Metropolis](https://www.edgepedia.org/zh/nicholas-metropolis)在Los Alamos Maniac上使用了最早的[模式搜索](https://www.edgepedia.org/zh/pattern-search-optimization)算法之一，一次变化一个参数，当改进停止时将步长减半，<sup>[15](https://www.cs.odu.edu/~mln/ltrs-pdfs/icase-2000-26.pdf)</sup> 而“直接搜索”这一术语本身也是在那时被创造的。<sup>[5](https://arxiv.org/abs/2403.05322)</sup> 到1970年代初，直接搜索方法在数学优化界大体上失宠，因为它们缺乏连贯的数学分析，尽管用户因其易于编程而保持忠诚。<sup>[16](https://epubs.siam.org/doi/10.1137/S003614450242889)</sup>

## 变体

**自适应与优化步长。** Schumer和Steiglitz在IEEE Transactions on Automatic Control (1968)中引入了自适应步长随机搜索(ASSRS)。<sup>[17](https://doi.org/10.1109/tac.1968.1098903)</sup> Schrack和Choit的优化相对步长随机搜索(ORSSRS, Mathematical Programming, 1976)进一步精化了步长选择。<sup>[18](https://doi.org/10.1007/bf01580669)</sup> 优化步长随机搜索(OSSRS)则利用沿归一化随机方向\( R \)在\( h = -1, 0, +1 \)处的函数值拟合二次式\( F(h) = f(X_{i} + hR) = a \cdot h^{2} + b \cdot h + c \)，然后若二次极小点\( h' = -b/(2 \cdot a) \)改善函数值则移动到该点。<sup>[12](https://people.duke.edu/~hpgavin/cee251/Sheela-1979.pdf)</sup>

**逃离局部最优与加速搜索。** Li、Priemer和Cheng的带跳跃随机搜索(International Journal for Numerical Methods in Engineering, 2004)检查插值点以沿谷底跟踪，并执行跳跃到新起点以避免长时间停留在局部极小，且证明了以概率一收敛到全局极小。<sup>[19](https://doi.org/10.1002/nme.1014)</sup> 加速随机搜索(ARS, SIAM Journal on Optimization, 2004, 作者M. J. Appel、R. LaBarre和D. Radulovic)将搜索限制在记录生成点的收缩邻域内，当发现新记录时将邻域重新初始化为整个空间，并包含自动重启以避免局部极大；它以概率一收敛，按时间步计，收敛速度比纯随机搜索快，快出的倍数可调且可很大。<sup>[20](https://doi.org/10.1137/s105262340240063x)</sup>

## 应用

有记录的用途较为有限。Matyás的论文描述了一种实现该方法的模拟电路，<sup>[2](https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=at&paperid=11288&option_lang=eng)</sup> 后来的变体在标准优化测试函数上进行了评估：跳跃变体在七个常用测试函数上，<sup>[19](https://doi.org/10.1002/nme.1014)</sup> ARS在旅行商问题上与纯随机搜索和模拟退火算法进行了三方性能比较。<sup>[20](https://doi.org/10.1137/s105262340240063x)</sup>

## 局限性与替代方案

**失效模式。** 严格改进算法如果邻域或候选点生成过程过于受限，可能陷入局部最优。<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup> 噪声是第二个弱点：对形式为\( y(\theta) = L(\theta) + \varepsilon(\theta) \)的带噪声损失评估，随机搜索一般不能在严格意义上收敛，而对\( N \)次噪声评估取平均仅以\( 1/\sqrt{N} \)的速率降低误差，使噪声处理代价高昂。<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup>

**成本。** 维度依赖是该方法的根本成本问题。对于盲随机搜索，Spall给出了具体数字：要使\( p \)维单位超立方体的每个坐标以0.90的概率落在最优点的0.04范围内，从\( p = 1 \)到\( p = 10 \)需要大约\( 10^{10} \)倍的损失函数评估增长。<sup>[3](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)</sup> 保证在速率上也很弱：2023年的一项渐近收敛速率分析表明，某些随机搜索算法对任何非平凡连续优化问题都无法线性快速收敛。<sup>[21](https://link.springer.com/article/10.1007/s10898-023-01342-4)</sup>

**替代方案。** 模式搜索方法探索一个有理格点集，其分辨率由步长\( \Delta_{k} \)设定，<sup>[15](https://www.cs.odu.edu/~mln/ltrs-pdfs/icase-2000-26.pdf)</sup> 而Nelder–Mead单纯形法和进化算法不像现代直接搜索算法那样建立在坚实的理论基础上。<sup>[5](https://arxiv.org/abs/2403.05322)</sup> 相比之下，随机技术的主要优势是在各类问题（包括高维问题）上的稳健性能和简单实现；主要劣势是依赖众多输入参数以及可能非常缓慢的收敛。<sup>[10](https://ar5iv.labs.arxiv.org/html/2209.05759)</sup> 模拟退火以严格改进换取Metropolis上坡接受，代价是需要温度调度。<sup>[1](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)</sup>

## References

1. [Random Search Algorithms (review chapter, University of Washington course text)](https://courses.washington.edu/inde510/516/AdapRandomSearch4.05.2009.pdf)
2. [I. Mátyás, “Random Optimization”, Avtomat. i Telemekh., 26:2 (1965), 246–253](https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=at&paperid=11288&option_lang=eng)
3. [Stochastic Optimization (James C. Spall, Encyclopedia of Statistical Sciences / handbook chapter)](https://www.jhuapl.edu/spsa/PDF-SPSA/Handbook04_StochasticOptimization.pdf)
4. [Direct search for stochastic optimization in random subspaces with zeroth-, first-, and second-order convergence and expected complexity (Mathematical Programming)](https://link.springer.com/article/10.1007/s10107-026-02404-7)
5. [Direct-search methods in the year 2025: Theoretical guarantees and algorithmic paradigms (arXiv survey)](https://arxiv.org/abs/2403.05322)
6. [N. Baba (1981). Convergence of a random optimization method for constrained optimization problems. Journal of Optimization Theory and Applications.](https://doi.org/10.1007/bf00935752)
7. [Francisco J. Solis, Roger J.-B. Wets (1981). Minimization by Random Search Techniques. Mathematics of Operations Research.](https://doi.org/10.1287/moor.6.1.19)
8. [C. C. Y. Dorea (1983). Expected number of steps of a random optimization method. Journal of Optimization Theory and Applications.](https://doi.org/10.1007/bf00934526)
9. [C. C. Y. Dorea, C. R. Gon�alves (1993). Alternative sampling strategy for a random optimization algorithm. Journal of Optimization Theory and Applications.](https://doi.org/10.1007/bf00939677)
10. [An extensive numerical benchmark study of deterministic vs. stochastic derivative-free global optimization algorithms (arXiv, 2022)](https://ar5iv.labs.arxiv.org/html/2209.05759)
11. [Derivative Free Optimization (lecture notes, Toyota Technological Institute at Chicago)](https://gene.ttic.edu/pdfs/lecture_5_draft.pdf)
12. [An Optimized Step-Size Random Search (OSSRS) (Sheela, Computer Methods in Applied Mechanics and Engineering, 1979)](https://people.duke.edu/~hpgavin/cee251/Sheela-1979.pdf)
13. [Stochastic approaches to global optimization (MIT, Rinnooy Kan et al.)](http://dspace.mit.edu/bitstream/handle/1721.1/49082/stochasticapproa00rinn.pdf%3Bsequence%3D1)
14. [A survey of random methods for parameter optimization (R.C. White, SIMULATION, 1971)](https://journals.sagepub.com/doi/10.1177/003754977101700504)
15. [Direct Search Methods: Then and Now (Kolda, Lewis, Torczon, ICASE 2000)](https://www.cs.odu.edu/~mln/ltrs-pdfs/icase-2000-26.pdf)
16. [Optimization by Direct Search: New Perspectives on Some Classical and Modern Methods (SIAM Review, 2003)](https://epubs.siam.org/doi/10.1137/S003614450242889)
17. [M. Schumer, K. Steiglitz (1968). Adaptive step size random search. IEEE Transactions on Automatic Control.](https://doi.org/10.1109/tac.1968.1098903)
18. [Günther Schrack, Mark Choit (1976). Optimized relative step size random searches. Mathematical Programming.](https://doi.org/10.1007/bf01580669)
19. [Chunshien Li, Roland Priemer, Kuo‐Hsiang Cheng (2004). Optimization by random search with jumps. International Journal for Numerical Methods in Engineering.](https://doi.org/10.1002/nme.1014)
20. [M. J. Appel, R. LaBarre, D. Radulovic (2004). On Accelerated Random Search. SIAM Journal on Optimization.](https://doi.org/10.1137/s105262340240063x)
21. [On asymptotic convergence rate of random search (Journal of Global Optimization, 2023)](https://link.springer.com/article/10.1007/s10898-023-01342-4)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Optimization and dynamic programming › Local search and metaheuristics

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/random-optimization

English original: https://www.edgepedia.org/random-optimization
