ArticleslgStudy

mathematics

Backtracking line search

Backtracking line search is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Backtracking line search rather than just read about it. In short: 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.

Key takeaways

  • Backtracking line search belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Backtracking line search to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Backtracking line search from memory before moving on to harder problems.

Reference excerpt

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.

Worked examples

Example 1 — a first encounter with Backtracking line search

Start with the simplest possible case. Write down what Backtracking line search claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Backtracking line search before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Backtracking line search ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Backtracking line search

In research
Backtracking line search appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Backtracking line search in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Backtracking line search is common in secondary-school and first-year university syllabi. It links to neighbouring topics Mathematical optimization, Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Backtracking line search outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Backtracking line search” →

How to study Backtracking line search in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Backtracking line search means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Backtracking line search out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Backtracking line search in simple terms?

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.

Why does Backtracking line search matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Backtracking line search?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Backtracking line search.

Tags

  • Mathematical optimization
  • Optimization algorithms and methods

Keep exploring