# 随机逼近

随机逼近是一类迭代算法，它从一系列带噪的随机观测中估计未知函数的根，或目标函数的最优值。赫伯特·罗宾斯（Herbert Robbins）和萨顿·门罗（Sutton Monro）于1951年提出了求根版本，即寻找解 \( x = \theta \)，其中 \( M(x) \) 是仅能在带有随机误差的情况下观测到的未知均值响应。<sup>[1](https://doi.org/10.1214/aoms/1177729586)</sup> 将目标函数设为梯度，该递推就变为随机梯度下降，这是现代机器学习训练中很大一部分更新步骤背后的方法。<sup>[2](https://bactra.org/notebooks/stochastic-approximation.html)</sup><sup> • </sup><sup>[3](https://people.eecs.berkeley.edu/~brecht/opt4ml_book/O4MD_05_SGM.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 解决的问题 | 从带噪观测中求未知回归函数的根，或求其最大值<sup>[1](https://doi.org/10.1214/aoms/1177729586)</sup><sup> • </sup><sup>[4](https://doi.org/10.1214/aoms/1177729392)</sup> |
| 核心更新 | \( x_{n+1} = x_n + a_n(Y_n(x_n) - \alpha) \)<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup> |
| 步长条件 | \( \sum a_n = \infty \) 且 \( \sum a_n^2 < \infty \)<sup>[6](https://par.nsf.gov/servlets/purl/10304143)</sup> |
| 收敛意义 | 在单调性、线性增长和独立误差条件下，以概率1收敛且均方收敛<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup> |
| 最优速率 | 对于普通随机预言机，\( O(1/\sqrt{k}) \) 是最优的；强凸性可达到 \( O(1/k) \)<sup>[7](https://www.math.univ-toulouse.fr/~epauwels/M2RI/session6.pdf)</sup> |
| 与SGD的关系 | 随机梯度下降是 \( h = -\nabla f \) 的特例<sup>[8](https://www.math.univ-toulouse.fr/%7Egfort/Slides/IMSIMB24.pdf)</sup> |
| 主要证明工具 | 非负上鞅收敛定理和ODE方法<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup><sup> • </sup><sup>[9](https://wires.onlinelibrary.wiley.com/doi/10.1002/wics.57)</sup> |

## 工作原理

罗宾斯–门罗递推用一个带噪观测乘以小的正增益来更新当前估计：\( X_{n+1} = X_n + a_n(Y_n(X_n) - \alpha) \)。<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup> 在现代分析所用的一般形式中，\( X_{k+1} = X_k + \alpha_k(h(X_k) + M_{k+1}) \)，其中 \( h \) 是待求其根的平均场，\( (M_k) \) 是条件均值为零、条件二阶矩有界的鞅差噪声序列。<sup>[7](https://www.math.univ-toulouse.fr/~epauwels/M2RI/session6.pdf)</sup> 两个步长条件各司其职：\( \sum a_n^2 < \infty \) 使累积噪声在 \( L_2 \) 中且几乎必然收敛，而 \( \sum a_n = \infty \) 确保偏差消失。<sup>[6](https://par.nsf.gov/servlets/purl/10304143)</sup> 在这些条件下，当 \( R(x) \) 递增且至多线性增长、误差独立时，\( X_n \) 以概率1且均方收敛到根。<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup> 1951年的原始证明本身建立了 \( \mathbb{E}(x_n - \theta)^2 \to 0 \)，即均方收敛从而依概率收敛；Blum（1954）后来用鞅论在更弱的条件下证明了几乎必然收敛。<sup>[1](https://doi.org/10.1214/aoms/1177729586)</sup><sup> • </sup><sup>[6](https://par.nsf.gov/servlets/purl/10304143)</sup> 归一化迭代值渐近服从高斯分布，其最小极限方差在增益 \( a_0 = -[R'(x_0)]^{-1} \) 处取得，但该增益在实践中不可达，因为 \( R \) 未知；自适应方法可近似它。<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup> 收敛性可通过非负上鞅收敛定理证明，或对一般噪声通过ODE方法证明——在ODE方法中，插值算法跟踪某个常微分方程的解。<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup><sup> • </sup><sup>[9](https://wires.onlinelibrary.wiley.com/doi/10.1002/wics.57)</sup> 随机梯度方法迭代 \( x_{k+1} = x_k - \alpha_k g(x_k, \xi_k) \)，其中 \( \mathbb{E}_{\xi}[g(x, \xi)] = \nabla f(x) \) 表明该梯度估计无偏；Bottou、Curtis和Nocedal将这一方法追溯到1951年罗宾斯–门罗的工作。<sup>[3](https://people.eecs.berkeley.edu/~brecht/opt4ml_book/O4MD_05_SGM.pdf)</sup> 用随机逼近的术语来说，它正是 \( h = -\nabla f \) 的情形。<sup>[8](https://www.math.univ-toulouse.fr/%7Egfort/Slides/IMSIMB24.pdf)</sup><sup> • </sup><sup>[2](https://bactra.org/notebooks/stochastic-approximation.html)</sup> 其极限ODE为梯度流 \( \dot{x}(t) = -\nabla f(x(t)) \)，迭代值几乎必然收敛到临界点集合，将极大值和鞍点视为不稳定平衡。<sup>[10](https://www.professeurs.polymtl.ca/jerome.le-ny/teaching/DP_fall09/notes/lec11_SA.pdf)</sup>

## 实施方法

实践者需选择平均场 \( h \)、返回 \( h(x) \) 加噪声的随机预言机，以及步长调度方案。对于形如 \( \gamma_n = C \cdot n^{-\alpha} \) 的调度，均方收敛要求 \( \alpha \in (0,1) \)；当 \( \alpha = 1 \) 时仅当 \( C \) 足够大才收敛，而 \( \alpha > 1 \) 会使步长过小以致误差界无法消失。<sup>[11](https://www.di.ens.fr/%7efbach/orsay2016/lecture3.pdf)</sup> 取 \( \gamma = C/n \) 时，渐近正态性要求 \( 2C \cdot \lambda_{\min}(A) > 1 \)，其中 \( A \) 是 \( h \) 在根处的微分；\( C \) 过小则不收敛，\( C \) 过大则方差大。<sup>[11](https://www.di.ens.fr/%7efbach/orsay2016/lecture3.pdf)</sup> 常数步长在随机情形下不收敛，因此使用递减步长或按通常0.8到0.9之间的因子缩减的轮次方案。<sup>[3](https://people.eecs.berkeley.edu/~brecht/opt4ml_book/O4MD_05_SGM.pdf)</sup> 取 \( \eta_t = \eta_0/t \) 时，真实解附近的RMSE与 \( \eta_0 \) 成正比，可任意缩小。<sup>[2](https://bactra.org/notebooks/stochastic-approximation.html)</sup> 通常会在较长步长的运行之上加入迭代值平均。原始的 \( \alpha_k = 1/(k+1) \) 使迭代值成为所有样本的累积平均。<sup>[3](https://people.eecs.berkeley.edu/~brecht/opt4ml_book/O4MD_05_SGM.pdf)</sup> 对于凸的Lipschitz目标函数，\( O(1/\sqrt{k}) \) 速率是随机预言机优化的最优速率；强凸性可达到 \( O(1/k) \)，方差缩减对有限和问题可给出线性速率。<sup>[7](https://www.math.univ-toulouse.fr/~epauwels/M2RI/session6.pdf)</sup> 无强凸性时，取 \( \gamma_n = C \cdot n^{-\alpha} \) 的普通SGD最多达到 \( O(n^{-1/3}) \)，低于极小极大最优的 \( O(n^{-1/2}) \)，而取 \( \alpha > 1/2 \) 的Polyak–Ruppert平均可将速率提升至 \( O(n^{-\alpha}) \)。<sup>[12](https://papers.nips.cc/paper/2011/file/40008b9a5380fcacce3976bf7c08af5b-Paper.pdf)</sup>

## 起源

该方法由赫伯特·罗宾斯和萨顿·门罗于1951年在《数理统计年鉴》（The Annals of Mathematical Statistics）发表的《一种随机逼近方法》（“A Stochastic Approximation Method”）中报道。<sup>[1](https://doi.org/10.1214/aoms/1177729586)</sup> J. Kiefer和J. Wolfowitz在同一期刊1952年（第23卷第3期，第462–466页）发表了随机最优版本《回归函数最大值的随机估计》（“Stochastic Estimation of the Maximum of a Regression Function”）。<sup>[4](https://doi.org/10.1214/aoms/1177729392)</sup> Blum（1954）通过鞅证明了几乎必然收敛，早期谱系还包括Wolfowitz（1952）和Dvoretzky（1956）。<sup>[6](https://par.nsf.gov/servlets/purl/10304143)</sup><sup> • </sup><sup>[8](https://www.math.univ-toulouse.fr/%7Egfort/Slides/IMSIMB24.pdf)</sup> Ljung于1977年在《IEEE自动控制汇刊》（IEEE Transactions on Automatic Control）上发表的论文《递归随机算法分析》（“Analysis of recursive stochastic algorithms”）引入了用于分析此类递推的ODE方法。<sup>[13](https://doi.org/10.1109/tac.1977.1101561)</sup> 后来的里程碑包括Polyak和Juditsky的平均论文（1992），<sup>[14](https://doi.org/10.1137/0330046)</sup> Kushner和Yang的最优速率扩展（1993），<sup>[15](https://doi.org/10.1137/0331047)</sup> Borkar的双时间尺度方案（1997），<sup>[16](https://doi.org/10.1016/s0167-6911%2897%2990015-3)</sup> 以及Spall的同时扰动方法（2000）。<sup>[17](https://doi.org/10.1109/tac.2000.880982)</sup>

## 变体

Kiefer–Wolfowitz方法通过有限差分估计梯度，\( X_{n+1} - X_n = a_n[Y_n(X_n + C_n) - Y_n(X_n - C_n)]/(2C_n) \)，条件为 \( \sum a_n \cdot C_n < \infty \)、\( \sum a_n^2/C_n^2 < \infty \)、\( C_n \to 0 \) 和 \( \sum C_n = \infty \)。<sup>[5](https://encyclopediaofmath.org/wiki/Stochastic_approximation)</sup> 在 \( d \) 维中每次迭代需要 \( 2d \) 次函数求值（单侧差分则为 \( d+1 \) 次）；Spall的SPSA通过用随机 \( \pm 1 \) 分量同时扰动所有坐标，将其减少到两次求值。<sup>[10](https://www.professeurs.polymtl.ca/jerome.le-ny/teaching/DP_fall09/notes/lec11_SA.pdf)</sup><sup> • </sup><sup>[18](https://www.jhuapl.edu/spsa/Comp_Stat_handbook_2nd-edition_Spall.pdf)</sup> Polyak和Juditsky 1992年的算法对轨迹取平均，达到了经典优化和辨识问题可能的最高收敛速率；<sup>[14](https://doi.org/10.1137/0330046)</sup> Kushner和Yang证明了只要经典渐近正态性成立，最优速率就是通用的。<sup>[15](https://doi.org/10.1137/0331047)</sup> 双时间尺度随机逼近运行耦合递推，使较快的迭代值将较慢的视为准静态，分析归结为奇异摄动ODE。<sup>[16](https://doi.org/10.1016/s0167-6911%2897%2990015-3)</sup> 在动力系统视角下，插值迭代值是极限ODE的渐近伪轨迹，收敛到排斥集（如线性不稳定平衡和周期轨道）的概率为零。<sup>[19](https://numdam.org/item/SPS_1999__33__1_0.pdf)</sup> 增量梯度方法，也称感知机或反向传播，是常见的有限和变体；步长恒为 \( \alpha_k \equiv 1 \) 的SGM即随机Kaczmarz方法，可达到线性收敛。<sup>[3](https://people.eecs.berkeley.edu/~brecht/opt4ml_book/O4MD_05_SGM.pdf)</sup>

## 应用

罗宾斯和门罗自己的应用是从二值响应数据中递推估计分位数，例如生物检定中的半数致死剂量，其估计量是无分布假设的。<sup>[1](https://doi.org/10.1214/aoms/1177729586)</sup> 在强化学习中，TD(0)是一种随机逼近，<sup>[8](https://www.math.univ-toulouse.fr/%7Egfort/Slides/IMSIMB24.pdf)</sup> Q学习由Watkins和Dayan于1992年在《机器学习》（Machine Learning）上发表，<sup>[20](https://doi.org/10.1007/bf00992698)</sup> Borkar和Meyn首次证明了异步自适应评价器和Q学习算法在平均代价最优控制问题中收敛。<sup>[21](https://faculty.eng.ufl.edu/meyn/wp-content/uploads/sites/671/archive/spm_files/Papers_pdf/ode.pdf)</sup> 方差缩减预言机可推广到一般随机逼近，应用于随机EM（SAEM）和在线EM。<sup>[8](https://www.math.univ-toulouse.fr/%7Egfort/Slides/IMSIMB24.pdf)</sup> Benaim的综述列出了该理论应用的领域，包括信号处理、自适应控制、神经网络和博弈论，<sup>[19](https://numdam.org/item/SPS_1999__33__1_0.pdf)</sup> 而SGD实例占据了当今大规模机器学习计算的大部分。<sup>[2](https://bactra.org/notebooks/stochastic-approximation.html)</sup>

## 局限与替代方案

步长选择是主要的实际敏感性问题：取 \( \gamma = C/n \) 时，当 \( 2C \cdot \lambda_{\min}(A) \le 1 \) 时收敛失败。<sup>[11](https://www.di.ens.fr/%7efbach/orsay2016/lecture3.pdf)</sup> Borkar和Meyn的准则将算法的稳定性与缩放极限ODE原点的渐近稳定性联系起来，后者又蕴含收敛性。<sup>[21](https://faculty.eng.ufl.edu/meyn/wp-content/uploads/sites/671/archive/spm_files/Papers_pdf/ode.pdf)</sup> 固定步长 \( \alpha \) 时迭代值不收敛，但 \( \limsup \mathbb{E}\|\theta_n - \theta^*\|^2 = O(\alpha) \)，平均固定步长估计收敛到 \( \theta^* + \alpha \cdot \bar{u}^* + O(\alpha^2) \)，偏差为 \( O(\alpha) \) 阶，因此在强化学习应用中 vanishing-gain 算法更可取。<sup>[22](https://arxiv.org/html/2309.02944)</sup> 乘性噪声可产生具有幂律尾 \( P(\|W\| > t) = \Omega(t^{-\alpha}) \) 的重尾平稳分布，即使数据和加性噪声都是轻尾的；乘性噪声下的平均会产生比任何次Weibull分布更重的尾。<sup>[23](https://ar5iv.labs.arxiv.org/html/2006.06293)</sup> 动量和Adam等自适应优化器引入几何衰减，可防止重尾波动，可能在利用附近最优点的同时限制探索。<sup>[23](https://ar5iv.labs.arxiv.org/html/2006.06293)</sup> 非凸性的危害比直觉要小：迭代值收敛到排斥集（包括线性不稳定平衡和周期轨道）的概率为零。<sup>[19](https://numdam.org/item/SPS_1999__33__1_0.pdf)</sup> 与确定性方法相比，有限差分随机逼近在 \( p \) 维中每个梯度需要 \( 2p \) 次损失测量，SPSA需要两次，而自适应SPSA同时估计Hessian，产生Newton–Raphson算法的随机对应形式，具有近最优收敛速率。<sup>[18](https://www.jhuapl.edu/spsa/Comp_Stat_handbook_2nd-edition_Spall.pdf)</sup>

## References

1. [Herbert Robbins, Sutton Monro (1951). A Stochastic Approximation Method. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177729586)
2. [Stochastic Approximation Algorithms (Including Stochastic Gradient Descent), Cosma Shalizi's notebook](https://bactra.org/notebooks/stochastic-approximation.html)
3. [The Stochastic Gradient Method (Chapter 5, Optimization Methods for ML, Bottou, Curtis & Nocedal)](https://people.eecs.berkeley.edu/~brecht/opt4ml_book/O4MD_05_SGM.pdf)
4. [J. Kiefer, J. Wolfowitz (1952). Stochastic Estimation of the Maximum of a Regression Function. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177729392)
5. [Stochastic approximation, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Stochastic_approximation)
6. [Historical review of stochastic approximation (Lai, NSF PAR deposited review)](https://par.nsf.gov/servlets/purl/10304143)
7. [Chapter 6: Stochastic approximation for large sums (lecture notes, E. Pauwels, Université de Toulouse)](https://www.math.univ-toulouse.fr/~epauwels/M2RI/session6.pdf)
8. [Stochastic Approximation: Finite-time analyses and Variance Reduction (Fort, seminar slides, Nov 2024)](https://www.math.univ-toulouse.fr/%7Egfort/Slides/IMSIMB24.pdf)
9. [Stochastic approximation: a survey (Kushner, WIREs Computational Statistics, 2009)](https://wires.onlinelibrary.wiley.com/doi/10.1002/wics.57)
10. [Introduction to Stochastic Approximation Algorithms (J. Le Ny, Polytechnique Montréal lecture notes)](https://www.professeurs.polymtl.ca/jerome.le-ny/teaching/DP_fall09/notes/lec11_SA.pdf)
11. [Lecture 3: Robbins–Monro algorithm (F. Bach, ENS/Orsay 2016)](https://www.di.ens.fr/%7efbach/orsay2016/lecture3.pdf)
12. [Non-Asymptotic Analysis of Stochastic Approximation Algorithms for Machine Learning (Bach & Moulines, NIPS 2011)](https://papers.nips.cc/paper/2011/file/40008b9a5380fcacce3976bf7c08af5b-Paper.pdf)
13. [L. Ljung (1977). Analysis of recursive stochastic algorithms. IEEE Transactions on Automatic Control.](https://doi.org/10.1109/tac.1977.1101561)
14. [B. T. Polyak, A. B. Juditsky (1992). Acceleration of Stochastic Approximation by Averaging. SIAM Journal on Control and Optimization.](https://doi.org/10.1137/0330046)
15. [Harold J. Kushner, Jichuan Yang (1993). Stochastic Approximation with Averaging of the Iterates: Optimal Asymptotic Rate of Convergence for General Processes. SIAM Journal on Control and Optimization.](https://doi.org/10.1137/0331047)
16. [Stochastic approximation with two time scales (Systems & Control Letters, 1997)](https://doi.org/10.1016/s0167-6911%2897%2990015-3)
17. [J.C. Spall (2000). Adaptive stochastic approximation by the simultaneous perturbation method. IEEE Transactions on Automatic Control.](https://doi.org/10.1109/tac.2000.880982)
18. [Stochastic Optimization (Spall, Computational Statistics handbook chapter)](https://www.jhuapl.edu/spsa/Comp_Stat_handbook_2nd-edition_Spall.pdf)
19. [Dynamics of stochastic approximation algorithms (Benaim, Séminaire de Probabilités 33)](https://numdam.org/item/SPS_1999__33__1_0.pdf)
20. [Christopher J. C. H. Watkins, Peter Dayan (1992). Q-learning. Machine Learning.](https://doi.org/10.1007/bf00992698)
21. [Stochastic Approximation and Reinforcement Learning (Borkar & Meyn, SIAM J. Control Optim.)](https://faculty.eng.ufl.edu/meyn/wp-content/uploads/sites/671/archive/spm_files/Papers_pdf/ode.pdf)
22. [The case for and against fixed step-size: Stochastic approximation algorithms in optimization and machine learning (arXiv)](https://arxiv.org/html/2309.02944)
23. [Multiplicative noise and heavy tails in stochastic optimization](https://ar5iv.labs.arxiv.org/html/2006.06293)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/stochastic-approximation

English original: https://www.edgepedia.org/stochastic-approximation
