In (unconstrained) mathematical optimization, a backtracking line search is a line search method to determine the amount to move along a given search direction. Its use requires that the objective function is differentiable and that its gradient is known. The method involves starting with a relatively large estimate of the step size for movement along the line search direction, and iteratively shrinking the step size (i.e., "backtracking") until a decrease of the objective function is observed that adequately corresponds to the amount of decrease that is expected, based on the step size and the local gradient of the objective function. A common stopping criterion is the Armijo–Goldstein condition, named after mathematicians Larry Armijo and Allen A. Goldstein. Backtracking line search is typically used for gradient descent (GD), but it can also be used in other contexts. For example, it can be used with Newton's method if the Hessian matrix is positive definite.
Motivation Given a starting position 𝐱 and a search direction 𝐩, the task of a line search is to determine a step size α>0 that adequately reduces the objective function f:ℝn→ℝ (assumed C1 i.e. continuously differentiable), i.e., to find a value of α that reduces f(𝐱+α𝐩) relative to f(𝐱). However, it is usually undesirable to devote substantial resources to finding a value of α to precisely minimize f. This is because the computing resources needed to find a more precise minimum along one particular direction could instead be employed to identify a better search direction. Once an improved starting point has been identified by the line search, another subsequent line search will ordinarily be performed in a new direction. The goal, then, is just to identify a value of α that provides a reasonable amount of improvement in the objective function, rather than to find the actual minimizing value of α. The backtracking line search starts with a large estimate of α and iteratively shrinks it. The shrinking continues until a value is found that is small enough to provide a decrease in the objective function that adequately matches the decrease that is expected to be achieved, based on the local function gradient ∇f(𝐱). Define the local slope of the function of α along the search direction 𝐩 as m=∇f(𝐱)T𝐩=⟨∇f(𝐱),𝐩⟩ (where ⟨⋅,⋅⟩ denotes the dot product). It is assumed that 𝐩 is a vector for which some local decrease is possible, i.e., it is assumed that m<0. Based on a selected control parameter c∈(0,1), the Armijo–Goldstein condition tests whether a step-wise movement from a current position 𝐱 to a modified position 𝐱+α𝐩 achieves an adequately corresponding decrease in the objective function. The condition is fulfilled, see Armijo (1966), if f(𝐱+α𝐩)≤f(𝐱)+αcm. This condition, when used appropriately as part of a line search, can ensure that the step size is not excessively large. However, this condition is not sufficient on its own to ensure that the step size is nearly optimal, since any value of α that is sufficiently small will satisfy the condition. Thus, the backtracking line search strategy starts with a relatively large step size, and repeatedly shrinks it by a factor τ∈(0,1) until the Armijo–Goldstein condition is fulfilled. The search will terminate after a finite number of steps for any positive values of c and τ that are less than 1. For example, Armijo used 1⁄2 for both c and τ in Armijo (1966).
Algorithm This condition is from Armijo (1966). Starting with a maximum candidate step size value α0>0, using search control parameters τ∈(0,1) and c∈(0,1), the backtracking line search algorithm can be expressed as follows:
Set t=−cm and iteration counter j=0. Until the condition is satisfied that f(𝐱)−f(𝐱+αj𝐩)≥αjt, repeatedly increment j and set αj=ταj−1. Return αj as the solution. In other words, reduce α0 by a factor of τ in each iteration until the Armijo–Goldstein condition is fulfilled.
Function minimization using backtracking line search in practice In practice, the above algorithm is typically iterated to produce a sequence 𝐱n, n=1,2,..., to converge to a minimum, provided such a minimum exists and 𝐩n is selected appropriately in each step. For gradient descent, 𝐩n is selected as −∇f(𝐱n). The value of αj for the j that fulfills the Armijo–Goldstein condition depends on 𝐱 and 𝐩, and is thus denoted below by α(𝐱,𝐩). It also depends on f, α0, τ and c of course, although these dependencies can be left implicit if they are assumed to be fixed with respect to the optimization problem. The detailed steps are thus, see Armijo (1966), Bertsekas (2016):
Choose an initial starting point 𝐱0 and set the iteration counter n=0. Until some stopping condition is satisfied, choose a descent direction 𝐩n, update the position to 𝐱n+1=𝐱n+α(𝐱n,𝐩n)𝐩n, and increment n. Return 𝐱n as the minimizing position and f(𝐱n) as the function minimum. To assure good behavior, it is necessary that some conditions must be satisfied by 𝐩n. Roughly speaking 𝐩n should not be too far away from ∇f(𝐱n). A precise version is as follows (see e.g. Bertsekas (2016)). There are constants C1,C2>0 so that the following two conditions are satisfied:
For all n, ‖𝐩n‖≥C1‖∇f(𝐱n)‖. Here, ‖y‖ is the Euclidean norm of y. (This assures that if 𝐩n=0, then also ∇f(𝐱n)=0. More generally, if limn→∞𝐩n=0, then also limn→∞∇f(𝐱n)=0.) A more strict version requires also the reverse inequality: ‖𝐩n‖≤C3‖∇f(𝐱n)‖ for a positive constant C3>0. For all n, ‖𝐩n‖‖∇f(𝐱n)‖≤−C2⟨𝐩n,∇f(𝐱n)⟩. (This condition ensures that the directions of 𝐩n and −∇f(𝐱n) are similar.)
Lower bound for learning rates This addresses the question whether there is a systematic way to find a positive number β(𝐱,𝐩) - depending on the function f, the point 𝐱 and the descent direction 𝐩 - so that all learning rates α≤β(𝐱,𝐩) satisfy Armijo's condition. When 𝐩=−∇f(𝐱), we can choose β(𝐱,𝐩) in the order of 1/L(𝐱), where L(𝐱) is a local Lipschitz constant for the gradient ∇f near the point 𝐱 (see Lipschitz continuity). If the function is C2, then L(𝐱) is close to the Hessian of the function at the point 𝐱. See Armijo (1966) for more detail.
… excerpt ends here. Continue reading the full article.