# 回溯线搜索

回溯线搜索是一种迭代过程：它从某个试探步长出发，沿搜索方向反复将步长乘以常数因子 \( \rho \in (0,1) \)，直到某个充分下降条件成立为止。<sup>[1](https://arxiv.org/html/2408.13150)</sup> 它是下降方法中广泛应用的一种步长更新规则。<sup>[2](https://jhc.sjtu.edu.cn/public/home/kuanyang/teaching/MATH3806/notes/lec11.html)</sup> 与精确线搜索不同——后者沿方向最小化目标函数——回溯线搜索接受第一个足够好的步长，这种做法代价低廉且通常足够，因为沿直线方向的精确极小点很少是必需的。<sup>[2](https://jhc.sjtu.edu.cn/public/home/kuanyang/teaching/MATH3806/notes/lec11.html)</sup>

| 关键事实 | 陈述 |
|---|---|
| 输出 | 沿下降方向 \( p_k \) 满足 Armijo（充分下降）条件的步长 \( \alpha_k \)<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup> |
| 接受检验 | \( f(x_k + \alpha p_k) \le f(x_k) + c_1 \cdot \alpha \cdot \nabla f_k^{\top} \cdot p_k \)，其中 \( c_1 \) 通常取 \( 10^{-4} \)<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup> |
| 收缩因子 | \( \rho \) 大致在 0.1 到 0.8 之间，视文献来源而定；不存在单一标准值<sup>[1](https://arxiv.org/html/2408.13150)</sup> |
| 初始步长 | 在牛顿法和拟牛顿法中取 \( \bar{\alpha} = 1 \)<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup> |
| 收敛速率 | 对 \( L \)-光滑凸目标函数为 \( O(1/k) \)；在强凸性下为线性速率 \( O(c^k) \)<sup>[4](https://www.stat.cmu.edu/~ryantibs/convexopt-F16/lectures/grad-descent.pdf)</sup> |
| 主要结构性局限 | 回溯线搜索不强制满足 Wolfe 曲率条件，而拟牛顿法和共轭梯度法需要该条件<sup>[5](https://www.cs.cmu.edu/~pradeepr/convexopt/Lecture_Slides/Descent-Line-Search.pdf)</sup> |

## 工作原理

该方法作用于目标函数在搜索直线上的限制。Armijo 条件

\[ f(x_k + \alpha p_k) \le f(x_k) + c_1 \cdot \alpha \cdot \nabla f_k^{\top} \cdot p_k, \qquad 0 < c_1 < 1 \]

要求实际下降量达到线性模型所预测下降量的一个固定比例 \( c_1 \)。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup><sup> • </sup><sup>[6](https://math-5650-6650.readthedocs.io/en/latest/LineSearch.html)</sup> 任何满足该条件的步长都保证 \( f_{k+1} < f_k \)。<sup>[7](https://www.cs.purdue.edu/homes/dgleich/cs520-2026/notes/line-search-guaranteed-descent.pdf)</sup>

该条件之所以成为停止准则，是因为它把无界搜索转化为有限搜索：由于 \( \rho^{\nu} \downarrow 0 \)，不等式对所有足够小的 \( \alpha \) 都成立，因此循环在有限次收缩后终止。<sup>[8](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)</sup> 有两个相关条件为其提供了框架。Goldstein 条件是一对不等式

\[ f(x_k) + c \cdot \alpha \cdot \nabla f_k^{\top} \cdot p_k \le f(x_k + \alpha p_k) \le f(x_k) + (1-c) \cdot \alpha \cdot \nabla f_k^{\top} \cdot p_k, \qquad 0 < c < \tfrac{1}{2}, \]

其中第二个不等式即充分下降条件，第一个不等式排除过短的步长；其缺点在于第一个不等式可能排除 \( \phi \) 的所有极小点。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup> Wolfe 条件则将充分下降与曲率条件 \( \nabla f(x_k + \alpha p_k)^{\top} p_k \ge c_2 \cdot \nabla f_k^{\top} \cdot p_k \) 配对，其中 \( 0 < c_1 < c_2 < 1 \)。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup>

## 具体做法

给定 \( x_k \)、下降方向 \( p_k \)、初始步长 \( \bar{\alpha} > 0 \)、收缩因子 \( \rho \in (0,1) \) 以及常数 \( c \in (0,1) \)<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup>：

1. 置 \( \alpha \leftarrow \bar{\alpha} \)。
2. 当 \( f(x_k + \alpha p_k) > f(x_k) + c \cdot \alpha \cdot \nabla f_k^{\top} \cdot p_k \) 时，置 \( \alpha \leftarrow \rho \cdot \alpha \)。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup>
3. 返回 \( \alpha \)，即几何序列 \( \{ \bar{\alpha} \cdot \rho^{\nu} \} \) 中第一个（最大的）通过检验的成员。<sup>[8](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)</sup>

对于方向为 \( p_k = -\nabla f(x_k) \) 的梯度下降，检验式写作 \( f(x - t \cdot \nabla f(x)) > f(x) - \alpha \cdot t \lVert \nabla f(x) \rVert^2 \)，参数为 \( 0 < \beta < 1 \) 和 \( 0 < \alpha \le 1/2 \)。<sup>[4](https://www.stat.cmu.edu/~ryantibs/convexopt-F16/lectures/grad-descent.pdf)</sup>

已发表的参数建议各不相同。Burke 的讲义建议 \( \gamma \in [0.5, 0.8] \) 和 \( c \in [0.001, 0.1] \)，并根据函数求值的代价和非线性程度进行调整。<sup>[8](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)</sup> 佐治亚理工学院的讲义允许 \( c_1 \) 从 \( 10^{-4} \)（鼓励较大步长）到 0.3（鼓励较小步长），\( \rho \) 从 0.1（粗糙搜索）到 0.8（精细搜索），常用初始步长为 \( \bar{\alpha} = 1 \)。<sup>[9](https://mdav.ece.gatech.edu/ece-3803-fall2021/notes/11-notes-3803-f21.pdf)</sup> 一份 2024 年的实践综述记载：Boyd 和 Vandenberghe 建议 \( \rho \) 在 0.1 到 0.8 之间，Bertsekas 建议 \( 1/2 \) 到 \( 1/10 \)，并有 \( \rho = 0.8 \) 和 \( \rho = 0.5 \) 的具体用法；不存在标准选择。<sup>[1](https://arxiv.org/html/2408.13150)</sup>

初始步长与收缩因子同样重要。在牛顿法和拟牛顿法中，\( \bar{\alpha} = 1 \) 是标准做法，因为单位步长才能带来快速的局部收敛；最速下降等其他算法可能使用不同的值。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup><sup> • </sup><sup>[5](https://www.cs.cmu.edu/~pradeepr/convexopt/Lecture_Slides/Descent-Line-Search.pdf)</sup>

## 起源

充分下降规则由 Larry Armijo 在 1966 年发表于《太平洋数学杂志》的《具有 Lipschitz 连续一阶偏导数的函数的极小化》中提出。<sup>[10](https://doi.org/10.2140/pjm.1966.16.1)</sup> 该文仅三页，证明了梯度方法在梯度 Lipschitz 连续假设下的收敛性，并表明通常的最速下降法和一种修正的最速下降算法在同一假设下均收敛；修正算法允许步长由充分下降规则确定，而非精确极小化。<sup>[10](https://doi.org/10.2140/pjm.1966.16.1)</sup> 后来的文献将 Armijo 视为第一个利用带有简单充分下降条件的不精确线搜索证明该方法收敛到光滑函数的稳定点的人。<sup>[11](https://cs.nyu.edu/~overton/papers/pdffiles/gradientMethod.pdf)</sup> 其底层的梯度方法可追溯至 Cauchy。<sup>[11](https://cs.nyu.edu/~overton/papers/pdffiles/gradientMethod.pdf)</sup> 将充分下降与曲率条件相结合的线搜索条件——即 Wolfe 条件——由 Philip Wolfe 于 1969 年引入；Jorge J. Moré 和 David J. Thuente 后来在 1994 年发表于《ACM 数学软件汇刊》的《具有保证充分下降的线搜索算法》中提出了一种寻找满足此类条件的步长的算法<sup>[12](https://doi.org/10.1145/192115.192132)</sup>，该文指出曲率条件在拟牛顿法中尤为重要。“Armijo–Goldstein 不等式”和“Wolfe 条件”这两个名称在文献和优化软件中都是标准叫法。<sup>[8](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)</sup>

## 变体

Wolfe 条件有弱形式和强形式。弱形式试图使搜索方向在新点处不那么像下降方向，而强形式则推动方向导数更接近零；在基于线搜索的软件中，采用其中之一是标准做法。<sup>[8](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)</sup> 典型的 \( c_2 \) 取值为：牛顿或拟牛顿方向取 0.9，非线性共轭梯度取 0.1。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup> 弱形式的一个弱点在于，即使新点处的方向导数为正（意味着步长走得太远），它也可能成立，这促使了强形式的提出。<sup>[13](https://pages.cs.wisc.edu/~yudongchen/cs726_sp23/Lecture_20_line_search_modified_Newton.pdf)</sup> Wolfe 和强 Wolfe 线搜索比 Armijo 线搜索代价更高，因为它们需要额外的梯度求值。<sup>[14](https://ar5iv.labs.arxiv.org/html/1904.06321)</sup>

非单调准则放宽了每次迭代都必须使目标函数下降的要求，只要求某个聚合指标（如指数移动平均）下降。<sup>[1](https://arxiv.org/html/2408.13150)</sup> 对于随机优化，随机线搜索在训练小批量上强制 Armijo 条件，其合理性由过参数化神经网络中的插值性质所保证；2023 年的一种方法在那里用非单调准则加 Polyak 步长替代了 Armijo 条件。<sup>[1](https://arxiv.org/html/2408.13150)</sup> 自适应变体修改收缩本身：传统回溯只减小步长，而自适应方案既可以增大也可以减小步长。<sup>[15](https://opt-ml.org/papers/2019/paper_17.pdf)</sup> 自适应回溯（ABLS）将常数因子替换为

\[ \hat{\rho}(v(\alpha_k)) := \max\left( \epsilon, \; \rho^{\frac{1-c}{1 - c \cdot v(\alpha_k)}} \right), \]

其中 \( v(\alpha_k) \) 度量 Armijo 准则的违反程度；该因子可以根据需要增大或缩小步长，且无需额外的梯度求值，对于非凸光滑问题，它保持了梯度下降和加速梯度下降的收敛速率。<sup>[1](https://arxiv.org/html/2408.13150)</sup>

## 应用

回溯线搜索是牛顿型方法的标准线搜索。在那里必须取初始步长 \( \alpha = 1 \) 以实现快速的局部收敛<sup>[8](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)</sup>，而由于回溯从大步长开始并收缩，它确保得到一个合理较大的被接受步长 \( \alpha_k \)，而无需显式检验曲率条件。<sup>[13](https://pages.cs.wisc.edu/~yudongchen/cs726_sp23/Lecture_20_line_search_modified_Newton.pdf)</sup> 然而，它不太适合拟牛顿法和共轭梯度法，因为这些方法依赖曲率条件。<sup>[3](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)</sup><sup> • </sup><sup>[13](https://pages.cs.wisc.edu/~yudongchen/cs726_sp23/Lecture_20_line_search_modified_Newton.pdf)</sup> 在共轭梯度法中，利害关系是具体的：FR 共轭梯度法在强 Wolfe 条件 \( 0 < c_1 < c_2 < 1/2 \) 下全局收敛，而当 \( c_2 > 1/2 \) 时 FR 方向可能不是下降方向。<sup>[14](https://ar5iv.labs.arxiv.org/html/1904.06321)</sup>

在机器学习中，Armijo 型准则出现在生产级库中。DeepMind 的 optax 实现了一种线搜索，强制 \( f(w + \eta \cdot u) \le (1 + \delta) f(w) + \eta \cdot c \langle u, \nabla f(w) \rangle + \epsilon \)，这是对学习率 \( \eta \) 的稳健 Armijo 型检验。<sup>[16](https://github.com/google-deepmind/optax/blob/main/optax/%5Fsrc/linesearch.py)</sup> 在小批量上检验充分下降、并自适应选择样本量的随机线搜索，以概率一按与确定性梯度下降相同的速率收敛：非凸 \( O(\varepsilon^{-2}) \)、凸 \( O(\varepsilon^{-1}) \)、强凸 \( O(\log(\varepsilon^{-1})) \)。<sup>[17](https://epubs.siam.org/doi/10.1137/18M1216250)</sup>

## 局限与替代方案

核心的结构性局限在于缺少曲率保证。Wolfe 条件关于步长不是仿射的，且任意小的步长不满足该条件，因此回溯线搜索无法强制满足它；这对拟牛顿法很重要，因为其全局收敛分析要用到该条件。<sup>[1](https://arxiv.org/html/2408.13150)</sup><sup> • </sup><sup>[12](https://doi.org/10.1145/192115.192132)</sup> Armijo 方法的收敛速率还取决于实际取到的最小步长：设初始步长为 \( T_0 \) 且梯度为真实梯度，\( t_{\min} \ge \min(T_0, \beta/L) \)，因此远小于 \( 1/L \) 的 \( T_0 \) 会减慢收敛。<sup>[18](https://ar5iv.labs.arxiv.org/html/2011.04721)</sup>

对于 \( f \) 二次连续可微且下水平集有界的回溯梯度下降，\( \nabla f(x_k) \to 0 \)，因此每个聚点都是一阶稳定点。<sup>[19](https://www.math.ntnu.no/emner/TMA4180/2024v/Backtracking.pdf)</sup> 在梯度 \( L \)-Lipschitz 条件下，带回溯的梯度下降满足

\[ f(x^{(k)}) - f^{*} \le \frac{\lVert x^{(0)} - x^{*} \rVert_2^2}{2 \cdot t_{\min} \cdot k}, \qquad t_{\min} = \min\{1, \beta/L \}, \]

因此相对于固定步长 \( 1/L \) 损失很小<sup>[4](https://www.stat.cmu.edu/~ryantibs/convexopt-F16/lectures/grad-descent.pdf)</sup>；对于 \( M \)-光滑函数，这就是通常的 \( O(1/k) \) 误差界。<sup>[9](https://mdav.ece.gatech.edu/ece-3803-fall2021/notes/11-notes-3803-f21.pdf)</sup> 在强凸性下速率变为线性 \( O(c^k) \)，需要 \( O(\log(1/\varepsilon)) \) 次迭代。<sup>[4](https://www.stat.cmu.edu/~ryantibs/convexopt-F16/lectures/grad-descent.pdf)</sup> 带回溯的阻尼牛顿法（\( \bar{\alpha} = 1 \)，\( c < 0.5 \)）对于 Hessian Lipschitz 的强凸光滑函数全局收敛，先经历一个阻尼阶段，随后进入一个 \( \alpha = 1 \) 总被接受的二次收敛阶段。<sup>[13](https://pages.cs.wisc.edu/~yudongchen/cs726_sp23/Lecture_20_line_search_modified_Newton.pdf)</sup>

已知的失效模式是具体的。单纯的下降 \( f(x_k + \alpha p_k) < f(x_k) \) 并不保证收敛：对于 \( f(x) = (x^2 - 1)^2 \)，\( f'(x) = 4x(x^2 - 1) \)，梯度步长 \( \alpha = 1 \)，从 \( x_0 = 1.1 \) 出发，第一次更新为 \( x_1 = 0.176 \)，目标函数从 \( f(x_0) = 0.0441 \) 增大到约 \( f(x_1) = 0.939 \)，因此即使采用下降的更新规则，目标函数也未必每一步都下降。<sup>[19](https://www.math.ntnu.no/emner/TMA4180/2024v/Backtracking.pdf)</sup> 仅凭 Armijo 条件可以防止步长过大，但不能排除极小的步长，后者同样有害；从较大的 \( \alpha \) 开始回溯可以解决这一问题。<sup>[9](https://mdav.ece.gatech.edu/ece-3803-fall2021/notes/11-notes-3803-f21.pdf)</sup> 最速下降（Cauchy）方向总能给出严格下降，但在稳定点附近过程会急剧减慢，极小的步长下数值误差占主导，迭代行为变得混沌。<sup>[20](https://sites.math.washington.edu/~burke/crs/408/lectures/L7-line-search.pdf)</sup>

与其他方案比较：精确线搜索沿方向最小化 \( \phi \)，但代价高昂且通常不必要。<sup>[2](https://jhc.sjtu.edu.cn/public/home/kuanyang/teaching/MATH3806/notes/lec11.html)</sup> 采用固定步长的最速下降法在梯度 \( L \)-Lipschitz 且 \( 0 < \alpha < 2/L \) 时收敛，对于 Hessian 为 \( Q \) 的二次目标函数当且仅当 \( 0 < \alpha < 2/\lambda_{\max}(Q) \) 时收敛，但这需要知道这些常数。<sup>[21](https://solmaz.eng.uci.edu/Teaching/MAE206/Lecture4.pdf)</sup> 信赖域方法颠倒了选择的顺序：线搜索先选方向再选可接受的步长，而信赖域方法先选最大距离（半径 \( \Delta_k \)），然后在其约束下计算最佳方向和步长；在 BFGS 实现中，线搜索总是先尝试 \( \alpha = 1 \)，这对超线性收敛至关重要，而当施加 Wolfe 条件时，割线要求 \( s_k^{\top} y_k > 0 \) 得到保证。<sup>[22](https://www.marcosutti.net/files/Notes_BFGS.pdf)</sup>

## References

1. [Adaptive Backtracking Line Search (arXiv 2408.13150, 2024)](https://arxiv.org/html/2408.13150)
2. [Lecture 11: Line Search (SJTU MATH3806 notes)](https://jhc.sjtu.edu.cn/public/home/kuanyang/teaching/MATH3806/notes/lec11.html)
3. [Line search methods: sufficient decrease and backtracking (numerical optimization notes, following Nocedal & Wright)](https://num-opt-notes.readthedocs.io/en/latest/chapter3-1.html)
4. [Gradient Descent (CMU 10-725 Convex Optimization lecture notes)](https://www.stat.cmu.edu/~ryantibs/convexopt-F16/lectures/grad-descent.pdf)
5. [Descent-Line-Search (CMU Convex Optimization lecture slides, based on Nocedal & Wright)](https://www.cs.cmu.edu/~pradeepr/convexopt/Lecture_Slides/Descent-Line-Search.pdf)
6. [Line Search Methods, Theory of Nonlinear Optimization (course notes)](https://math-5650-6650.readthedocs.io/en/latest/LineSearch.html)
7. [Line search and the Wolfe conditions (David F. Gleich, Purdue CS520 notes)](https://www.cs.purdue.edu/homes/dgleich/cs520-2026/notes/line-search-guaranteed-descent.pdf)
8. [Line search notes (UW Math 408, J. V. Burke)](https://sites.math.washington.edu/~burke/crs/408/notes/nlp/line.pdf)
9. [Line search methods (Georgia Tech ECE 3803 notes, M. Davenport, 2021)](https://mdav.ece.gatech.edu/ece-3803-fall2021/notes/11-notes-3803-f21.pdf)
10. [Larry Armijo (1966). Minimization of functions having Lipschitz continuous first partial derivatives. Pacific Journal of Mathematics.](https://doi.org/10.2140/pjm.1966.16.1)
11. [Analysis of the gradient method with an Armijo–Wolfe line search on a class of non-smooth convex functions](https://cs.nyu.edu/~overton/papers/pdffiles/gradientMethod.pdf)
12. [Jorge J. Moré, David J. Thuente (1994). Line search algorithms with guaranteed sufficient decrease. ACM Transactions on Mathematical Software.](https://doi.org/10.1145/192115.192132)
13. [Lecture 20: Line Search Procedures; Newton's Method with Hessian Modification (Yudong Chen, UW-Madison)](https://pages.cs.wisc.edu/~yudongchen/cs726_sp23/Lecture_20_line_search_modified_Newton.pdf)
14. [A globally convergent gradient-like method based on the Armijo line search (arXiv 1904.06321)](https://ar5iv.labs.arxiv.org/html/1904.06321)
15. [Choosing the Step Size: Intuitive Line Search Algorithms with Efficient Convergence (OPT 2019 workshop)](https://opt-ml.org/papers/2019/paper_17.pdf)
16. [optax linesearch.py (Google DeepMind)](https://github.com/google-deepmind/optax/blob/main/optax/%5Fsrc/linesearch.py)
17. [A Stochastic Line Search Method with Expected Complexity Analysis (SIAM; publisher version of arXiv 1807.07994)](https://epubs.siam.org/doi/10.1137/18M1216250)
18. [Approximately Exact Line Search (arXiv:2011.04721)](https://ar5iv.labs.arxiv.org/html/2011.04721)
19. [Backtracking line search (NTNU TMA4180 Optimization lecture notes, Markus Grasmair, 2024)](https://www.math.ntnu.no/emner/TMA4180/2024v/Backtracking.pdf)
20. [Math 408A Line Search Methods (lecture slides, University of Washington)](https://sites.math.washington.edu/~burke/crs/408/lectures/L7-line-search.pdf)
21. [Optimization Methods Lecture 4 (Solmaz Kia, UC Irvine)](https://solmaz.eng.uci.edu/Teaching/MAE206/Lecture4.pdf)
22. [Notes on line search, trust regions, and the BFGS methods (2024)](https://www.marcosutti.net/files/Notes_BFGS.pdf)

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

Topic: 物质世界与数学 › 数学与统计学 › 数学分析与数学模型 › Numerical analysis and computation › Optimization algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/backtracking-line-search

English original: https://www.edgepedia.org/backtracking-line-search
