Notes Eth
Notes Eth
Lecture Notes, FS 23
1 Introduction 2–40
1
Chapter 1
Introduction
Contents
1.1 About this lecture . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Algorithms in Data Science . . . . . . . . . . . . . . . . . . . 6
1.2.1 Case Study: Learning the minimum spanning tree . . 7
1.3 Expected risk minimization . . . . . . . . . . . . . . . . . . . 8
1.3.1 Running example: Learning a halfplane . . . . . . . . 10
1.4 Empirical risk minimization . . . . . . . . . . . . . . . . . . . 11
1.5 Empirical versus expected risk . . . . . . . . . . . . . . . . . 13
1.5.1 A counterexample . . . . . . . . . . . . . . . . . . . . 15
1.6 The map of learning . . . . . . . . . . . . . . . . . . . . . . . 16
1.6.1 What are the guarantees? . . . . . . . . . . . . . . . . 20
1.7 Vapnik-Chervonenkis theory . . . . . . . . . . . . . . . . . . 22
1.7.1 The growth function . . . . . . . . . . . . . . . . . . . 22
1.7.2 The result . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.8 Distribution-dependent guarantees . . . . . . . . . . . . . . . 26
1.9 Worst-case versus average-case complexity . . . . . . . . . . 28
1.10 The story of the simplex method . . . . . . . . . . . . . . . . 30
1.10.1 Initial wandering . . . . . . . . . . . . . . . . . . . . . 30
1.10.2 Worst-case complexity . . . . . . . . . . . . . . . . . . 31
1.10.3 Average-case complexity . . . . . . . . . . . . . . . . 32
1.10.4 Smoothed complexity . . . . . . . . . . . . . . . . . . 33
1.10.5 An open end . . . . . . . . . . . . . . . . . . . . . . . . 36
1.11 The estimation-optimization tradeoff . . . . . . . . . . . . . . 36
2
1.12 Further listening . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.13 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3
1.1 About this lecture
These are lecture notes for the ETH course 261-5110-00L Optimization for
Data Science. This course has partially been co-developed with the EPFL
course CS-439 Optimization for machine learnbiaseding; the two courses
share some of their content but also differ in some material.
This course provides an in-depth theoretical treatment of classical and
modern optimization methods that are relevant in data science. The em-
phasis is on the motivations and design principles behind the algorithms,
on provable performance bounds, and on the mathematical tools and tech-
niques to prove them. The goal is to equip students with a fundamental
understanding about why optimization algorithms work, and what their
limits are. This understanding will be of help in selecting suitable algo-
rithms in a given application, but providing concrete practical guidance is
not our focus.
In this first chapter, we discuss the role of optimization for Data Sci-
ence. This turns out to be quite different from the classical role where an
optimization algorithm (for example Kruskal’s) solves a well-defined op-
timization problem (find the minimum spanning tree). In Data Science,
we have learning problems, and they are not always well-defined. Opti-
mization typically happens on training data, but even a perfect result may
fail to solve the underlying learning problem. This is not a failure of the
optimization algorithm but of the model in which it was applied. In Data
Science, optimization is merely one ingredient in solving a learning prob-
lem. While this course focuses on optimization, it does not turn you into
a holistic data scientist. But it will allow you to better understand and ex-
plore the (after all not so small) optimization corner in the Data Science
landscape.
In his arcticle 50 years of Data Science, David Donoho outlines the six
divisions of what he calls Greater Data Science [Don17]:
1. Data Gathering, Preparation, and Exploration
2. Data Representation and Transformation
3. Computing with Data
4. Data Modeling
5. Data Visualization and Presentation
4
6. Science about Data Science
Even Computing with Data (which some may think that Data Science
is mainly about) is only one of six divisions, and optimization is a sub-
division of that. But optimization is important also in Data Modeling:
towards being able to actually optimize a given model, the model designer
must already be aware of the computational methods that are available,
what they can in principle achieve, and how efficiently they can do this.
The classical worst-case complexity of an optimization algorithm is rarely
the right measure of applicability in practice. In Data Modeling, one also
needs to make sure that the result of the optimization is meaningful for
the learning problem at hand.
To summarize the state of affairs at this point: optimization is an en-
abling technology in Data Science, but it’s not what Data Science is about.
Optimization algorithms should not be used blindly, by confusing the op-
timization problem being solved with the ground truth. The optimization
problem helps to solve a learning problem, and the latter is the ground
truth. The same learning problem can in principle be modeled with many
different optimization problems. What counts in the end is whether the
result of the optimization is useful towards learning.
In the remainder of this chapter, we elaborate on this high-level sum-
mary. We start by framing the minimum spanning tree problem as a learn-
ing problem and present some surprising implications that this has for
the classical minimum spanning tree algorithms. Then we introduce the
predominant application of optimization in Data Science, namely empiri-
cal risk minimization as a way to learn from training data. We concisely
explain overfitting, underfitting, generalization, regularization and early
stopping. We then present two classical theorems as showcases for distribution-
independent and distribution-dependent techniques to guarantee that em-
prirical risk minimization entails learning. Finally, we talk about the role
of computational complexity in Data Science, by discussing the evolu-
tion from classical worst-case complexity over average-case complexity to
smoothed complexity. The simplex method for linear programming serves
as a prime example to document this evolution.
5
1.2 Algorithms in Data Science
The classical picture of an algorithm, as portrayed in many textbooks, is
that of a computational procedure that transforms input into output. Here
is an example of how Cormen, Leiserson, Rivest, and Stein describe such
a transformation in their Introduction to Algorithms [CLRS09, Section 23.1]:
Assume that we have a connected, undirected graph G =
(V, E) with a weight function w : E → R and wish to find a
minimum spanning tree for G.
Then they present two algorithms for solving this problem, Kruskal’s
algorithm, and Prim’s algorithm. Kruskal’s algorithm maintains a forest (ini-
tially empty), and in each step adds an edge of minimum weight that con-
nects two trees in the forest. Prim’s algorithm maintains a tree (initially
consisting of an arbitrary vertex), and in each step adds an edge of mini-
mum weight that connects the tree to its complement.
Both algorithms are analyzed in terms of their worst case performance.
Kruskal’s algorithm with a suitable union-find data structure needs time
O (|E| log |E|). Prim’s algorithm takes time O (|E| log |V |) which can be im-
proved to O (|E| + |V | log |V |) using Fibonacci Heaps. So Prim’s algorithm
is faster for dense graphs. Case closed.
In Data Science, the viewpoint is very different. Here, the starting point
are data which we want to explain in some (not always prespecified) way.
An algorithm is a tool to help us in finding such an explanation. The data
typically come from measurements or experiments, and there is not a sin-
gle input, but a typically unknown input distribution from which a mea-
surement or an experiment draws a (noisy) sample. In such a situation,
we are not interested in explaining a concrete sample, but we want to ex-
plain the nature of the distribution. And this changes the way in which
we should evaluate an algorithm.
The prevalent quality measure is how good an explanation is in expec-
tation (over the input distribution). If we don’t know the distribution, we
are stuck with the empirical approach: sample a finite number of inputs
(these are the training data), and based on them, construct an explanation
for the whole input distribution. An algorithm is evaluated according to
how good this explanation is. Classical criteria such as runtime or space
are considered only to ensure that we can actually run the algorithm effi-
ciently on possibly huge data.
6
We can summarize the situation as follows: in Data Science, an algo-
rithm solves a learning problem (finding an explanation for data), not a clas-
sical computational problem in which every input must be mapped to a
specified output.
7
It can be shown experimentally that this early stopping works quite well
(compared to standard attempts to learn the ground truth minimum span-
ning tree from two samples). More interestingly, it now matters which al-
gorithm is chosen, not because of runtime as in the classical setting, but
because of explanation quality. As Gronskiy shows, Kruskal’s algorithm
with early stopping leads in expectation to a much better explanation than
Prim’s algorithm with early stopping.
In fact, Gronskiy shows that a third algorithm (not discussed by Cor-
men, Leiserson, Rivest and Stein at all, due to its abysmal worst-case com-
plexity) is even better than Kruskal’s algorithm. This is the Reverse Delete
algorithm. It starts with the full graph, and in every step it deletes the
edge of maximum weight that does not disconnect the graph.
The takeway message at this point is that classical algorithms and Data
Science algorithms have quite different design goals, and this in particular
holds in optimization. In the following sections, we will elaborate on this
in some more detail, with a focus on optimization.
8
(unknown) probability p? for X ∼ X . The desired explanation of X is the
bias p? . By the law of large numbers, we have p? = limn→∞ |{i : Xi = 1}|/n,
but we will not be able to compute this limit via finitely many samples.
When sampling X1 , X2 , . . . , Xn ∼ X , we can only hope to approximate p? .
Concretely, the Chernoff bound tells us how large n needs to be in order
for the empirical estimate |{i : Xi = 1}|/n to yield a good approximation
of p? with high probability.
In our abstract framework, we have a class H of hypotheses that we
can think of as possible explanations of X , and our goal is to select the
hypothesis that best explains X . To quantify this, we use a risk or loss
function ` : H × X → R that says by how much we believe that a given
hypothesis H ∈ H fails to explain given data X ∈ X . Then we consider
the expected risk
`(H) := EX [`(H, X)] (1.1)
as the measure of quality of H for the whole data source (other quality
measures are conceivable, but expected risk is the standard one). Formally,
our goal is therefore to find a hypothesis with smallest expected risk, i.e.
assuming that such an optimal hypothesis exists. To put the biased coin
example into this framework, we choose hypothesis class H = [0, 1] (the
candidates for the bias p? ) and loss function `(H, X) = (X − H)2 . In Ex-
ercise 1, you will analyze this case and in particular prove that a unique
optimal hypothesis H ? as in (1.2) exists and equals p? , the bias of the coin.
So mathematically, we may be able to argue about expected risk.
But computationally, we are typically at a loss (no pun intended). Not
knowing the probability distribution over X , we cannot compute the ex-
pected risk `(H) of a hypothesis H as in (1.1), let alone find H ? as in (1.2).
Having access to X only through finitely many samples, we generally can-
not expect to perfectly explain X .
Alternatively, and more realistically, we can try to be probably approxi-
mately correct (PAC). This means the following: given any tolerances δ, ε >
0, we can produce with probability at least 1 − δ a hypothesis H̃ ∈ H such
that
`(H̃) ≤ inf `(H) + ε. (1.3)
H∈H
9
This means that with high probability, we approximately solve the opti-
mization problem (1.2). Here, the probability is over the joint probability
distribution of the individual samples. So formally H̃ is a (hypothesis-
valued) random variable. If the algorithm producing H̃ is randomized,
the random variable additionally depends on the random choices made
by the algorithm.
10
is formally defined as
`(H) = prob(H ⊕ H ? ),
H̃
H?
11
of hypothesis H. Note that `n (H) is a random variable. In probability, the
sequence (`n (H))n∈N converges to `(H). We know this from rolling a dice
n times: as n → ∞, the average number of pips converges to its expected
value 3.5.
Formally, convergence in probability means the following.
This may still be a hard problem, but at least, we have all the data that we
need in order to solve it. This suggests an algorithmic view of empirical
risk minimization as a mapping from input to output.
12
Highschool calculus shows that this is (exactly and unsurprisingly) mini-
mized by
n
1X
H̃n = Xi ,
n i=1
the relative frequency of heads in a sequence of n biased coin flips.
In our running example from Section 1.3.1, X1 , X2 , . . . , Xn are points
in R2 , labeled with either 1 or 0, signifying whether the point is in the
unknown halfplane or not. For n = 9, we may therefore see a picture as in
Figure 1.3 (left).
H̃9
H? H?
Figure 1.3: Left: training data (filled circles are the ones in the un-
known halfplane H ? ); Right: a halfplane H̃9 with minimum empirical risk
`9 (H̃9 ) = 0.
13
satisfies (1.3):
`(H̃n ) ≤ inf `(H) + ε
H∈H
Now the Chernoff bound ensures that for n sufficiently large, the expected
risk of H̃n is a good approximation of the minimum expected risk, with
high probability.
In general, the law of large numbers (1.6) seems to ensure that we are
living in an ideal world, just with adapted tolerances. Indeed, let H̃ be
some approximately optimal hypothesis w.r.t. expected risk, meaning that
`(H̃) ≤ inf H∈H `(H) + ε. Then we get
(1.6)
`(H̃n ) ≤ `n (H̃n ) + ε
(1.7)
≤ inf `n (H) + 2ε ≤ `n (H̃) + 2ε
H∈H
(1.6)
≤ `(H̃) + 3ε ≤ inf `(H) + 4ε. (1.8)
H∈H
Here, the inequalites using (1.6) hold with probability at least 1 − δ each,
while the other ones are certain, so the whole chain of inequalities holds
with probability at least 1 − 2δ.
If you think that this derivation was complete nonsense, you are
right.
But where exactly is the problem? It’s in the first inequality, all the
other ones are correct.
The problem is that we cannot apply the law of large numbers to a data-
dependent hypothesis H̃n . In (1.6), we need to fix a hypothesis and can then
argue that its empirical risk converges in probability to its expected risk.
This is what we do with H̃ in the second inequality using (1.6).
But in the first inequality, H̃n depends on the data and was deliberately
chosen such that the empirical risk is mimimized for the given data. As
14
we show in Section 1.5.1 below, this may lead to the empiricial risk being
much smaller than the expected risk, so that the crucial first inequality
does not hold.
Before doing so, let us establish a sufficient condition (a uniform version
of the law of large numbers) under which the above derivation is sound.
It does not hold in general, but if it holds, we are indeed in an ideal world:
minimizing the empirical risk also minimizes the expected risk.
Theorem 1.2. Suppose that for any δ, > 0, there exists n0 ∈ N such that for
n ≥ n0 ,
sup |`n (H) − `(H)| ≤ ε (1.9)
H∈H
1.5.1 A counterexample
We provide a simple (artificial) example to show that the inequality `(H̃n ) ≤
`n (H̃n ) + ε in our false derivation (1.8) can in general not be achieved. As
a consequence, the uniform law of large numbers (1.9) also fails in this
example.
15
Let X = [0, 1], equipped with the uniform distribution. The set of hy-
potheses H consists of certain subsets of X , and for H ∈ H, X ∈ X , we let
`(H, X) = I({X ∈/ H}).
Concretely, we choose H such that it satisfies two properties:
(i) every H ∈ H has length (Lebesgue measure) 1/2, so that `(H) = 1/2
for all H ∈ H;
16
`
Hn
`n
Empirical risk minimization. The gray area above the main diagonal
(and slightly extending below) in Figure 1.4 is where the empirical risk
minimizer H̃n ends up. In words, the empirical risk `n (H̃n ) always under-
estimates the expected risk `(H̃n ), up to an error that we can make arbi-
trarily small. We have implicitly shown this before, through the correct
17
`
tio k
iza ris
it on
n
im al
a
in ic
z
high m pir
r ali
em
e
en
g
validation
overfitting underfitting
ing
reg stopp
ula early
riz
atio
n
io n
at
low
a liz
ner
ge
learning bad model
low high
`n
algorithm
part of the chain of inequalities (1.8): we simply need to observe that the
last term in this chain can further be bounded by `(H̃n ) + 3ε.
18
find this entertaining, but you don’t seriously expect such explanations to
last for more games.
Learning. If both empirical and expected risk are low, we can make a
case that we have learned something. We have invested some effort into
explaining the training data, and this explanation is also good for unseen
data (maybe not spectacularly so, but sufficient to gain some insights). If
you are able to predict the future outcomes of your favorite team’s matches
more reliably than a biased coin based on the current ranking, say, this is
already an achievement.
19
of “punishing” complex hypotheses. Typically, r has a unique minimizer
and nothing to do with the learning problem at hand.
Empirically minimizing `0 = ` + λr for a real number λ > 0 therefore
has the effect that we introdue a bias, meaning that we deviate more and
more from our theory, with the effect that the empirical risk increases. But
as the intended consequence, the variance (sensitivity to the training data)
decreases, and this may reduce the expected risk. For large λ, the new loss
function `0 is dominated by r, so the empirical risk minimizer eventually
becomes uninformative and ends up in the underfitting region. The art
is to optimize this bias-variance tradeoff : find the sweet spot λ? that mini-
mizes the expected risk. The curve in Figure 1.4 symbolically depicts the
development of the expected risk as we increase λ to move away from the
original overfitting hypothesis. This also visualizes the bias-variance trade-
off saying that in order to get smaller variance (less dependence on the
training data), we need to introduce a higher bias (a worse loss function).
20
already touched upon in discussing regularization.
On the one hand, the theory should be informative, meaning that the
way in which hypotheses are chosen and evaluated as good or bad is
meaningful in the application at hand. For example, the constant loss
function ` ≡ 0 ensures perfect generalization and learning according to
the map in Figure 1.4 but is obviously useless. On the other hand, the the-
ory should be robust, meaning that empirical risk minimization is a good
way of learning about the expected risk.
Finally, we should also be able to perform empirical risk minimization
efficiently. This computational aspect favors convex loss functions (see
Chapter 2), although these might not be the most informative ones in the
given application.
In this course, we do not cover the art of choosing the “right” theory. In
subsequent chapters, we focus on how to efficiently solve the optimization
problems that arise after this artwork has been done.
That said, there is a large body of results supporting this artwork. Over
the last fifty years, and starting long before machine learning has become
mainstream, the field of statistical learning theory has paved the way to-
wards understanding why machine learning works.
In the next section, we sketch a historical cornerstone that started what
is now known as the VC (Vapnik-Chervonenkis) theory. Originally devel-
oped in the Soviet Union in the late 1960s, it became known to the rest
of the world through English translations of the original Russian articles
from 1968 and the later one from 1971, which can be considered as the
“full paper” containing all proofs [VC71].
The paper establishes a notion of complexity of the hypothesis class H
that is directly and provably related to the success of empirical risk mini-
mization under 0-1-loss. The beauty of this result is that it does not depend
on the probability distribution over the data source X . The restriction is
that it only works for the 0-1-loss (in supervised learning) which—being
nonconvex—is computationally intractable. But the main insight is con-
ceptual: there is a well-defined mathematical way of quantifying our pre-
viously informal understanding of a (too) complex theory.
21
1.7 Vapnik-Chervonenkis theory
Here we are in the (abstract) setting of supervised learning with two classes,
generalizing our running example from Section 1.3.1. In this setting, the
data source X is of the form X = D × {0, 1}, with an unknown probability
distribution over data D, and with samples of the form X = (x, y) where
x ∈ D and y = I({x ∈ H ? }) for an unknown subset H ? ⊆ D. The goal is to
learn H ? .
The hypothesis class H consists of candidate subsets H ⊆ D and in
particular contains H ? . For H ∈ H and X = (x, y) ∈ X , the 0-1-loss is
H ∩ {x1 , x2 , . . . , xn }
H ∩ {x1 , x2 , . . . , xn } = {H ∩ {x1 , x2 , . . . , xn } : H ∈ H}
22
of notation) is the growth function of H. We have already observed that
H(n) ≤ 2n . But this may be a (gross) overestimate.
In order to understand the function H(n) for halfplanes, let us look at
small cases first. We first note that H(3) = 8. Indeed, taking as training
samples the three corners of a triangle, we can cut out all subsets by half-
planes; see Figure 1.5.
Figure 1.5: Halfplanes can cut a 3-point set in all possible ways.
Next, we claim that H(4) = 14, so it is not possible for halfplanes to cut
out all 16 subsets of a 4-point set. A simple argument (omitted) shows that
|H ∩ {x1 , x2 , x3 , x4 }| is maximized when the 4 points are in general position
(no three on a line). Then there are only two types of configurations, and
in each of them, exactly two subsets cannot be cut out by a halfplane; see
Figure 1.6.
Figure 1.6: Left: Four points in convex position. Right: One point in the
convex hull of the others. In both cases, the set of black points (and its
complement) cannot be cut out by a halfplane.
23
Here is the bound for general n showing that the truth is very far away
from the worst-case bound of 2n .
H(n) = O n2 .
Example 1.4. Let H be the collection of all subsets of [0, 1] of length 1/2, n ∈ N.
Then
H(n) = 2n .
Proof. Let S be a set of distinct samples from [0, 1]. For every T ⊆ S, we
construct H ∈ H such that H ∩ S = T . For this, we let U be a set of length
1/2 disjoint from S and set H = T ∪ U .
Exercise 4 asks you to prove that there is also a countable collection H
of subsets of [0, 1] with H(n) = 2n for all n. No finite collection can have
this property, since H(n) ≤ |H|. Indeed, to induce H(n) different cuts, we
need at least H(n) different hypotheses.
24
This follows from Theorem 2 of Vapnik and Chervonenkis [VC71] that
we state below. This theorem handles the case H ? = ∅. Exercise 5 asks you
to derive the general case.
Assuming that H ? = ∅, the 0-1 loss (1.12) simplifies to
25
be the 0-1-loss, telling us whether H misclassifies X. Let
26
We have fixed ground truth vectors x1 , x2 , . . . , xn ∈ Rd , n ≥ d (this is
the design). We assume that the xi span Rd . The data source is Y = Rn
and comes with an unknown vector β ? ∈ Rd . A sample y ∈ Y has entries
y i = x> ?
i β + wi , where the wi are independent noise terms with expectation
0 and variance σ 2 each.
This means, there is a ground truth linear function xi 7→ x> ?
i β that we
would like to learn, but the function values yi that we get are corrupted
with centered noise.
The goal is to learn β ? , using just one sample y ∈ Y (which already
provides n values). As hypothesis class, we therefore use H = Rd .
If σ 2 = 0 meaning that there is no noise, we can simply compute β ?
from the design by solving the following system of equations in d un-
knonws β1 , . . . , βd .
y1 x>1 β1
y 2 x> β2
2
.. = .. .. .
. . .
yn x>n βd
telling us by how much (in squared Euclidean norm) β fails to explain the
observed values y. The expected risk is
n
1X > ?
`(β) = (x (β − β))2 + σ 2 . (1.14)
n i=1 i
EY [(yi − x> 2
> ? > 2
i β) ] = E Y (x i β + w i − x i β)
= EY (x> ? 2
2wi x> ? 2
i (β − β)) + i (β − β) + wi
= (x> ? 2 2
i (β − β)) + σ ,
27
This means that an expected risk of σ 2 is unavoidable but can also be at-
tained by choosing β = β ? . The following result quantifies how good em-
pirical risk minimization performs in this scenario. A proof can be found
in the lecture notes of Rigollet and Hütter on High Dimensional Statistics.1
Theorem 1.7. Given a sample y ∈ Rn , let β̃ = β̃1 minimize the empirical risk
n
1X
`1 (β) = (yi − x> 2
i β) .
n i=1
28
The classical measure of algorithm performance is its worst-case com-
plexity, the function that maps n to the maximum runtime of the algorithm
over all possible inputs of size n. For example, the worst case complex-
ity of (deterministic) Quicksort for sorting n numbers is Θ(n2 ). But if the
input numbers are independent samples from the same distribution, they
come in random order; therefore, the average-case complexity of Quicksort is
much better, namely O (n log n). The average case complexity is the func-
tion that maps n to the expected runtime of the algorithm, taken over its
input distribution.
Still, many sources that describe and analyze (optimization) algorithms
in Data Science do this in terms of worst-case complexity. These lecture
notes are not an exception. The main reason is that it’s in most cases very
difficult to understand the average-case complexity. There are two prob-
lems.
29
have hardly more than an ad-hoc result for one particular application.
Worst-case complexity may be pessimistic in any given concrete ap-
plication, but it does provide a valid upper bound for the runtime in all
applications, via one proof. This makes worst-case complexity an attrative
complexity measure from a theoretical point of view. Having said this,
one should always be aware that the resulting bounds may be pessimistic
(sometimes to the point of being useless), and that even as a theoretician,
one should strive for better results that ideally cover a number of relevant
applications.
30
However, empirical evidence with thousands of practical
problems indicates that the number of iterations is usually close
to the number of basic variables in the final set which were not
present in the initial set.
31
Despite these limitations, their results creates quite some excitement in
the community; a sequence of papers ensues in which many other pivot
rules are shown to require an exponential number of iterations as well.
While each of these papers exhibits a different construction, they all seem
to follow a similar approach; Manfred Padberg calls this the period of
worstcasitis [Pad95]. Only later, Nina Amenta and Günter Ziegler will
show that the “similar approach” intuition can be formalized, and that
all known constructions are in fact special cases of a general deformed prod-
uct construction [AZ99]. One particular pivot rule, developed by Norman
Zadeh in 1980 with the goal of defeating all “similar approaches”, will
eventually be shown to also require exponentially many iterations; but this
will happen only in 2011, via an indeed quite different approach. While
this involves money and nudity, it is for the purpose of our discussion a
side story, so we refer the interested reader to Günter Ziegler’s blog entry.2
32
iterations of the simplex method with the shadow-vertex pivot rule is poly-
nomial in expectation over the distribution. The analysis is very technical
and involved; on a high level, it boils down to proving that the shadow
(projection onto a two-dimensional plane) of a random linear program
has in expectation only a small number of vertices. As these are exactly
the ones that the shadow-vertex pivot rule visits, polynomial runtime on
average follows.
Borgwardt’s distribution may be what Dantzig had in mind when he
was talking about “randomly chosen” linear programs. On the other hand,
linear programs observed in practice are typically not random but highly
structured. If they follow any distribution at all, it is certainly not the
one assumed by Borgwardt. Therefore, Borgwardt’s average-case analysis
does not offer a full explanation for the efficiency of the simplex method
in practice. But it is still an important step forward as it shows that there
is a natural (although practically not very relevant) distribution over lin-
ear programs on which the simplex method is fast on average. In Section
0.9, Borgwardt also speculates what the right “real-world”-model is and
writes the following:
33
. . . However, average-case analysis may be unconvincing as
the inputs encountered in many application domains may bear
little resemblance to the random inputs that dominate the anal-
ysis. . . .
. . . In smoothed analysis, we measure the performance of
an algorithm under slight random perturbations of arbitrary
inputs.
Following Spielman and Teng [ST04], we define the three complexity
measures formally. Let CA (X) be the runtime of algorithm A on input
X ∼ X . Here X is again some data source. If A is randomized, we consider
the expected runtime. We let Xn denote the set of all inputs of encoding
size n. A has worst-case complexity f (n) if
max CA (X) = f (n).
X∼Xn
34
Some explanations are in order here. We assume that the data are such
that we can inject arbitrarily small noise. In discrete settings (for example
X = {0, 1}n to model n coin flips), this is not the case. Concretely, we as-
sume that the input X can be written as a vector of real numbers, and for
all indices i, we add independent centered Gaussian noise wi to the i-th
entry of this vector. The standard deviation of each noise term is propor-
tional to the size kXk of the input which may for example be measured by
Euclidean norm. The factor of proportionality is σ. It is important to un-
derstand that the smoothed complexity is independent of the probability
distribution over X .
If σ = 0, we simply have the worst-case complexity. If σ is large, the
noise dominates, and the smoothed complexity becomes meaningless for
the application. So the scenario that we are interested in is that of small
nonzero σ.
The smoothed complexity is called polynomial if f (n, σ) is polynomial
in n and 1/σ. This allows the runtime to tend to infinity as σ → 0, but at
a rate that is polynomial in 1/σ. Smoothed complexity is a very natural
complexity measure in Data Science where data come from measurements
or experiments and are therefore per se noisy. In this case, the measure-
ment or experiment can itself be considered as injecting the random noise
into (unknown) ground truth data. Smoothed complexity then covers the
worst possible ground truth data.
The main technical achievement of Spielman and Teng (earning them
a number of prestigious prizes) is to show that the smoothed complexity
of the shadow vertex simplex algorithm is polynomial, while its worst-
case complexity is known to be exponential. Intuitively, this means that
the worst-case linear programs are rare and isolated points in the input
space: by slightly perturbing them, we arrive at linear programs that the
algorithm can solve in polynomial time. Indeed, the deformed products
that serve as worst-case inputs for the shadow vertex and other pivot rules
are very sensitive to noise; their geometric features are highly structured in
tiny regions of space, with the consequence that this structure completely
falls apart under small perturbations.
Smoothed analysis does not help for problems where the worst-case in-
puts have some volume. Let’s say that somewhere in input space, there is
a ball of fixed radius only containing (near) worst-case inputs. In this case,
injecting small random noise does not speed up the algorithm. Also, the
smoothed complexity of an algorithm is usually hard to determine, and
35
even for discrete algorithms such as the simplex method, smoothed anal-
ysis is integral-heavy due to the Gaussian noise terms. When applicable
and technically feasible, smoothed analysis is an excellent tool to analyze
Data Science algorithms, but this is by far not always the case. The 2009
survey of Spielman and Teng contains a few examples where smoothed
analysis works [ST09].
36
In a given application, we may have constraints on how many train-
ing data we can afford to sample, and on how much time we can afford
to spend on optimization. Constraints on the number of training samples
typically come from the fact that samples are expensive to obtain. Indeed,
a training sample may come from an actual physical measurement or an
experiment that has a significant cost; or it requires human intervention
to label a training sample with its correct class. Reducing the cost of hu-
man intervention is all that services such as Amazon Mechanical Turk are
about. We call this scenario small-scale learning.
Constraints on optimization time typically come from large training
data. The “good old days” where every algorithm of polynomial runtime
was considered efficient are long gone in Data Science. With large data,
we typically need linear-time or even sublinear-time algorithms in order to
cope with the data. This is the scenario of large-scale learning.
In small-scale learning, it doesn’t hurt to go for as small an optimiza-
tion error as we can. But in large-scale learning, we may need to give up
on some optimization precision in order to be able to stay within the opti-
mization time budget.
The estimation-optimization tradeoff consists in finding the most efficient
way of spending the resources under the given constraints. The optimiza-
tion algorithms that we will analyze in this course support this tradeoff.
They are usually stepwise methods, gradually improving a candidate so-
lution. The runtime guarantees that we provide are of the form “on data of
this and that type, this and that algorithm is guaranteed to have optimiza-
tion error at most ε after at most c(ε) many steps.” Here, c is a function that
grows as ε → 0, and c is typically not even defined at ε = 0. Hence, most
of our algorithms cannot even be used to “optimize to the end.” Bus as
this is not needed, our main concern is to bound the growth of c as ε → 0,
and algorithms can signficantly differ in this growth. For example, an al-
gorithm with c(ε) = O(log(1/ε)) is preferable over one with c(ε) = O(1/ε),
and the latter is better than an algorithm with c(ε) = O(1/ε2 ).
Following up on Section 1.9, we point out that our bounds on c(ε) will
usually be worst-case bounds, and as such, they may be overly pessimistic
in a concrete application even if they are tight on contrived input. But
given the difficulty of obtaining average-case bounds in more then very
specific applications, the worst-case bounds still provide some (and some-
times the only) useful guidance concerning optimization time.
The material of this section is based on (and discussed in much more
37
detail by) Bottou and Bousquet[BB07]; we refer the interested reader to
this paper.
1.13 Exercises
Exercise 1. Let X = {0, 1} be such that the event X = 1 has probability p? for
X ∼ X . We want to model the task of finding p? as an expected risk minimization
problem.
For X ∈ X and H ∈ H = [0, 1], we define `(H, X) = (X − H)2 . The
expected risk of H is `(H) = EX [`(H, X)].
(ii) Prove that p? is the unique minimizer of the expected risk `, and that the
minimum expexted risk is p? (1 − p? ), the variance of the biased coin.
38
Exercise 2. Prove that there exists a countable collection H of subsets H ⊆ [0, 1]
such that (i) every H ∈ H has length 1/2; (ii) for every finite set S ⊆ [0, 1], there
is H ∈ H with H ∩ S = ∅.
Exercise 3. Let H be the set of all halfplanes in R2 , and let S be a set of n ≥ 1
points in R2 . Prove that H cuts S in at most 2 n2 + 2 many different ways, and
that there are sets S for which this bound is attained. More precisely, prove that
n
the set H ∩ S = {H ∩ S : H ∈ H} has size at most 2 2 + 2, with equality if
and only if S is in general position, meaning that no three points of S are on a
common line.
39
Chapter 2
Contents
2.1 Mathematical Background . . . . . . . . . . . . . . . . . . . . 42
2.1.1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.1.2 The Cauchy-Schwarz inequality . . . . . . . . . . . . 42
2.1.3 The spectral norm . . . . . . . . . . . . . . . . . . . . 44
2.1.4 The mean value theorem . . . . . . . . . . . . . . . . . 45
2.1.5 The fundamental theorem of calculus . . . . . . . . . 45
2.1.6 Differentiability . . . . . . . . . . . . . . . . . . . . . . 46
2.2 Convex sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.2.1 The mean value inequality . . . . . . . . . . . . . . . 48
2.3 Convex functions . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.3.1 First-order characterization of convexity . . . . . . . 54
2.3.2 Second-order characterization of convexity . . . . . . 57
2.3.3 Operations that preserve convexity . . . . . . . . . . 59
2.4 Minimizing convex functions . . . . . . . . . . . . . . . . . . 59
2.4.1 Strictly convex functions . . . . . . . . . . . . . . . . . 61
2.4.2 Example: Least squares . . . . . . . . . . . . . . . . . 62
2.4.3 Constrained Minimization . . . . . . . . . . . . . . . . 63
2.5 Existence of a minimizer . . . . . . . . . . . . . . . . . . . . . 64
2.5.1 Sublevel sets and the Weierstrass Theorem . . . . . . 65
2.5.2 Recession cone and lineality space . . . . . . . . . . . 66
2.5.3 Coercive convex functions . . . . . . . . . . . . . . . . 70
2.5.4 Weakly coercive convex functions . . . . . . . . . . . 71
40
2.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
2.6.1 Handwritten digit recognition . . . . . . . . . . . . . 72
2.6.2 Master’s Admission . . . . . . . . . . . . . . . . . . . 74
2.7 Convex programming . . . . . . . . . . . . . . . . . . . . . . 80
2.7.1 Lagrange duality . . . . . . . . . . . . . . . . . . . . . 80
2.7.2 Karush-Kuhn-Tucker conditions . . . . . . . . . . . . 84
2.7.3 Computational complexity . . . . . . . . . . . . . . . 86
2.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
41
This chapter develops the basic theory of convex functions that we will
need later. Much of the material is also covered in other courses, so we will
refer to the literature for standard material and focus more on material that
we feel is less standard (but important in our context).
We also use
N = {1, 2, . . .} and R+ := {x ∈ R : x ≥ 0}
to denote the natural and non-negative real numbers, respectively. We are
freely using basic notions and material from linear algebra and analysis,
such as open and closed sets, vector spaces, matrices, continuity, conver-
gence, limits, triangle inequality, among others.
42
and this fraction can be used to define the angle α between u and v:
u> v
cos(α) = ,
kuk kvk
where α ∈ [0, π]. The following shows the situation for two unit vectors
(kuk = kvk = 1): The scalar product u> v is the length of the projection of
v onto u (which is considered to be negative when α > π/2). This is just
the highschool definition of the cosine.
v
1 v 1
α α
u u
u> v > 0 u> v < 0
v=u v = −u α=π
u> v = 1 u>v = −1
Fix u 6= 0. We see that the vector v maximizing the scalar product u> v
among all vectors v of some fixed length is a positive multiple of u, while
the scalar product is minimized by a negative multiple of u.
Proof of the Cauchy-Schwarz inequality. There are many proof, but the
authors particularly like this one: define the quadratic function
d d
! d
! d
!
X X X X
f (x) = (ui x+vi )2 = u2i x2 + 2 ui vi x+ vi2 =: ax2 +bx+c.
i=1 i=1 i=1 i=1
43
We know that f (x) = ax2 + bx + c = 0 has the two solutions
√
−b ± b2 − 4ac
x1,2 = .
2a
This is known as the Mitternachtsformel in German-speaking countries, as
you are supposed to know it even when you are asleep at midnight.
As by definition, f (x) ≥ 0 for all x, f (x) = 0 has at most one real solu-
tion, and this is equivalent to having discriminant b2 − 4ac ≤ 0. Plugging
in the definitions of a, b, c, we get
d
!2 d
! d !
X X X
b2 −4ac = 2 ui vi −4 u2i vi2 = 4(u> v)2 −4 kuk2 kvk2 ≤ 0.
i=1 i=1 i=1
44
2.1.4 The mean value theorem
We also recall the mean value theorem that we will frequently need:
Theorem 2.3 (Mean value theorem). Let a < b be real numbers, and let h :
[a, b] → R be a continuous function that is differentiable on (a, b); we denote the
derivative by h0 . Then there exists c ∈ (a, b) such that
h(b) − h(a)
h0 (c) = .
b−a
Geometrically, this means the following: We can interpret the value
(h(b) − h(a))/(b − a) as the slope of the line through the two points (a, h(a))
and (b, h(b)). Then the mean value theorem says that between a and b, we
find a tangent to the graph of h that has the same slope:
h(a)
h(b)
a c b
45
2.1.6 Differentiability
For univariate functions f : dom(f ) → R with dom(f ) ⊆ R, differentia-
bility is covered in high school. We will need the concept for multivari-
ate and vector-valued functions f : dom(f ) → Rm with dom(f ) ⊆ Rd .
Mostly, we deal with the case m = 1: real-valued functions in d variables.
As we frequently need this material, we include a refresher here.
where
kr(v)k
lim = 0.
v→0 kvk
It then also follows that the matrix A is unique, and it is called the differential
or Jacobian of f at x. We will denote it by Df (x). More precisely, Df (x) is the
matrix of partial derivatives at the point x,
∂fi
Df (x)ij = (x).
∂xj
46
f (x) + ∇f (x)> (y − x)
f (y)
x y
Example 2.6. Consider the function f (x) = x2 . We know that its derivative is
f 0 (x) = 2x. But why? For fixed x and y = x + v, we compute
Here is an application of the chain rule that we will use frequently. Let
f : dom(f ) → Rm be a differentiable function with (open) convex domain,
and fix x, y ∈ dom(f ). There is an open interval I containing [0, 1] such
47
that x + t(y − x) ∈ dom(f ) for all t ∈ I. Define g : I → Rd by g(t) =
x + t(y − x) and set h = f ◦ g. Thus, h : I → Rm with h(t) = f (x + t(y − x)),
and for all t ∈ I, we have
then ∇f (x) = c; and if f (x) = kxk2 = dj=1 x2j , then ∇f (x) = 2x.
P
y
y x
x
48
To motivate it, let us consider the univariate and real-valued case first.
Let f : dom(f ) → R be differentiable and suppose that f has bounded
derivatives over an interval X ⊆ dom(f ), meaning that for some real
number B, we have |f 0 (x)| ≤ B for all x ∈ X. The mean value theorem
then gives the mean value inequality
kDf (x)k ≤ B, ∀x ∈ X.
Moreover, for every (not necessarily open) convex X ⊆ dom(f ), (ii) implies (i),
and this is the mean value inequality.
49
Proof. Suppose that f is B-Lipschitz over an open set X. For v ∈ Rd ,
v → 0, differentiability at x ∈ X yields for small v ∈ Rd that x + v ∈ X
and therefore
where kr(v)k / kvk → 0, the first inequality uses (i), and the last is the
reverse triangle inequality. Rearranging and dividing by kvk, we get
Let v? be a unit vector such that kDf (x)k = kDf (x)v? k / kv? k and let v =
tv? for t → 0. Then we further get
kr(v)k
kDf (x)k ≤ B + → B,
kvk
50
6 f (y), as otherwise, (i) trivially holds;
We assume w.l.o.g. that f (x) =
now we set
f (y) − f (x)
z=
kf (y) − f (x)k.
With this, the previous inequality reduces to (i), so f is indeed B-Lipschitz
over X.
51
λf (x) + (1 − λ)f (y) f (y)
x λx + (1 − λ)y y
so epi(f ) is a convex set. In the other direction, let epi(f ) be a convex set
and consider two points x, y ∈ dom(f ), λ ∈ [0, 1]. By convexity of epi(f ),
we have
epi(f ) 3 λ(x, f (x)) + (1 − λ)(y, f (y)) = (λx + (1 − λ)y, λf (x) + (1 − λ)f (y)),
m
! m
X X
f λi x i ≤ λi f (xi ).
i=1 i=1
52
epi(f ) epi(f )
graph of f
f (x)
f (x)
x x
Figure 2.4: Graph and epigraph of a non-convex function (left) and a con-
vex function (right)
Lemma 2.15. There exists an (infinite dimensional) vector space V and a linear
function f : V → R such that f is discontinuous at all v ∈ V .
Proof. This is a classical example. Let us consider the vector space V of all
univariate polynomials; the vector space operations are addition of two
polynomials, and multiplication of a polynomial with a scalar. We con-
sider a polynomial such as 3x5 + 2x2 + 1 as a function x 7→ 3x5 + 2x2 + 1
over the domain [−1, 1].
The standard norm in a function space such as V is the supremum norm
k · k∞ , defined for any bounded function h : [−1, 1] → R via khk∞ :=
supx∈[−1,1] |h(x)|. Polynomials are continuous and as such bounded over
[−1, 1].
We now consider the linear function f : V → R defined by f (p) = p0 (0),
the derivative of p at 0. The function f is linear, simply because the deriva-
tive is a linear operator. As dom(f ) is the whole space V , dom(f ) is open.
We claim that f is discontinuous at 0 (the zero polynomial). Since f is
linear, this implies discontinuity at every polynomial p ∈ V . To prove dis-
continuity at 0, we first observe that f (0) = 0 and then show that there are
polynomials p of arbitrarily small supremum norm with f (p) = 1. Indeed,
53
for n, k ∈ N, n > 0, consider the polynomial
k
(nx)2i+1 (nx)3 (nx)5 (nx)2k+1
1X 1
pn,k (x) = (−1)i = nx − + − ··· ±
n i=0 (2i + 1)! n 3! 5! (2k + 1)!
54
f (y)
f (x) + ∇f (x)> (y − x)
x y
55
For f (x1 , x2 ) = x21 + x22 , we have ∇f (x) = (2x1 , 2x2 ), hence (2.3) boils
down to
y12 + y22 ≥ x21 + x22 + 2x1 (y1 − x1 ) + 2x2 (y2 − x2 ),
which after some rearranging of terms is equivalent to
(y1 − x1 )2 + (y2 − x2 )2 ≥ 0,
hence true. There are relevant convex functions that are not differentiable,
see Figure 2.6 for an example. More generally, Exercise 14 asks you to
prove that the `1 -norm (or 1-norm) f (x) = kxk1 is convex.
f (x) = |x|
x 0
56
Multiplying this by −1 yields (2.4).
For the other direction, suppose that monotonicty of the gradient (2.4)
holds. Then we in particular have
(∇f (x + t(y − x)) − ∇f (x))> (t(y − x)) ≥ 0
for all x, y ∈ dom(f ) and t ∈ (0, 1). Dividing by t, this yields
(∇f (x + t(y − x)) − ∇f (x))> (y − x)) ≥ 0. (2.5)
Fix x, y ∈ dom(f ). For t ∈ [0, 1], let h(t) := f (x + t(y − x)). In our case
where f is real-valued, (2.1) yields h0 (t) = ∇f (x + t(y − x))> (y − x), t ∈
(0, 1). Hence, (2.5) can be rewritten as
h0 (t) ≥ ∇f (x)> (y − x), t ∈ (0, 1).
By the mean value theorem, there is c ∈ (0, 1) such that h0 (c) = h(1) − h(0).
Then
f (y) = h(1) = h(0) + h0 (c) = f (x) + h0 (c)
≥ f (x) + ∇f (x)> (y − x).
This is the first-order characterization of convexity (Lemma 2.16).
57
(A symmetric matrix M is positive semidefinite, denoted by M 0, if x> M x ≥
0 for all x, and positive definite, denoted by M 0, if x> M x > 0 for all x 6= 0.)
h0 (t) = ∇f (x + tv)> v,
h00 (t) = v> ∇2 f (x + tv)v.
The formula for h0 (t) has already been derived in the proof of Lemma 2.17,
and the formula for h00 (t) is Exercise 15.
If f is convex, we always have h00 (0) ≥ 0, as we will show next. Given
this, ∇2 f (x) 0 follows for every x ∈ dom(f ): by openness of dom(f ),
for every v ∈ Rd of sufficiently small norm, there is y ∈ dom(f ) such that
v = y − x, and then v> ∇2 f (x)v = h00 (0) ≥ 0. By scaling, this inequality
extends to all v ∈ Rd .
To show h00 (0) ≥ 0, we observe that for all sufficiently small δ, x + δv ∈
dom(f ) and hence
58
Geometrically, Lemma 2.18 means that the graph of f has non-negative
curvature everywhere and hence “looks like a bowl”. For f (x1 , x2 ) = x21 +
x22 , we have
2 2 0
∇ f (x) = ,
0 2
which is a positive definite matrix. In higher dimensions, the same ar-
gument can be used to show that the squared distance dy (x) = kx −
yk2 to a fixed point y is a convex function; see Exercise 9. The non-
squared Euclidean distance kx − yk is also convex in x, as a consequence
of Lemma 2.19(ii) below and the fact that every seminorm (in particular
the Euclidean norm kxk) is convex (Exercise 16). The squared Euclidean
distance has the advantage that it is differentiable, while the Euclidean
distance itself (whose graph is an “ice cream cone” for d = 2) is not.
m
Pmfunctions, λ1 , λ2 , . . . , λm ∈ R+ .TThen
(i) Let f1 , f2 , . . . , fm be convex
m
f :=
maxi=1 fi as well as f := i=1 λi fi are convex on dom(f ) := i=1 dom(fi ).
(ii) Let f be a convex function with dom(f ) ⊆ Rd , g : Rm → Rd an affine
function, meaning that g(x) = Ax + b, for some matrix A ∈ Rd×m and
some vector b ∈ Rd . Then the function f ◦ g (that maps x to f (Ax + b))
is convex on dom(f ◦ g) := {x ∈ Rm : g(x) ∈ dom(f )}.
59
Lemma 2.21. Let x? be a local minimum of a convex function f : dom(f ) → R.
Then x? is a global minimum, meaning that
Proof. Suppose there exists y ∈ dom(f ) such that f (y) < f (x? ) and define
y0 := λx? + (1 − λ)y for λ ∈ (0, 1). From convexity (2.2), we get that
that f (y0 ) < f (x? ). Choosing λ so close to 1 that ky0 − x? k < ε yields a
contradiction to x? being a local minimum.
This does not mean that a convex function always has a global mini-
mum. Think of f (x) = x as a trivial example. But also if f is bounded from
below over dom(f ), it may fail to have a global minimum (f (x) = ex ).
To ensure the existence of a global minimum, we need additional condi-
tions. For example, it suffices if outside some ball B, all function values
are larger than some value f (x), x ∈ B. In this case, we can restrict f
to B, without changing the smallest attainable value. And on B (which is
compact), f attains a minimum by continuity (Lemma 2.14). An easy ex-
ample: for f (x1 , x2 ) = x21 + x22 , we know that outside any ball containing 0,
f (x) > f (0) = 0.
Another easy condition in the differentiable case is given by the follow-
ing result.
60
Proof. Suppose that ∇f (x)i 6= 0 for some i. For t ∈ R, we define x(t) =
x + tei , where ei is the i-th unit vector. For |t| sufficiently small, we have
x(t) ∈ dom(f ) since dom(f ) is open. Let z(t) = f (x(t)). By the chain rule,
z 0 (0) = ∇f (x)> ei = ∇f (x)i 6= 0. Hence, z decreases in one direction as we
move away from 0, and this yields f (x(t)) < f (x) for some t, so x is not a
global minimum.
This means that the open line segment connecting (x, f (x)) and (y, f (y))
is pointwise strictly above the graph of f . For example, f (x) = x2 is strictly
convex.
Lemma 2.25 ([BV04, 3.1.4]). Suppose that dom(f ) is open and that f is twice
continuously differentiable. If the Hessian ∇2 f (x) 0 for every x ∈ dom(f )
(i.e., z> ∇2 f (x)z > 0 for any z 6= 0), then f is strictly convex.
The converse is false, though: f (x) = x4 is strictly convex but has van-
ishing second derivative at x = 0.
Lemma 2.26. Let f : dom(f ) → R be strictly convex. Then f has at most one
global minimum.
Proof. Suppose x? 6= y? are two global minima with fmin = f (x? ) = f (y? ),
and let z = 12 x? + 12 y? . By (2.8),
1 1
f (z) < fmin + fmin = fmin ,
2 2
a contradiction to x? and y? being global minima.
61
2.4.2 Example: Least squares
Suppose we want to fit a hyperplane to a set of data points x1 , . . . , xm in
Rd , based on the hypothesis that the points actually come (approximately)
from a hyperplane. A classical method for this is least squares. For con-
creteness, let us do this in R2 . Suppose that the data points are
(1, 10), (2, 11), (3, 11), (4, 10), (5, 9), (6, 10), (7, 9), (8, 10),
x x
Also, for simplicity (and quite appropriately in this case), let us restrict
to fitting a linear model, or more formally to fit non-vertical lines of the
form y = w0 + w1 x. If (xi , yi ) is the i-th data point, the least squares fit
chooses w0 , w1 such that the least squares objective
8
X
f (w0 , w1 ) = (w1 xi + w0 − yi )2
i=1
62
so we can check convexity directly using the second order condition. We
have gradient
and Hessian
2 16 72
∇ (w0 , w1 ) = .
72 408
A 2 × 2 matrix is positive semidefinite if the diagonal elements and the
determinant are positive, which is the case here, so f is actually strictly
convex and has a unique global minimum. To find it, we solve the linear
system ∇f (w0 , w1 ) = (0, 0) of two equations in two unknowns and obtain
the global minimum
43 1
? ?
(w0 , w1 ) = ,− .
4 6
Hence, the “optimal” line is
1 43
y =− x+ ,
6 4
see Figure 2.7 (right).
f (x) ≤ f (y) ∀y ∈ X.
∇f (x? )> (x − x? ) ≥ 0 ∀x ∈ X.
63
If X does not contain the global minimum, then Lemma 2.28 has a
nice geometric interpretation. Namely, it means that X is contained in the
halfspace {x ∈ Rd : ∇f (x? )> (x − x? ) ≥ 0} (normal vector ∇f (x? ) at x?
pointing into the halfspace); see Figure 2.8. In still other words, x − x?
forms a non-obtuse angle with ∇f (x? ) for all x ∈ X.
∇f (x? )> (x − x? ) ≥ 0
X
∇f (x? )
x
x?
or
minimize f (x)
(2.11)
subject to x ∈ X.
64
convex function. To avoid technicalities, we restrict ourselves to the case
dom(f ) = Rd .
f ≤α f ≤α f ≤α
Figure 2.9: Sublevel set of a non-convex function (left) and a convex func-
tion (right)
It is easy to see from the definition that every sublevel set of a convex
function is convex. Moreover, as a consequence of continuity of f , sublevel
sets are closed. The following (known as the Weierstrass Theorem) just
formalizes an argument that we have made earlier.
Theorem 2.30. Let f : Rd → R be a continuous function, and suppose there is
a nonempty and bounded sublevel set f ≤α . Then f has a global minimum.
Proof. As the set (−∞, α] is closed, its pre-image f ≤α by the continuous
function f is closed. We know that f —as a continuous function—attains a
minimum over the (non-empty) closed and bounded (= compact) set f ≤α
at some x? . This x? is also a global minimum as it has value f (x? ) ≤ α,
while any x ∈/ f ≤α has value f (x) > α ≥ f (x? ).
65
Note that Theorem 2.30 holds for convex functions as convexity on Rd
implies continuity (Exercise 8).
Lemma 2.32. Let C ⊆ Rd be a nonempty closed convex set, and let y ∈ Rd . The
following statements are equivalent.
wk := x + kz ∈ C (by (i))
1 1
zk := (wk − x0 ) = z + (x − x0 ),
k k
66
see Figure
0 2.10. By definition of a convex set, we have x0 + zk = k1 wk +
1 − k x ∈ C. Moreover, zk converges to z, so x + zk converges to x0 + z ∈
1 0
w1 w2 w3 wk
x z z1
z2
z3
x0 zk
z
C
L(C)
R(C)
C C
Figure 2.11: The recession cone and lineality space of a convex set
67
of recession), we may assume that λ1 + λ2 = 1. Now, for all x ∈ C and all
λ ∈ R, we get
Proof. Let y be a direction of recession for f ≤α , i.e. for all x ∈ f ≤α and all
λ ≥ 0, we have
f (x + λy) ≤ α.
We claim that this implies the stronger bound
68
0
x0 ∈ f ≤α ∩ f ≤α , and then we have f (x0 + λy) ≤ f (x0 ) ≤ α0 , so y is a
0
direction of recession for f ≤α .
To prove (2.12), we fix λ and let z = λy. With wk := x + kz ∈ f ≤α , we
have
1 1
x+z= 1− x + wk ,
k k
so convexity of f and the fact that wk ∈ f ≤α yields
1 1 1 1
f (x + z) ≤ 1 − f (x) + f (wk ) ≤ 1 − f (x) + α. (2.13)
k k k k
1
f (x + z) ≤ 1 − k
f (x) + k1 α
γ
f (x)
z
x w1 w2 w3 wk
69
(i) y ∈ Rd is a direction of recession of f .
(ii) f (x + λy) ≤ f (x) for all x ∈ Rd and all λ ∈ R+ .
(iii) (y, 0) is a (“horizontal”) direction of recession of (the closed convex set)
epi(f ).
Lemma 2.39. Let f : Rd → R be convex. The following statements are equiva-
lent.
(i) y ∈ Rd is a direction of constancy of f .
(ii) f (x + λy) = f (x) for all x ∈ Rd and all λ ∈ R.
(iii) (y, 0) is a (“horizontal”) direction of constancy of (the closed convex set)
epi(f ).
70
Since f is continuous and has no nonzero direction of recession, we know
that for each y ∈ S d−1 the set {λ ≥ 0 : f (λy) ≤ α} is closed and bounded
(it is actually an interval, by convexity of f ), so the maximum exists and
g(y) is well-defined. We claim that g is continuous.
Let (yk0 )k∈N be a sequence of unit vectors such that limk→∞ yk = y ∈
S d−1 . We need to show that limk→∞ g(y0 ) = g(y). Let us fix ε > 0 arbitrarily
small. For λ := g(y) − ε ≥ 0, we have f (λy) ≤ α (an easy consequence of
convexity of f and α ≥ f (0)). And for λ := g(y) + ε, we get f (λy) > α by
definition of g(y). Continuity of f then yields limk→∞ f (λyk ) = f (λy) ≤ α
and limk→∞ f (λyk ) = f (λy) > α. Hence, for sufficiently large k, g(yk ) ∈
[λ, λ] = [g(y) − ε, g(y) + ε], and limk→∞ g(y0 ) = g(y) follows.
As a continuous function, g attains a maximum λ? over the compact set
S , and this means that f ≤α is contained in the closed λ? -ball around the
d−1
71
(Lemma 2.35). Let L⊥ be the orthogonal complement of L. Restricted to
L⊥ , f is coercive, as L⊥ is orthogonal to any direction of constancy, equiva-
lently to every direction of recession, since f is weakly coercive. Therefore,
L⊥ can contain only the trivial direction of recession. It follows that f|L⊥
has a global minimum x? ∈ L⊥ by Theorem 2.42 (which we can apply af-
ter identifying L⊥ w.l.o.g. with Rm for some m ≤ n). This is also a global
minimum of f . To see this, let z ∈ Rd and write it (uniquely) in the form
z = x + y with x ∈ L⊥ and y ∈ L. Then we get
2.6 Examples
In the following two sections, we give two examples of convex function
minimization tasks that arise from machine learning applications.
72
Figure 2.13: Some training images from the MNIST data set (picture from
http://corochann.com/mnist-dataset-introduction-1138.
html
eyj
zj = zj (y) = P9 . (2.14)
k=0 eyk
The classification then simply outputs digit j with probability zj . The
matrix W is chosen such that it (approximately) minimizes the classifica-
tion error on the training set P . Again, it is not canonical how we measure
classification error; here we use the following loss function to evaluate the
error induced by a given matrix W .
9
!
X X X
`(W ) = − ln zd(x) (W x) = ln e(W x)k − (W x)d(x) . (2.15)
x∈P x∈P k=0
This function “punishes” images for which the correct digit j has low
probability zj (corresponding to a significantly negative value of log zj ).
In an ideal world, the correct digit would always have probability 1, re-
sulting in `(W ) = 0. But under (2.14), probabilities are always strictly
between 0 and 1, so we have `(W ) > 0 for all W .
73
Exercise 12 asks you to prove that ` is convex. In Exercise 13, you will
characterize the situations in which ` has a global minimum.
However, in our scenario, the relevant GPA scores span a range of only
0.5 while the relevant TOEFL scores span a range of 20. The resulting least
squares objective would be somewhat ugly; we already saw this in our
previous example (2.9), where the data points had large second coordinate,
resulting in the w1 -scale being very different from the w2 -scale. This time,
we normalize first, so that w1 und w2 become comparable and allow us to
understand the relative influences of GPA and TOEFL.
2
Any resemblance to real departments is purely coincidental. Also, no serious depart-
ment will base performance forecasts on data from 10 students, as we will do it here.
74
GPA TOEFL GGPA
3.52 100 3.92
3.66 109 4.34
3.76 113 4.80
3.74 100 4.67
3.93 100 5.52
3.88 115 5.44
3.77 115 5.04
3.66 107 4.73
3.87 106 5.03
3.84 107 5.06
Table 2.1: Data for 10 admitted students: GPA and TOEFL scores (at time
of application), GGPA (at time of graduation)
We first want to assume that the inputs and outputs are centered, mean-
ing that
n n
1X 1X
xi = 0, yi = 0.
n i=1 n i=1
1
Pn
This can be achieved by simply subtracting the mean x̄ = n i=1 xi from
every input and the mean ȳ = n1 ni=1 yi from every output. In our exam-
P
ple, this yields the numbers in Table 2.2 (left).
After centering, the global minimum (w0? , w? ) of the least squares ob-
jective satisfies w0? = 0 while w? is unaffected by centering (Exercise 17),
so that we can simply omit the variable w0 in the sequel.
75
GPA TOEFL GGPA GPA TOEFL GGPA
-0.24 -7.2 -0.94 -2.04 -1.28 -0.94
-0.10 1.8 -0.52 -0.88 0.32 -0.52
-0.01 5.8 -0.05 -0.05 1.03 -0.05
-0.02 -7.2 -0.18 -0.16 -1.28 -0.18
0.17 -7.2 0.67 1.42 -1.28 0.67
0.12 7.8 0.59 1.02 1.39 0.59
0.01 7.8 0.19 0.06 1.39 0.19
-0.10 -0.2 -0.12 -0.88 -0.04 -0.12
0.11 -1.2 0.17 0.89 -0.21 0.17
0.07 -0.2 0.21 0.62 -0.04 0.21
Finally, we assume that all d input variables are on the same scale,
meaning that
n
1X 2
x = 1, j = 1, . . . , d.
n i=1 ij
To achieve this for fixed j (assuming
q P that no variable is 0 in all inputs),
we multiply all xij by s(j) = n/ ni=1 x2ij (which, in the optimal solution
w? , just multiplies wj? by 1/s(j), an argument very similar to the one in
Exercise 17). For our data set, the resulting normalized data are shown in
Table 2.2 (right). Now the least squares objective (after omitting w0 ) is
10
X
f (w1 , w2 ) = (w1 xi1 + w2 xi2 − yi )2
i=1
≈ 10w12 + 10w22 + 1.99w1 w2 − 8.7w1 − 2.79w2 + 2.09.
This is minimized at
w? = (w1? , w2? ) ≈ (0.43, 0.097),
so if our initial hypothesis (2.16) is true, we should have
yi ≈ yi? = 0.43xi1 + 0.097xi2 (2.17)
in the normalized data. This can quickly be checked, and the results are
not perfect, but not too bad, either; see Table 2.3 (ignore the last column
for now).
76
xi1 xi2 yi yi? zi?
-2.04 -1.28 -0.94 -1.00 -0.87
-0.88 0.32 -0.52 -0.35 -0.37
-0.05 1.03 -0.05 0.08 -0.02
-0.16 -1.28 -0.18 -0.19 -0.07
1.42 -1.28 0.67 0.49 0.61
1.02 1.39 0.59 0.57 0.44
0.06 1.39 0.19 0.16 0.03
-0.88 -0.04 -0.12 -0.38 -0.37
0.89 -0.21 0.17 0.36 0.38
0.62 -0.04 0.21 0.26 0.27
Table 2.3: Outputs yi? predicted by the linear model (2.17) and by the model
zi? = 0.43xi1 that simply ignores the second input variable
What we also see from (2.17) is that the first input variable (GPA) has a
much higher influence on the output (GGPA) than the second one (TOEFL).
In fact, if we drop the second one altogether, we obtain outputs zi? (last col-
umn in Table 2.3) that seem equivalent to the predicted outputs yi? within
the level of noise that we have anyway.
We conclude that TOEFL scores are probably not indicative for the per-
formance of admitted students, so the admission committee should not
care too much about them. Requiring a minimum score of 100 might make
sense, but whenever an applicant reaches at least this score, the actual
value does not matter.
77
(subset selection). A very simple one is just to forget about weights close to
0 in the least squares solution. However, for this, we need to define what
it means to be close to 0; and it may happen that small changes in the data
lead to different variables being dropped if their weights are around the
threshold. On the other end of the spectrum, there is best subset selection
where we compute the least squares solution subject to the constraint that
there are at most k nonzero weights, for some k that we believe is the right
number of important variables. This is NP-hard, though.
A popular approach that in many cases improves forecasts and at the
same time identifies important variables has been suggested by Tibshirani
in 1996 [Tib96]. Instead of minimizing the least squares objective glob-
ally, it is minimized over a suitable `1 -ball (ball in the 1-norm kwk1 =
Pd
j=1 |wj |): Pn > 2
minimize i=1 kw xi − yi k (2.18)
subject to kwk1 ≤ R,
where R ∈ R+ is some parameter. In our case, if we for example
78
In our example, it is easy to get an intuition why this works. Let us look
at the case R = 0.2. The smallest value attainable in (2.19) is the smallest α
such that that the (elliptical) sublevel set f ≤α of the least squares objective
f still intersects the `1 -ball {(w1 , w2 ) : |w1 |+|w2 | ≤ 0.2}. This smallest value
turns out to be α = 0.75, see Figure 2.14. For this value of α, the sublevel
set intersects the `1 -ball exactly in one point, namely (0.2, 0).
b
10w12 + 10w22 + 1.99w1 w2 − 8.7w1 − 2.79w2 + 2.09 = 0.75
(0.43, 0.097)
79
2.7 Convex programming
Convex programs are specific convex constrained minimization problems.
They arise when we minimize a convex function f over a convex set X
defined by finitely many convex inequality and affine equality constraints.
This turns out to be an important class of problems with a rich theory. For
a large part of this section, we do not need to assume convexity.
According to Boyd and Vandenberge [BV04, 4.1.1], an optimization
problem in standard form is given by
minimize f0 (x)
subject to fi (x) ≤ 0, i = 1, . . . , m (2.20)
hi (x) = 0, i = 1, . . . , p
p
The problem has domain D = (∩m i=0 dom(fi )) ∩ (∩i=1 dom(hi )). We assume
that D is open. You may think of D as equal to Rd in many cases.
A convex program arises when the fi are convex functions, and the hi
are affine functions with domain Rd . In this case, Observation 2.9 has the
following consequences: the problem domain D is convex, and so are all
sets of the form {x ∈ D : fi (x) ≤ 0} and {x ∈ D : hi (x) = 0} (here we use
that the hi are affine). Also
X = {x ∈ Rd : fi (x) ≤ 0, i = 1, . . . , m; hi (x) = 0, i = 1, . . . , p},
the feasible region of (2.20) is then a convex set. So we are in constrained
minimization as discussed in Section 2.4.3, with a feasible region X in-
duced by finitely many (in)equality constraints.
80
The λi , νi are called Lagrange multipliers.
The Lagrange dual function is the function g : Rm × Rp → R ∪ {−∞}
defined by
g(λ, ν) = inf L(x, λ, ν). (2.22)
x∈D
The fact that g can assume value −∞ is not a pathology but typical. We
will see that the “interesting” (λ, ν) are the ones for which g(λ, ν) > −∞.
Let’s discuss linear programming, the case where all involved func-
tions are affine. Concretely, we consider a linear program of the form
minimize c> x
subject to Ax = b (2.23)
x ≥ 0.
We assume there are d variables, so x ∈ Rd . This is of the form (2.20): the
vector equation Ax = b summarizes the equality constraints induced by
hi (x) := a>
i x − bi , i = 1, . . . , p, while the nonnegativity constraints come
from fi (x) := −xi , i = 1, . . . , m. We finally have f0 (x) := c> x. As all
functions are defined everywhere, the domain is D = Rd .
Then the Lagrangian is
L(x, λ, ν) = c> x − λ> x + ν > (Ax − b) = −b> ν + (c> − λ> + ν > A)x.
It follows that g(λ, ν) > −∞ if and only if c> − λ> + ν > A = 0. And in this
case, we have g(λ, ν) = −b> ν.
The significance of the Lagrangian dual function is that it provides a
lower bound on the infimum value of (2.20), provided that λ ≥ 0. But a
nontrivial lower bound is obtained only if g(λ, ν) > −∞, this is why we
are interested in this case.
Lemma 2.46 (Weak Lagrange duality). Let x be a feasible solution of the
optimization problem (2.20), meaning that fi (x) ≤ 0 for i = 1, . . . , m and
hi (x) = 0 for i = 1, . . . , p. Let g be the Lagrange dual function of (2.20) and
λ ∈ Rm , ν ∈ Rp such that λ ≥ 0. Then
g(λ, ν) ≤ f0 (x).
Proof.
m p
X X
g(λ, ν) ≤ L(x, λ, ν) = f0 (x) + λi fi (x) + νi hi (x) ≤ f0 (x).
i=1 i=1
| {z } | {z }
≤0 =0
81
It is natural to ask how λ and ν must be chosen such that we get the
best lower bound. The answer is provided by the Lagrange dual.
Definition 2.47. Let g be the Lagrange dual function of the optimization problem
(2.20). Then the Lagrange dual of (2.20) is the optimization problem
maximize g(λ, ν)
(2.24)
subject to λ ≥ 0.
minimize −g(λ, ν)
subject to λ ≥ 0.
maximize −b> ν
subject to c> + ν > A ≥ 0
maximize b> y
(2.25)
subject to A> y ≤ c
82
In the case of linear programming, the primal (2.23) and the dual (2.25)
have the same optimal value: inf c> x = sup b> y. It may happen that this
value is −∞ (if the primal is unbounded and the dual is infeasible), or
∞ (if the primal is infeasible and the dual is unbounded). If the value is
finite, it is attained in both the primal and the dual, so we actually have
min c> x = max b> y.
This is the strong duality theorem of linear programming [MG07, Sec-
tion 6.1]. It strenghtens weak duality which says that inf c> x ≥ sup b> y.
For general convex programs (2.20), strong duality still holds (here, we
do need convexity!), but some extra conditions are needed. There are a
number of known sufficient conditions; these are usually named constraint
qualifications. Here is a concrete result.
Theorem 2.48 ([BV04, 5.3.2]). Suppose that (2.20) is a convex program with a
feasible solution x̃ that in additions satisfies fi (x̃) < 0, i = 1, . . . , m (a Slater
point). Then the infimum value of the primal (2.20) equals the supremum value
of its Lagrange dual (2.24). Moreover, if this value is finite, it is attained by a
feasible solution of the dual. (2.24).
Unlike in linear programming, a finite value is not necessarily attained
by a feasible solution of the primal. So in the case of finite value, the the-
orem can be summarized as inf f0 (x) = max g(λ, ν); see Exercise 19 for an
illustration of the theorem.
A common application of Lagrange duality is to turn the “hard” con-
straints of the optimization problem (2.20) into “soft” ones by moving
them to the objective function. Instead of the constrained minimization
problem (2.20), we consider (for some fixed λ ≥ 0 and fixed ν) the uncon-
strained minimization problem
minimize f0 (x) + m
P Pp
i=1 λi fi (x) + i=1 νi hi (x). (2.26)
As the objective function is the Lagrangian L(x, λ, ν), the infimum value
of this unconstrained problem is by definition the value g(λ, ν) of the
Lagrange dual function. If we have strong Lagrange duality, there exist
λ = λ? ≥ 0 and ν = ν ? such that the unconstrained problem (2.26) has
the same infimum as the constrained optimization problem (2.20). For all
λ ≥ 0 and ν, we know that the infimum of (2.26) provides a lower bound
on the infimum of (2.20).
In practice, one could repeatedly solve (2.26), with a number of sen-
sible candidates for λ ≥ 0 and ν, and use the largest resulting value as
83
an approximation of the infimum value of (2.20). Naturally, this approach
comes without any theoretical guarantees, unless we know that strong du-
ality actually holds, and that “sensible” is quantifiable in some way.
Strong duality (inf f0 (x) = sup g(λ, ν)) may also hold when there is no
Slater point, or even when (2.20) is not a convex program. Theorem 2.48
simply provides one particular and very useful sufficient condition.
If x̃ and (λ̃, ν̃) have zero duality gap, we have the following crucial
chain of (in)equalities:
Lemma 2.50 (Complementary slackness). If x̃ and (λ̃, ν̃) have zero duality
gap, then
λ̃i fi (x̃) = 0, i = 1, . . . , m.
84
This is called complementary slackness, since if there is slack in the i-
th inequality of the primal (fi (x̃) < 0), then there is no slack in the i-th
inequality of the dual (λ̃i = 0); and vice versa.
Lemma 2.51 (Vanishing Lagrangian gradient). If x̃ and (λ̃, ν̃) have zero du-
ality gap, and if all fi and hi are differentiable, then
m p
X X
∇f0 (x̃) + λ̃i ∇fi (x̃) + ν̃i ∇hi (x̃) = 0.
i=1 i=1
85
Lagrangian gradient (2.29) along with Lemma 2.22, showing that x̃ min-
imizes the function f (x) := L(x, λ̃, ν̃). This is convex by Lemma 2.19 (i).
The inequality under the brace in the third line is complementary slack-
ness (2.28), and from this, equality in the fourth line follows.
The Karush-Kuhn-Tucker conditions (primal and dual feasibilty, com-
plementary slackness, vanishing Lagrangian gradient) can be of signifi-
cant help in solving the primal problem (2.20). If we can find x̃ and (λ̃, ν̃)
satisfying them, we know that x̃ is a minimizer of (2.20). This may be
easier to “solve” than (2.20) itself.
However, we cannot always count on the Karush-Kuhn-Tucker condi-
tions being solvable. Theorem 2.52 guarantees them only if there are pri-
mal and dual solutions of zero duality gap. But if the primal has a Slater
point, then inf f0 (x) = max g(λ, ν) by Theorem 2.48, and in this case, the
Karush-Kuhn-Tucker conditions are indeed equivalent to the existence of
a minimizer of (2.20).
86
In general convex programs, this approach does not work. In partic-
ular, there may not be any minimizers, even if the program’s infimum
value is finite; see Exercise 19. Still, one can try to understand how long
the methods take in order to reach optimization error at most ε. We argued
in Section 1.11 that this is enough for most Data Science purposes.
For convex programs and interior point methods, this has been pio-
neered by Nesterov and Nemirovskii in their 1994 book [NN94]. Boyd and
Vandenberghe present the full theory in Section 11 of their book [BV04].
Here we only give (part of) the high-level summary of the state of af-
fairs [BV04, 11.5.5].
It is important to say upfront that the analysis does not work for arbi-
trary convex programs of the form (2.20); some assumptions are needed.
Mainly, the function f0 to be minimized has to be self-concordant which is a
condition involving its second- and third-order derivatives. Also, we need
some bound M on the maximum value of an optimal solution.
In a first phase, one needs to find a feasible solution, and the runtime
of this phase inversely depends on how close the problem is to being in-
feasible. In the second phase, the number of iterations is of the order
√ M − p?
O m log ,
ε
where p? is the infimum value of (2.20). The bound dos not depend on
p, the number of equality constraints, and also not on d, the number of
variables. These two problem dimensions appear in the complexity of the
individual iterations, but we will not go into this.
What we can say, though, is that the individual iterations are com-
putationally very heavy, making them unsuitable for large-scale learning
where optimization time is a bottleneck.
Hence, it makes sense to consider simple algorithms with low computa-
tional cost per step, even if they need more iterations than the best possible
algorithms. This is the approach that we will take in the subsequent chap-
ters.
2.8 Exercises
Exercise 6. Prove that a differentiable function is continuous!
87
Exercise 7. Prove Jensen’s inequality (Lemma 2.13)!
Exercise 8. Prove that a convex function (with dom(f ) open) is continuous
(Lemma 2.14)!
Hint: First prove that a convex function f is bounded on any cube C =
[l1 , u1 ] × [l2 , u2 ] × · · · × [ld , ud ] ⊆ dom(f ), with the maximum value occurring
on some corner of the cube (a point z such that zi ∈ {li , ui } for all i). Then use
this fact to show that—given x ∈ dom(f ) and ε > 0—all y in a sufficiently
small ball around x satisfy |f (y) − f (x)| < ε.
Exercise 9. Prove that the function dy : Rd → R, x 7→ kx − yk2 is strictly
convex for any y ∈ Rd . (Use Lemma 2.25.)
Exercise 10. Prove Lemma 2.19! Can (ii) be generalized to show that for two
convex functions f, g, the function f ◦ g is convex as well?
Exercise 11. Prove Lemmata 2.38 and 2.39!
Exercise 12. Consider the function ` defined in (2.15). Prove that ` is convex!
Exercise 13. Consider the function ` defined in (2.15). Let us call an argument
matrix W a separator for P if for all x ∈ P ,
9
(W x)d(x) = max(W x)j ,
j=0
i.e. under (2.14), the correct digit has highest probability (possibly along with
other digits). A separator is trivial if for all x ∈ P and all i, j ∈ {0, . . . , 9},
(W x)i = (W x)j .
For example, whenever the rows of W are pairwise identical, we obtain a trivial
separator. But depending on the data, there may be other trivial separators. For
example, if some pixel is black (gray value 0) in all images, arbitrarily changing
the entries in the corresponding column of a trivial separator gives us another
trivial separator. For a trivial separator W , (2.15) yields `(W ) = |P | ln 10.
Prove the following statement: ` has a global minimum if and only if all sepa-
rators are trivial.
As a special case, consider the situation in which there exists a strong (and
in particular nontrivial) separator: a matrix W ? such that for all x ∈ P and all
j 6= d(x),
(W ? x)d(x) > (W ? x)j ,
88
i.e. the correct digit has unique highest probability. In this case, it is easy to see
that `(λW ? ) →λ→∞ 0, so we cannot have a global minimum, as inf W (`(W )) = 0
is not attainable.
Pd
Exercise 14. Prove that the function f (x) = kxk1 = i=1 |xi | (`1 -norm) is
convex!
n
X
f (w0 , w) = (w0 + w> xi − yi )2 .
i=1
Prove that w0? = 0. Also, suppose x0i and yi0 are such that for all i, x0i = xi + q,
yi0 = yi + r. Show that (w0 , w) minimizes f if and only if (w0 − w> q + r, w)
minimizes n
X
0
f (wo , w) = (w0 + w> x0i − yi0 )2 .
i=1
89
some convex combination λx + (1 − λ)y ∈ dom(f ) with f (λx + (1 − λ)y) = ∞,
violating convexity).
Prove that the negative of the Lagrangian dual function g : Rm × Rp →
R ∪ {−∞} as in Definition 2.45 is convex in the above sense.
minimize p x2 − x1
subject to x21 + 1 − x2 ≤ 0.
(i) Prove that this is a convex program with a Slater point so that the conditions
of Theorem 2.48 are satisfied!
(ii) Compute the Lagrange dual function g, the maximum value γ of the La-
grange dual problem and a feasible solution of value γ.
(iii) Show that the primal problem does not attain its infimum value (which is
also γ by Theorem 2.48)!
90
Chapter 3
Gradient Descent
Contents
3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.1.1 Convergence rates . . . . . . . . . . . . . . . . . . . . 93
3.2 The algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.3 Vanilla analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.4 Lipschitz convex functions: O(1/ε2 ) steps . . . . . . . . . . . 97
3.5 Smooth convex functions: O(1/ε) steps . . . . . . . . . . . . 99
3.6 Acceleration
√ for smooth convex functions:
O(1/ ε) steps . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.7 Interlude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.8 Smooth and strongly convex functions:
O(log(1/ε)) steps . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
91
3.1 Overview
The gradient descent algorithm (including variants such as projected or
stochastic gradient descent) is the most useful workhorse for minimizing
loss functions in practice. The algorithm is extremely simple and surpris-
ingly robust in the sense that it also works well for many loss functions
that are not convex. While it is easy to construct (artificial) non-convex
functions on which gradient descent goes completely astray, such func-
tions do not seem to be typical in practice; however, understanding this
on a theoretical level is an open problem, and only few results exist in this
direction.
The vast majority of theoretical results concerning the performance of
gradient descent hold for convex functions only. In this and the following
chapters, we will present some of these results, but maybe more impor-
tantly, the main ideas behind them. As it turns out, the number of ideas
that we need is rather small, and typically, they are shared between dif-
ferent results. Our approach is therefore to fully develop each idea once,
in the context of a concrete result. If the idea reappears, we will typically
only discuss the changes that are necessary in order to establish a new re-
sult from this idea. In order to avoid boredom from ideas that reappear
too often, we omit other results and variants that one could also get along
the lines of what we discuss.
Let f : Rd → R be a convex and differentiable function. We also assume
that f has a global minimum x? , and the goal is to find (an approximation
of) x? . This usually means that for a given ε > 0, we want to find x ∈ Rd
such that
f (x) − f (x? ) < ε.
Notice that we are not making an attempt to get near to x? itself — there
can be several minima y? 6= x? with f (x? ) = f (y? ).
Gradient descent is an iterative method, meaning that it generates a se-
quence x0 , x2 , . . . of solutions such that in some iteration T , we eventually
have f (xT ) − f (x? ) < ε.
Table 3.1 gives an overview of the results that we will prove. They con-
cern several variants of gradient descent as well as several classes of func-
tions. The significance of each algorithm and function class will briefly be
discussed when it first appears.
In Chapter 6, we will also look at gradient descent on functions that
92
smooth &
Lipschitz smooth strongly
strongly
convex convex convex
convex
functions functions functions
functions
gradient Thm. 3.1 Thm. 3.8 Thm. 3.14
descent O(1/ε2 ) O(1/ε) O(log(1/ε))
accelerated
Thm. 3.9
gradient √
O(1/ ε)
descent
projected
Thm. 4.2 Thm. 4.4 Thm. 4.5
gradient
O(1/ε2 ) O(1/ε) O(log(1/ε))
descent
subgradient Thm. 10.20 Thm. 10.22
descent O(1/ε2 ) O(1/ε)
stochastic
Thm. 12.4 Thm. 12.4
gradient
O(1/ε2 ) O(1/ε)
descent
Table 3.1: Results on gradient descent. Below each theorem, the number
of steps is given which the respective variant needs on the respective func-
tion class to achieve additive approximation error at most ε.
are not convex. In this case, provably small approximation error can still
be obtained for some particularly well-behaved functions (we will give an
example). For smooth (but not necessarily convex) functions, we gener-
ally cannot show convergence in error, but a (much) weaker convergence
property still holds.
93
whenever there is a real number 0 < c < 1 such that
The word linear comes from the fact that the error in step t + 1 is bounded
by a linear function of the error in step t.
This means that for t large enough, the error goes down by at least a
constant factor in each step. Linear convergence implies that an error of at
most ε is achieved within O(log(1/ε)) iterations. For example, this is the
bound provided by Theorem 3.14 (last entry in the first row of Table 3.1),
and it is proved by showing linear convergence of the algorithm.
The term superlinear convergence refers to an algorithm for which there
are constants r > 1 and c > 0 such that
xt+1 = xt + vt .
94
To get any decrease in function value at all, we have to choose vt such that
∇f (xt )> vt < 0. But among all steps vt of the same length, we should in
fact choose the one with the most negative value of ∇f (xt )> vt , so that we
maximize our decrease in function value. This is achieved when vt points
into the direction of the negative gradient −∇f (xt ). But as differentiability
guarantees decrease only for small steps, we also want to control how far
we go along the direction of the negative gradient.
Therefore, the step of gradient descent is defined by
Here, γ > 0 is a fixed stepsize, but it may also make sense to have γ depend
on t. For now, γ is fixed. We hope that for some reasonably small integer
t, in the t-th iteration we get that f (xt ) − f (x? ) < ε; see Figure 3.1 for an
example.
Now it becomes clear why we are assuming that dom(f ) = Rd : The
update step (3.1) may in principle take us “anywhere”, so in order to get
a well-defined algorithm, we want to make sure that f is defined and dif-
ferentiable everywhere.
The choice of γ is critical for the performance. If γ is too small, the
process might take too long, and if γ is too large, we are in danger of
overshooting. It is not clear at this point whether there is a “right” stepsize.
So we have reduced the problem to the one of bounding f (xt )> (xt − x? ),
and this is what we do next.
Let xt be some iterate in the sequence (3.1). We abbreviate gt := ∇f (xt ).
By definition of gradient descent (3.1), gt = (xt − xt+1 )/γ, hence
1
gt> (xt − x? ) = (xt − xt+1 )> (xt − x? ). (3.3)
γ
95
x2
x5
3 x3 x4
x2
x1
x0
x1
4
Now we apply (somewhat out of the blue, but this will clear up in the next
step) the basic vector equation 2v> w = kvk2 + kwk2 − kv − wk2 (a.k.a. the
cosine theorem) to rewrite the same expression as
1
gt> (xt − x? ) = kxt − xt+1 k2 + kxt − x? k2 − kxt+1 − x? k2
2γ
1
γ 2 kgt k2 + kxt − x? k2 − kxt+1 − x? k2
=
2γ
γ 1
kgt k2 + kxt − x? k2 − kxt+1 − x? k2
= (3.4)
2 2γ
Next we sum this up over the iterations t, so that the latter two terms in
96
the bracket cancel in a telescoping sum.
T −1 T −1
X γX 1
gt> (xt ?
kgt k2 + kx0 − x? k2 − kxT − x? k2
−x ) =
t=0
2 t=0 2γ
T −1
γX 1
≤ kgt k2 + kx0 − x? k2 (3.5)
2 t=0 2γ
This gives us an upper bound for the average error f (xt ) − f (x? ), t =
0, . . . , T − 1, hence in particular for the error incurred by the iterate with
the smallest function value. The last iterate is not necessarily the best one:
gradient descent with fixed stepsize γ will in general also make steps that
overshoot and actually increase the function value; see Exercise 23(i).
The question is of course: is this result any good? In general, the an-
swer is no. A dependence on kx0 − x? k is to be expected (the further we
start from x? , the longer we will take); the dependence on the squared gra-
dients kgt k2 is more of an issue, and if we cannot control them, we cannot
say much.
97
Assuming bounded gradients rules out many interesting functions,
though. For example, f (x) = x2 (a supermodel in the world of convex
functions) already doesn’t qualify, as ∇f (x) = 2x—and this is unbounded
as x tends to infinity. But let’s care about supermodels later.
Theorem 3.1. Let f : Rd → R be convex and differentiable with a global mini-
mum x? ; furthermore, suppose that kx0 − x? k ≤ R and k∇f (x)k ≤ B for all x.
Choosing the stepsize
R
γ := √ ,
B T
gradient descent (3.1) yields
T −1
1X RB
(f (xt ) − f (x? )) ≤ √ .
T t=0 T
R2 B 2
T ≥
ε2
many iterations. This is not particularly good when it comes to concrete
numbers (think of desired error ε = 10−6 when R, B are somewhat larger).
On the other hand, the number of steps does not depend on d, the di-
mension of the space. This is very important since we often optimize in
high-dimensional spaces. Of course, R and B may depend on d, but in
many relevant cases, this dependence is mild.
98
What happens if we don’t know R and/or B? An idea is to “guess”
R and B, run gradient descent with T and γ resulting from the guess,
check whether the result has absolute error at most ε, and repeat with a
different guess otherwise. This fails, however, since in order to compute
the absolute error, we need to know f (x? ) which we typically don’t. But
Exercise 24 asks you to show that knowing R is sufficient.
Next we want to look at functions for which f (y) can be bounded from
above by f (x)+∇f (x)> (y−x), up to at most quadratic error. The following
definition applies to all differentiable functions, convexity is not required.
L
f (y) ≤ f (x) + ∇f (x)> (y − x) + kx − yk2 , ∀x, y ∈ X. (3.8)
2
If X = dom(f ), f is simply called smooth.
Recall that (3.7) says that for any x, the graph of f is above its tangential
hyperplane at (x, f (x)). In contrast, (3.8) says that for any x ∈ X, the
graph of f is below a not-too-steep tangential paraboloid at (x, f (x)); see
Figure 3.2.
This notion of smoothness has become standard in convex optimiza-
tion, but the naming is somewhat unfortunate, since there is an (older)
definition of a smooth function in mathematical analysis where it means a
function that is infinitely often differentiable.
We have the following simple characterization of smoothness.
Lemma 3.3 (Exercise 21). Suppose that dom(f ) is open and convex, and that
f : dom(f ) → R is differentiable. Let L ∈ R+ . Then the following two state-
ments are equivalent.
99
f (x) + ∇f (x)> (y − x) + L2 kx − yk2
f (y)
f (x) + ∇f (x)> (y − x)
x y
Let us discuss some cases. If L = 0, (3.7) and (3.8) together require that
100
Q> )x, where 12 (Q + Q> ) is symmetric. Therefore, we can assume without
loss of generality that Q is symmetric, i.e., it suffices to show that quadratic
functions defined by symmetric functions are smooth.
Lemma 3.4 (Exercise 22). Let f (x) = x> Qx+b> x+c, where Q is a symmetric
(d × d) matrix, b ∈ Rd , c ∈ R. Then f is smooth with parameter 2 kQk, where
kQk is the spectral norm of Q (Definition 2.2).
101
Lemma 3.6 (Exercise 25).
(i) Let f1 , f2 , . . . , fm be smooth with parameters P
L1 , L2 , . . . , Lm , and let
λm ∈ R+ . Then the function
λ1 , λ2 , . . . ,P f := mi=1 λi fi is smooth with
parameter m m
T
λ L
i=1 i i over dom(f ) := i=1 dom(f i ).
104
The obvious question resulting from this was whether there actually
exists a first-order method that has additive error O(1/T 2 ) after T steps, on
every smooth function. This was answered in the affirmative by Nesterov
in 1983 when he proposed an algorithm that is now known as (Nesterov’s)
accelerated gradient descent [Nes83]. Nesterov’s book (Sections 2.1 and 2.2)
is a comprehensive source for both lower and upper bound [Nes18].
It is not easy to understand why the accelerated gradient descent algo-
rithm is an optimal first-order method, and how Nesterov even arrived at
it. A number of alternative derivations of optimal algorithms have been
given by other authors, usually claiming that they provide a more natural
or easier-to-grasp approach. However, each alternative approach requires
some understanding of other things, and there is no well-established “sim-
plest approach”. Here, we simply throw the algorithm at the reader, with-
out any attempt to motivate it beyond some obvious words. Then we
present a short proof that the algorithm is indeed optimal.
Let f : Rd → R be convex, differentiable, and smooth with parame-
ter L. Accelerated gradient descent is the following algorithm: choose z0 =
y0 = x0 arbitrary. For t ≥ 0, set
1
yt+1 := xt − ∇f (xt ), (3.11)
L
t+1
zt+1 := zt − ∇f (xt ), (3.12)
2L
t+1 2
xt+1 := yt+1 + zt+1 . (3.13)
t+3 t+3
This means, we are performing a normal “smooth step” from xt to obtain
yt+1 and a more aggressive step from zt to get zt+1 . The next iterate xt+1
is a weighted average of yt+1 and zt+1 , where we compensate for the more
aggressive step by giving zt+1 a relatively low weight.
Theorem 3.9. Let f : Rd → R be convex and differentiable with a global min-
imum x? ; furthermore, suppose that f is smooth with parameter L according
to (3.8). Accelerated gradient descent (3.11), (3.12), and (3.13), yields
2L kz0 − x? k2
f (yT ) − f (x? ) ≤ , T > 0.
T (T + 1)
Comparing this bound with the one from Theorem 3.8, we see that the
error is now indeed O(1/T 2 ) instead of O(1/T ); to reach error at most ε,
105
√
accelerated gradient descent therefore only needs O(1/ ε) steps instead
of O(1/ε).
Proof. The analysis uses a potential function argument [BG17]. We assign a
potential Φ(t) to each time t and show that Φ(t + 1) ≤ Φ(t). The potential
is
Φ(t) := t(t + 1) (f (yt ) − f (x? )) + 2L kzt − x? k2 .
If we can show that the potential always decreases, we get
1
f (yt+1 ) ≤ f (xt ) − k∇f (xt )k2 ; (3.14)
2L
t+1
(ii) the vanilla analysis (Section 3.3) for step (3.12) with γ = 2L
, gt =
∇f (xt ):
t+1 L
gt> (zt − x? ) = kgt k2 + kzt − x? k2 − kzt+1 − x? k2 ;
(3.15)
4L t+1
(iii) convexity:
Now,
Φ(t + 1) − Φ(t)
∆ :=
t+1
106
can be bounded as follows.
2L
t (f (yt+1 ) − f (yt )) + 2 (f (yt+1 ) − f (x? )) + kzt+1 − x? k2 − kzt − x? k2
∆ =
t+1
(3.15) t+1
= t (f (yt+1 ) − f (yt )) + 2 (f (yt+1 ) − f (x? )) + kgt k2 − 2gt> (zt − x? )
2L
(3.14) 1
≤ t (f (xt ) − f (yt )) + 2 (f (xt ) − f (x? )) − kgt k2 − 2gt> (zt − x? )
2L
≤ t (f (xt ) − f (yt )) + 2 (f (xt ) − f (x? )) − 2gt> (zt − x? )
(3.16)
≤ tgt> (xt − yt ) + 2gt> (xt − x? ) − 2gt> (zt − x? )
= gt> ((t + 2)xt − tyt − 2zt )
(3.13)
= gt> 0 = 0.
Hence, we indeed have Φ(t + 1) ≤ Φ(t).
3.7 Interlude
Let us get back to the supermodel f (x) = x2 (that is smooth with param-
eter L = 2, as we observed before). According to Theorem 3.8, gradient
descent (3.1) with stepsize γ = 1/2 satisfies
1 2
f (xT ) ≤ x. (3.17)
T 0
Here we used that the minimizer is x? = 0. Let us check how good this
bound really is. For our concrete function and concrete stepsize, (3.1) reads
as
1
xt+1 = xt − ∇f (xt ) = xt − xt = 0,
2
so we are always done after one step! But we will see in the next section
that this is only because the function is particularly beautiful, and on top of
that, we have picked the best possible smoothness parameter. To simulate
a more realistic situation here, let us assume that we have not looked at the
supermodel too closely and found it to be smooth with parameter L = 4
only (which is a suboptimal but still valid parameter). In this case, γ = 1/4
and (3.1) becomes
1 xt xt
xt+1 = xt − ∇f (xt ) = xt − = .
4 2 2
107
So, we in fact have x
0 1 2
f (xT ) = f = x. (3.18)
2T 22T 0
This is still vastly better than the bound of (3.17)! While (3.17) requires
T ≈ x20 /ε to achieve f (xT ) ≤ ε, (3.18) requires only
2
1 x0
T ≈ log ,
2 ε
which is an exponential improvement in the number of steps.
and therefore says that every convex function satisfies (3.19) with µ = 0.
In the spirit of Lemma 3.3 for smooth functions, we can characterize
strong convexity via convexity of another function.
108
f (x) + ∇f (x)> (y − x) + L2 kx − yk2
f (y)
f (x) + ∇f (x)> (y − x) + µ2 kx − yk2
x y
Lemma 3.11 (Exercise 28). Suppose that dom(f ) is open and convex, and that
f : dom(f ) → R is differentiable. Let µ ∈ R+ . Then the following two state-
ments are equivalent.
109
Lemma 3.13 (Exercise 30). Let f : Rd → R be strongly convex with parameter
µ > 0 and smooth with parameter µ. Prove that f is of the form
µ
f (x) = kx − bk2 + c,
2
where b ∈ Rd , c ∈ R.
1 µ
f (xt )−f (x? ) ≤ γ 2 k∇f (xt )k2 + kxt − x? k2 − kxt+1 − x? k2 − kxt −x? k2 .
2γ 2
(3.20)
Rewriting this yields a bound on kxt+1 − x? k2 in terms of kxt − x? k2 , along
with some “noise” that we still need to take care of:
kxt+1 −x? k2 ≤ 2γ(f (x? )−f (xt ))+γ 2 k∇f (xt )k2 +(1−µγ)kxt −x? k2 . (3.21)
1
γ := ,
L
gradient descent (3.1) with arbitrary x0 satisfies the following two properties.
L µ T
f (xT ) − f (x? ) ≤ 1− kx0 − x? k2 , T > 0.
2 L
110
Proof. For (i), we show that the noise in (3.21) disappears. By sufficient
decrease (Lemma 3.7), we know that
1
f (x? ) − f (xt ) ≤ f (xt+1 ) − f (xt ) ≤ − k∇f (xt )k2 ,
2L
and hence the noise can be bounded as follows, using γ = 1/L, multiply-
ing by 2γ and rearranging the terms, we get:
From this, we can derivate a rate in terms of the number of steps re-
quired (T ). Using the inequality ln(1 + x) ≤ x, it follows that after
2
L R L
T ≥ ln ,
µ 2ε
3.9 Exercises
Exercise 20. Let c ∈ Rd . Prove that the spectral norm of c> equals the Euclidean
norm of c, meaning that
|c> x|
max = kck .
x6=0 kxk
111
Exercise 21. Prove Lemma 3.3! (Alternative characterization of smoothness)
Exercise 22. Prove Lemma 3.4: The quadratic function f (x) = x> Qx+b> x+c,
Q symmetric, is smooth with parameter 2 kQk.
(i) Prove that f is strictly convex and differentiable, with a unique global min-
imum x? = 0.
(ii) Prove that for every fixed stepsize γ in gradient descent (3.1) applied to f ,
there exists x0 for which f (x1 ) > f (x0 ).
(iv) Let X ⊆ R be a closed convex set such that 0 ∈ X and X 6= {0}. Prove
that f is not smooth over X.
Exercise 24. In order to obtain average error at most ε in Theorem 3.1, we need
to choose iteration number and stepsize as
2
RB R
T ≥ , γ := √ .
ε B T
If R or B are unknown, we cannot do this.
Suppose now that we know R but not B. This means, we know a concrete
number R such that kx0 − x? k ≤ R; we also know that there exists a number B
such that k∇f (x)k ≤ B for all x, but we don’t know a concrete such number.
Develop an algorithm that—not knowing B—finds a vector x such that f (x)−
f (x? ) < ε, using at most
2 !
RB
O
ε
many gradient descent steps!
Exercise 26. In order to obtain average error at most ε in Theorem 3.8, we need
to choose
1 R2 L
γ := , T ≥ ,
L 2ε
112
if kx0 − x? k ≤ R. If L is unknown, we cannot do this.
Now suppose that we know R but not L. This means, we know a concrete
number R such that kx0 − x? k ≤ R; we also know that there exists a number
L such that f is smooth with parameter L, but we don’t know a concrete such
number.
Develop an algorithm that—not knowing L—finds a vector x such that f (x)−
f (x? ) < ε, using at most 2
R L
O
2ε
many gradient descent steps!
Exercise 27. Let a ∈ R. Prove that f (x) = x4 is smooth over X = (−a, a) and
determine a concrete smoothness parameter L.
Exercise 29. Prove Lemma 3.12! (Strongly convex functions have unique global
minimum)
Exercise 30. Prove Lemma 3.13! (Strongly convex and smooth functions)
113
Chapter 4
Contents
4.1 The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.2 Bounded gradients: O(1/ε2 ) steps . . . . . . . . . . . . . . . . 116
4.3 Smooth convex functions: O(1/ε) steps . . . . . . . . . . . . 117
4.4 Smooth and strongly convex functions: O(log(1/ε)) steps . . 120
4.5 Projecting onto `1 -balls . . . . . . . . . . . . . . . . . . . . . . 122
4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
114
4.1 The Algorithm
Another way to control gradients in (3.5) is to minimize f over a closed
convex subset X ⊆ Rd . For example, we may have a constrained opti-
mization problem to begin with (for example the LASSO in Section 2.6.2),
or we happen to know some region X containing a global minimum x? , so
that we can restrict our search to that region. In this case, gradient descent
also works, but we need an additional projection step. After all, it can hap-
pen that some iteration of (3.1) takes us “into the wild” (out of X) where
we have no business to do. Projected gradient descent is the following
modification. We choose x0 ∈ X arbitrary and for t ≥ 0 define
This means, after each iteration, we project the obtained iterate yt+1 back
to X. This may be very easy (think of X as the unit ball in which case
we just have to scale yt+1 down to length 1 if it is longer). But it may
also be very difficult. In general, computing ΠX (yt+1 ) means to solve an
auxiliary convex constrained minimization problem in each step! Here,
we are just assuming that we can do this. The projection is well-defined:
the squared distance function dy (x) := kx − yk2 is strongly convex, and
hence, a unique minimum over the nonempty closed and convex set X
exists by Exercise 33.
We note that finding an initial x0 ∈ X also reduces to projection (of 0,
for example) onto X.
We will frequently need the following
Part (i) says that the vectors x − ΠX (y) and y − ΠX (y) form an obtuse
angle, and (ii) equivalently says that the square of the long side x − y in
the triangle formed by the three points is at least the sum of squares of the
two short sides; see Figure 4.1.
115
y
α ≥ 90o
α ΠX (y)
X
x
116
Theorem 4.2. Let f : dom(f ) → R be convex and differentiable, X ⊆ dom(f )
closed and convex, x? a minimizer of f over X; furthermore, suppose that kx0 −
x? k ≤ R, and that k∇f (x)k ≤ B for all x ∈ X. Choosing the constant stepsize
R
γ := √ ,
B T
projected gradient descent (4.1) with x0 ∈ X yields
T −1
1X RB
(f (xt ) − f (x? )) ≤ √ .
T t=0 T
Proof. The only required changes to the vanilla analysis are that in steps
(3.3) and (3.4), xt+1 needs to be replaced by yt+1 as this is the real next
(non-projected) gradient descent iterate after these steps; we therefore get
1
gt> (xt − x? ) = γ 2 kgt k2 + kxt − x? k2 − kyt+1 − x? k2 .
(4.3)
2γ
1
gt> (xt − x? ) ≤ γ 2 kgt k2 + kxt − x? k2 − kxt+1 − x? k2
(4.4)
2γ
and return to the previous vanilla analysis for the remainder of the proof.
117
Lemma 4.3. Let f : dom(f ) → R be differentiable and smooth with parameter L
over a closed and convex set X ⊆ dom(f ), according to (4.5). Choosing stepsize
1
γ :=,
L
projected gradient descent (4.1) with arbitrary x0 ∈ X satisfies
1 L
f (xt+1 ) ≤ f (xt ) − k∇f (xt )k2 + kyt+1 − xt+1 k2 , t ≥ 0.
2L 2
More specifically, this already holds if f is smooth with parameter L over the line
segment connecting xt and xt+1 .
Proof. We proceed similar to the proof of the “unconstrained” sufficient
decrease Lemma 3.7, except that we now need to deal with projected gra-
dient descent. We again start from smoothness but then use yt+1 = xt −
∇f (xt )/L, followed by the usual equation 2v> w = kvk2 +kwk2 −kv −wk2 :
L
f (xt+1 ) ≤ f (xt ) + ∇f (xt )> (xt+1 − xt ) + kxt − xt+1 k2
2
L
= f (xt ) − L(yt+1 − xt )> (xt+1 − xt ) + kxt − xt+1 k2
2
L
kyt+1 − xt k2 + kxt+1 − xt k2 − kyt+1 − xt+1 k2
= f (xt ) −
2
L
+ kxt − xt+1 k2
2
L L
= f (xt ) − kyt+1 − xt k2 + kyt+1 − xt+1 k2
2 2
1 L
= f (xt ) − k∇f (xt )k2 + kyt+1 − xt+1 k2 .
2L 2
1 L
k∇f (xt )k2 ≤ f (xt ) − f (xt+1 ) + kyt+1 − xt+1 k2 (4.6)
2L 2
resulting from sufficient decrease (Lemma 4.3) to bound the squared gra-
dient kgt k2 = k∇f (xt )k2 in the vanilla analysis. Unfortunately, (4.6) has
an extra term compared to what we got in the unconstrained case. But we
can compensate for this in the vanilla analysis itself. Let us go back to its
“constrained” version (4.3), featuring yt+1 instead of xt+1 :
1
gt> (xt − x? ) = γ 2 kgt k2 + kxt − x? k2 − kyt+1 − x? k2 .
2γ
Using f (xt ) − f (x? ) ≤ gt> (xt − x? ) from convexity, we have (with γ = 1/L)
that
T −1
X T −1
X
(f (xt ) − f (x? )) ≤ gt> (xt − x? ) (4.8)
t=0 t=0
T −1 T −1
1 X L LX
≤ kgt k2 + kx0 − x? k2 − kyt+1 − xt+1 k2 .
2L t=0 2 2 t=0
119
Plugging this into (4.8), the extra terms cancel, and we arrive—as in the
unconstrained case—at
T
X L
(f (xt ) − f (x? )) ≤ kx0 − x? k2 .
t=1
2
The statement follows as in the proof of Theorem 3.8 from the fact that due
to sufficient decrease (Exercise 32), the last iterate is the best one.
121
4.5 Projecting onto `1-balls
Problems that are `1 -regularized appear among the most commonly used
models in machine learning and signal processing, and we have already
discussed the Lasso as an important example of that class. We will now
address how to perform projected gradient as an efficient optimization for
`1 -constrained problems. Let
n d
X o
d
X = B1 (R) := x ∈ R : kxk1 = |xi | ≤ R
i=1
be the `1 -ball of radius R > 0 around 0, i.e., the set of all points with 1-
norm at most R. Our goal is to compute ΠX (v) for a given vector v, i.e. the
projection of v onto X; see Figure 4.2.
X = B1 (R)
v
ΠX (v)
0 R
At first sight, this may look like a rather complicated task. Geometri-
cally, X is a cross polytope (square for d = 2, octahedron for d = 3), and as
such it has 2d many facets. But we can start with some basic simplifying
observations.
Fact 4.6. We may assume without loss of generality that (i) R = 1, (ii) vi ≥ 0 for
all i, and (iii) di=1 vi > 1.
P
Proof. If we project v/R onto B1 (1), we obtain ΠX (v)/R (just scale Fig-
ure 4.2), so we can restrict to the case R = 1. For (ii), we observe that
122
simultaneously flipping the signs of a fixed subset of coordinates in both
v and x ∈ X yields vectors v0 and x0 ∈ X such that kx − vk = kx0 − v0 k;
thus, x minimizes the distance to v if and only if x0 minimizes the distance
to v0 . Hence, it suffices to compute ΠX (v) for vectors with nonnegative
entries. If di=1 vi ≤ 1, we have ΠX (v) = v and are done, so the interesting
P
case is (iii).
Fact 4.7. Under the assumptions of Fact 4.6, x = ΠX (v) satisfies xi ≥ 0 for all i
and di=1 xi = 1.
P
where
n d
X o
d
∆d := x ∈ R : xi = 1, xi ≥ 0 ∀i
i=1
x?i > 0, i ≤ p,
x?i = 0, i > p.
123
∆d
v
ΠX (v)
0 1
Lemma 4.11. Under the assumption of Fact 4.9, and with p as in Lemma 4.10,
x?i = vi − Θp , i ≤ p,
where p
1 X
Θp = vi − 1 .
p i=1
124
Proof. Again, we argue by contradiction. If not all x?i − vi , i ≤ p have the
same value −Θp , then we have x?i −vi < x?j −vj for some i, j ≤ p. As before,
we can then decrease x?j > 0 by some small positive ε and simultaneously
increase x?i by ε to obtain x ∈ ∆d such that
and we just need to find the right one. In order for candidate x? (p) to
comply with Lemma 4.10, we must have
vp − Θp > 0, (4.13)
and this actually ensures x? (p)i > 0 for all i ≤ p by the assumption of
Fact 4.9 and therefore x? (p) ∈ ∆d . But there could still be several values of
p satisfying (4.13). Among them, we simply pick the one for which x? (p)
minimizes the distance to v. It is not hard to see that this can be done in
time O(d log d), by first sorting v and then carefully updating the values
Θp and kx? (p) − vk2 as we vary p to check all candidates.
But actually, there is an even simpler criterion that saves us from com-
paring distances.
Lemma 4.12. Under the assumption of Fact 4.9, with x? (p) as in (4.12), and
with p
?
1 X
p := max p ∈ {1, . . . , d} : vp − vi − 1 > 0 ,
p i=1
it holds that
argmin kx − vk2 = x? (p? ).
x∈∆d
125
The proof is Exercise 34. Together with our previous reductions, we
obtain the following result.
4.6 Exercises
Exercise 31. Consider the projected gradient descent algorithm as in (4.1) and
(4.2), with a convex differentiable function f . Suppose that for some iteration t,
xt+1 = xt . Prove that in this case, xt is a minimizer of f over the closed and
convex set X!
f (xt+1 ) ≤ f (xt ).
Exercise 33. Let X ⊆ Rd be a nonempty closed and convex set, and let f be
strongly convex over X. Prove that f has a unique minimizer x? over X! In
particular, for X = Rd , we obtain the existence of a unique global minimum.
126
Chapter 5
Coordinate Descent
Contents
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.2 Alternative analysis of gradient descent . . . . . . . . . . . . 128
5.2.1 The Polyak-Łojasiewicz inequality . . . . . . . . . . . 128
5.2.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5.3 Coordinate-wise smoothness . . . . . . . . . . . . . . . . . . 130
5.4 Coordinate descent algorithms . . . . . . . . . . . . . . . . . 131
5.4.1 Randomized coordinate descent . . . . . . . . . . . . 132
5.4.2 Importance Sampling . . . . . . . . . . . . . . . . . . 134
5.4.3 Steepest coordinate descent . . . . . . . . . . . . . . . 135
5.4.4 Greedy coordinate descent . . . . . . . . . . . . . . . 138
5.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
127
5.1 Overview
In large-scale learning, an issue with the gradient descent algorithms dis-
cussed in Chapter 3 is that in every iteration, we need to compute the full
gradient ∇f (xt ) in order to obtain the next iterate xt+1 . If the number of
variables d is large, this can be very costly. The idea of coordinate descent
is to update only one coordinate of xt at a time, and to do this, we only
need to compute one coordinate of ∇f (xt ) (one partial derivative). We ex-
pect this to be by a factor of d faster than computation of the full gradient
and update of the full iterate.
But we also expect to pay a price for this in terms of a higher number of
iterations. In this chapter, we will analyze a number of coordinate descent
variants on smooth and strongly convex functions. It turns out that in
the worst case, the number of iterations will increase by a factor of d, so
nothing is gained (but also nothing is lost).
But under suitable additional assumptions about the function f , coor-
dinate descent variants can actually lead to provable speedups. In prac-
tice, coordinate descent algorithms are popular due to their simplicity and
often good performance.
Much of this chapter’s material is from Karimi at al. [KNS16] and Nu-
tini et al. [NSL+ 15]. As a warm-up, we return to gradient descent.
128
equality) if the following holds for some µ > 0:
1
k∇f (x)k2 ≥ µ(f (x) − f (x? )), ∀ x ∈ Rd . (5.1)
2
The inequality was proposed by Polyak in 1963, and also by Łojasiewicz
in the same year; see Karimi et al. and the references therein [KNS16]. It
says that the squared gradient norm at every point x is at least propor-
tional to the error in objective function value at x. It also directly implies
that every critical point (a point where ∇f (x) = 0) is a minimizer of f .
The interesting result for us is that strong convexity over Rd implies
the PL inequality.
Lemma 5.2 (Strong Convexity ⇒ PL inequality). Let f : Rd → R be dif-
ferentiable and strongly convex with parameter µ > 0 (in particular, a global
minimum x? exists by Lemma 3.12). Then f satisfies the PL inequality for the
same µ.
Proof. Using strong convexity, we get
µ
f (x? ) ≥ f (x) + ∇f (x)> (x? − x) + kx? − xk2
2
µ
≥ f (x) + min ∇f (x) (y − x) + ky − xk2
>
y 2
1
= f (x) − k∇f (x)k2 .
2µ
The latter equation results from solving a convex minimization problem
in y by finding a critical point (Lemma 2.22). The PL inequality follows.
5.2.2 Analysis
We can now easily analyze gradient descent on smooth functions that in
addition satisfy the PL inequality. By Exercise 35, this result also covers
some nonconvex optimization problems.
129
Theorem 5.3. Let f : Rd → R be differentiable with a global minimum x? .
Suppose that f is smooth with parameter L according to (4.5) and satisfies the PL
inequality (5.1) with parameter µ > 0. Choosing stepsize
1
γ= ,
L
gradient descent (3.1) with arbitrary x0 satisfies
µ T
f (xT ) − f (x? ) ≤ 1 − (f (x0 ) − f (x? )), T > 0.
L
Proof. For all t, we have
1
f (xt+1 ) ≤ f (xt ) − k∇f (xt )k2 (sufficient decrease, Lemma 3.7)
2L
µ
≤ f (xt ) − (f (xt ) − f (x? )) (PL inequality (5.1)).
L
If we subtract f (x? ) on both sides, we get
µ
f (xt+1 ) − f (x? ) ≤ 1 − (f (xt ) − f (x? )),
L
and the statement follows.
Li 2
f (x + λei ) ≤ f (x) + λ∇i f (x) + λ ∀x ∈ Rd , λ ∈ R, . (5.2)
2
If Li = L for all i, f is said to be coordinate-wise smooth with parameter L.
130
with the regular smoothness inequality (3.8), when applied to vectors y of
the form y = x + λei .
But we may be able to say more. For example, f (x1 , x2 ) = x21 + 10x22
is smooth with parameter L = 20 (due to the 10x22 term, no smaller value
will do), but f is coordinate-wise smooth with parameter L = (2, 20). So
coordinate-wise smoothness allows us to obtain a more fine-grained pic-
ture of f than smoothness.
There are even cases where the best possible smoothness parameter
is L, but we can choose coordinate-wise smoothness parameters Li (sig-
nificantly) smaller than L for all i. Consider f (x1 , x2 ) = x21 + x22 + M x1 x2
for a constant M > 0. For y = (y, y) and x = 0, smoothness requires
that (M + 2)y 2 = f (y) ≤ L2 kyk2 = Ly 2 , so we need smoothness parameter
L ≥ (M + 2).
On the other hand, f is coordinate-wise smooth with L = (2, 2): fixing
one cordinate, we obtain a univariate function of the form x2 + ax + b. This
is smooth with parameter 2 (use Lemma 3.6 (i) along with the fact that
affine functions are smooth with parameter 0).
Here, ei denotes the i-th unit basis vector in Rd , and λi is a suitable stepsize
for the selected coordinate i. We will focus on the gradient-based choice
of the stepsize as
Here, ∇i f (x) denotes the i-th entry of the gradient ∇f (x), and in this
regime, we refer to γi > 0 as the stepsize.
In the coordinate-wise smooth case, we obtain a variant of sufficient
decrease for coordinate descent.
131
Lemma 5.5. Let f : Rd → R be differentiable and coordinate-wise smooth with
parameter L = (L1 , L2 , . . . , Ld ) according to (5.2). With active coordinate i in
iteration t and stepsize
1
γi = ,
Li
coordinate descent (5.4) satisfies
1
f (xt+1 ) ≤ f (xt ) − |∇i f (xt )|2 .
2Li
Proof. We apply the coordinate-wise smoothness condition (5.2) with λ =
−∇i f (xt )/Li , for which we have xt+1 = xt + λei . Hence
Li 2
f (xt+1 ) ≤ f (xt ) + λ∇i f (xt ) + λ
2
1 1
= f (xt ) − |∇i f (xt )|2 + |∇i f (xt )|2
Li 2Li
1
= f (xt ) − |∇i f (xt )|2 .
2Li
132
If we additionally assume the PL inequality, we can obtain fast conver-
gence as follows.
Theorem 5.6. Let f : Rd → R be differentiable with a global minimum x? .
Suppose that f is coordinate-wise smooth with parameter L according to Defini-
tion 5.4 and satisfies the PL inequality (5.1) with parameter µ > 0. Choosing
stepsize
1
γi = ,
L
randomized coordinate descent (5.5) with arbitrary x0 satisfies
?
µ T
E[f (xT ) − f (x )] ≤ 1 − (f (x0 ) − f (x? )), T > 0.
dL
Comparing this to the result for gradient descent in Theorem 5.3, the
number of iterations to reach optimization error at most ε is by a factor
of d higher. To see this, note that (for µ/L small)
µ µ d
1− ≈ 1− .
L dL
This means, while each iteration of coordinate descent is by a factor of d
cheaper, the number of iterations is by a factor of d higher, so we have a
zero-sum game here. But in the next section, we will refine the analysis
and show that there are cases where coordinate descent will actually be
faster. But first, let’s prove Theorem 5.6.
Proof. By definition, f is coordinate-wise smooth with (L, L, . . . , L), so suf-
ficient decrease according to Lemma 5.5 yields
1
f (xt+1 ) ≤ f (xt ) − |∇i f (xt )|2 .
2L
By taking the expectation of both sides with respect to the choice of i, we
have
d
1 X1
E [f (xt+1 )|xt ] ≤ f (xt ) − |∇i f (xt )|2
2L i=1 d
1
= f (xt ) − k∇f (xt )k2
2dL
µ
≤ f (xt ) − (f (xt ) − f (x? )) (PL inequality (5.1)).
dL
133
In the second line, we conveniently used the fact that the squared Eu-
clidean norm is additive. Subtracting f (x? ) from both sides, we therefore
obtain
?
µ
E[f (xt+1 ) − f (x )|xt ] ≤ 1 − (f (xt ) − f (x? )).
dL
Taking expectations (over xt ), we obtain
?
µ
E[f (xt+1 ) − f (x )] ≤ 1 − E[f (xt ) − f (x? )].
dL
The statement follows.
In the proof, we have used conditional expectations: E [f (xt+1 )|xt ] is a
random variable whose expectation is E [f (xt+1 )].
Li
sample i ∈ [d] with probability Pd
j=1 Lj
1
xt+1 := xt − ∇i f (xt )ei . (5.6)
Li
Here is the result.
Theorem 5.7. Let f : Rd → R be differentiable with a global minimum x? .
Suppose that f is coordinate-wise smooth with parameter L = (L1 , L2 , . . . , Ld )
according to (5.2) and satisfies the PL inequality (5.1) with parameter µ > 0. Let
d
1X
L̄ = Li
d i=1
?
µ T
f (xT ) − f (x ) ≤ 1 − (f (x0 ) − f (x? )), T > 0.
dL
135
This result is a bit disappointing: individual iterations seem to be as
costly as in gradient descent, but the number of iterations is by factor of d
larger. This comparison with Theorem 5.3 is not fully fair, though, since
in contrast to gradient descent, steepest coordinate descent requires only
coordinate-wise smoothness, and as we have seen in Section 5.3, this can
be better than global smoothness. But steepest coordinate descent also
cannot compete with randomized gradient descent (same number of it-
erations, but higher cost per iteration). However, we show next that the
algorithm allows for a speedup in certain cases; also, it may be possible to
efficiently maintain the maximum absolute gradient value throughout the
iterations, so that evaluation of the full gradient can be avoided.
136
to `∞ -norm in the PL inequality. This has to do with convex conjugates,
but we will not go into it here.
?
µ1 T
f (xT ) − f (x ) ≤ 1 − (f (x0 ) − f (x? )), T > 0.
L
Proof. By definition, f is coordinate-wise smooth with (L, L, . . . , L), so suf-
ficient decrease according to Lemma 5.5 yields
1 1
f (xt+1 ) ≤ f (xt ) − |∇i f (xt )|2 = f (xt ) − k∇f (xt )k2∞ ,
2L 2L
by definition of steepest gradient descent. Using the PL inequality (5.9),
we further get
µ1
f (xt+1 ) ≤ f (xt ) − (f (xt ) − f (x? ).
L
Now we proceed as in the alternative analysis of gradient descent: Sub-
tracting f (x? ) from both sides, we obtain
?
µ1
f (xt+1 ) − f (x ) ≤ 1 − (f (xt ) − f (x? )),
L
and the statement follows.
137
5.4.4 Greedy coordinate descent
This is a variant that does not even require f to be differentiable. In each
iteration, we make the step that maximizes the progress in the chosen co-
ordinate. This requires to perform a line search by solving a 1-dimensional
optimization problem:
choose i ∈ [d]
xt+1 := argmin f (xt + λei ) (5.10)
λ∈R
There are cases where the line search can exactly be done analytically,
or approximately by some other means. In the differentiable case, we can
take any of the previously studied coordinate descent variants and replace
some of its steps by greedy steps if it turns out that we can perform line
search along the selected coodinate. This will not compromise the conver-
gence analysis, as stepwise progress can only be better.
Some care is in order when applying the greedy variant in the nondif-
ferentiable case for which the previous variants don’t work. The algorithm
can get stuck in non-optimal points, as for example in the objective func-
tion of Figure 5.1. But not all hope is lost. There are relevant cases where
this scenario does not happen, as we show next.
138
Theorem 5.11. Let f : Rd → R be of the form
X
f (x) := g(x) + h(x) with h(x) = hi (xi ), x ∈ Rd , (5.11)
i
Figure 5.2: The function f (x) := kxk2 + kxk1 . Greedy coordinate descent
cannot get stuck. Figure by Alp Yurtsever & Volkan Cevher, EPFL
139
One very important class of applications here are objective functions of
the form
f (x) + λkxk1 ,
where f is convex and smooth, and h(x) = λkxk1 is a (separable) `1 -
regularization term. The LASSO ( Section 2.6) in its regularized form gives
rise to a concrete such case:
5.5 Summary
Coordinate descent methods are used widely in machine learning appli-
cations. Variants of coordinate methods form the state of the art for the
class of generalized linear models, including linear classifiers and regression
models, as long as separable convex regularizers are used (e.g. `1 -norm or
squared `2 -norm).
The following table summarizes the converegence bounds of coordi-
nate descent algorithms on coordinate-wise smooth and strongly convex
functions (we only use the PL inequality, a consequence of strong convex-
ity). The Bound column contains the factor by which the error is guaran-
teed to decrease in every step.
140
In the best case, Steeper (than Steepest) matches the performance of
gradient descent in terms of iteration count. The algorithm is therefore an
attractive choice for problems where we can obtain (or maintain) the steep-
est coordinate of the gradient efficiently. This includes several practical
case, for example when the gradients are sparse, e.g. because the original
data is sparse.
Importance sampling is attractive when most coordinate-wise smooth-
ness parameters Li are much smaller than the maximum. In the best case,
it can be d times faster than gradient descent. On the downside, applying
the method requires to know all the Li . In the other methods, an upper
bound on all Li is sufficient in order to run the algorithm.
5.6 Exercises
Exercise 35. Provide an example of a nonconvex function that satisfies the PL
inequality 5.1!
Exercise 37. Derive the solution to exact coordinate minimization for the Lasso
problem (5.12), for the i-th coordinate. Write A−i for the n × (d − 1) matrix
obtained by removing the i-th column from A, and same for the vector x−i with
one entry removed accordingly.
Exercise 38. Prove Lemma 5.9, proceeding as in the proof of Lemma 5.2!
141
Chapter 6
Nonconvex functions
Contents
6.1 Smooth functions . . . . . . . . . . . . . . . . . . . . . . . . . 144
6.2 Trajectory analysis . . . . . . . . . . . . . . . . . . . . . . . . 149
6.2.1 Deep linear neural networks . . . . . . . . . . . . . . 150
6.2.2 A simple nonconvex function . . . . . . . . . . . . . . 152
6.2.3 Smoothness along the trajectory . . . . . . . . . . . . 155
6.2.4 Convergence . . . . . . . . . . . . . . . . . . . . . . . 158
6.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
142
So far, all convergence results that we have given for variants of gra-
dient descent have been for convex functions. And there is a good reason
for this: on nonconvex functions, gradient descent can in general not be
expected to come close (in distance or function value) to the global mini-
mum x? , even if there is one.
As an example, consider the nonconvex function from Figure 2.4 (left).
Figure 6.1 shows what happens if we start gradient descent somewhere “to
the right”, with a not too large stepsize so that we do not overshoot. For
any sufficiently large T , the iterate xT will be close to the local minimum
y? , but not to the global minimum x? .
x∗ y∗ x0
143
x0 y∗ x∗ x∗ x0
Figure 6.2: Gradient descent may get stuck in a flat region (saddle point)
y? (left), or reach neither a local minimum nor a saddle point (right).
144
f (x) + ∇f (x)> (y − x) + L2 kx − yk2
f (y)
x y
145
x y
f (x) + ∇f (x)> (y − x)
f (y)
146
So far, we had only equalities, now we start estimating:
147
It is tempting to interpret convergence of k∇f (xt )k2 to 0 as convergence
to a critical point of f (a point where the gradient vanishes). But this inter-
pretation is not fully accurate in general, as Figure 6.2 (right) shows: The
algorithm may enter a region where f asymptotically approaches some
value, without reaching it (think of the rightmost piece of the function in
the figure as f (x) = e−x ). In this case, the gradient converges to 0, but the
iterates are nowhere near a critical point.
Proof. We recall that sufficient decrease (Lemma 3.7) does not require con-
vexity, and this gives
1
f (xt+1 ) ≤ f (xt ) − k∇f (xt )k2 , t ≥ 0.
2L
Rewriting this into a bound on the gradient yields
148
In the smooth setting, gradient descent has another interesting prop-
erty: with stepsize 1/L, it cannot overshoot. By this, we mean that it
cannot pass a critical point (in particular, not the global minimum) when
moving from xt to xt+1 . Equivalently, with a smaller stepsize, no critical
point can be reached. With stepsize 1/L, it is possible to reach a critical
point, as we have demonstrated for the supermodel function f (x) = x2 in
Section 3.7.
x x0 y ? x y ? x0 x x0 = y ?
149
simplified setting that allows us to show the main ideas (and limitations)
behind one particular trajectory analysis [ACGH18].
In our simplified setting, we will look at the task of minimizing a con-
crete and very simple nonconvex function. This function turns out be
smooth along the trajectories that we analyze, and this is one important
ingredient. However, smoothness alone does not suffice to prove con-
vergence to the global minimum, let alone fast convergence: As we have
seen in the last section, we can in general only guarantee that the gradient
norms converge to 0, and at a rather slow rate. To get beyond this, we will
need to exploit additional properties of the function under consideration.
y i ≈ w > xi ,
yi ≈ W xi ,
for a weight matrix W ∈ Rm×d to be learned. The matrix that best fits this
hypothesis on the given observations is the least-squares matrix
n
X
W ? = argmin kW xi − yi k2 .
W ∈Rm×d i=1
If we let X ∈ Rd×n be the matrix whose columns are the xi and Y ∈ Rm×n
the matrix whose columns are the yi , we can equivalently write this as
150
qP
2
where kAkF = i,j aij is the Frobenius norm of a matrix A.
Finding W ∗ (the global minimum of a convex quadratic function) is a
simple task that boils down to solving a system of linear equations; see
also Section 2.4.2. A fancy way of saying this is that we are training a
linear neural network with one layer, see Figure 6.6 (left).
h21
x1
x1 h11 h22
x2
x2 h12 h23 y1
y1 x3
x3 h13 h24 y2
y2 x4
x4 h14 h25
x5
x5 h26
W W1 W2 W3
But what if we have ` layers (Figure 6.6 (right)? Training such a net-
work corresponds to minimizing
kW` W`−1 · · · W1 X − Y k2F ,
over ` weight matrices W1 , . . . , W` to be learned. In case of linear neural
networks, there is no benefit in adding layers, as any linear transforma-
tion x 7→ W` W`−1 · · · W1 X can of course be represented as x 7→ W X with
W := W`−1 · · · W1 . But from a theoretical point of view, a deep linear neu-
ral network gives us a simple playground in which we can try to under-
stand why training deep neural networks with gradient descent works,
151
despite the fact that the objective function is no longer convex. The hope
is that such an understanding can ultimately lead to an analyis of gradient
descent (or other suitable methods) for “real” (meaning non-linear) deep
neural networks.
In the next section, we will discuss the case where all matrices are 1 × 1,
so they are just numbers. This is arguably a toy example in our already
simple playground. Still, it gives rise to a nontrivial nonconvex function,
and the analysis of gradient descent on it will require similar ingredients
as the one on general deep linear neural networks [ACGH18].
What areQthe critical points, the ones where ∇f (x) vanishes? This hap-
pens when k xk = 1 in which case we have a global minimum (level 0
in Figure 6.7). But there are other critical points. Whenever at least two
of the xk are zero, the gradient also vanishes, and the value of f is 1/2 at
such a point (point 0 in Figure 6.7). This already shows that the function
cannot be convex, as for convex functions, every critical point is a global
minimum (Lemma 2.22). It is easy to see that every non-optimal critical
point must have two or more zeros.
152
Figure 6.7: Levels sets of f (x1 , x2 ) = 21 (x1 x2 − 1)2
In fact, all critical points except the global minima are saddle points.
This is because at any such point x, we can slightly perturb the (two or
more) zero entries in such a way that the product of all entries becomes
either positive or negative, so that the function value either decreases or
increases.
Figure 6.8 visualizes (scaled) negative gradients of f for d = 2; these are
the directions in which gradient descent would move from the tails of the
respective arrows. The figure already indicates that it is difficult to avoid
convergence to a global minimum, but it is possible (see Exercise 44).
We now want to Q show that for any dimension d, and from anywhere in
X = {x : x > 0, k xk ≤ 1}, gradient descent will converge to a global
minimum. Unfortunately, our function f is not smooth over X. For the
analysis, we will therefore show that f is smooth along the trajectory of
153
Figure 6.8: Scaled negative gradients of f (x1 , x2 ) = 21 (x1 x2 − 1)2
1
f (xt+1 ) ≤ f (xt ) − k∇f (xt )k2 , t≥0
2L
by Lemma 3.7.
This already shows that gradient descent cannot converge to a saddle
point: all these have (at least two) zero entries and therefore function value
1/2. But for starting point x0 ∈ X, we have f (x0 ) < 1/2, so we can never
reach a saddle while decreasing f .
But doesn’t this mean that we necessarily have to converge to a global
minimum? No, because the sublevel sets of f are unbounded, so it could in
principle happen that gradient descent runs off to infinity while constantly
improving f (xt ) (an example is gradient descent on f (x) = e−x ). Or some
154
other bad behavior occurs (we haven’t characterized what can go wrong).
So there is still something to prove. Q
How about convergence from other starting points? For x > 0, k xk ≥
1, we also get convergence (Exercise 43). But there are also starting points
from which gradient descent will not converge to a global minimum (Ex-
ercise 44).
The following simple lemma is the key to showing that gradient de-
scent behaves nicely in our case.
Definition 6.4. Let x > 0 (componentwise) , and let c ≥ 1 be a real number. x
is called c-balanced if xi ≤ cxj for all 1 ≤ i, j ≤ d.
In fact, any initial iterate x0 > 0 is c-balanced for some (possibly large) c.
Q
Lemma 6.5. Let x > 0 be c-balanced with k xk ≤ 1. Then for any stepsize
γ > 0, x0 := x−γ∇f (x) satisfies x0 ≥ x (componentwise) and is also c-balanced.
If c = 1 (all entries of x are equal), this is easy to see since then also
all entries of ∇f (x) in (6.4) are equal.
Q Later we will show that for suitable
step size, we also maintain that k x0k ≤ 1, so that gradient descent only
goes through balanced iterates.
Q Q
Proof. Set ∆ := −γ( k xk − 1)( k xk ) ≥ 0. Then the gradient descent
update assumes the form
∆
x0k = xk + ≥ xk , k = 1, . . . , d.
xk
For i, j, we have xi ≤ cxj and xj ≤ cxi (⇔ 1/xi ≤ c/xj ). We therefore get
∆ ∆c
x0i = xi + ≤ cxj + = cx0j .
xi xj
155
definition, ∇2 f (x)ij is the j-th partial derivative of the i-th entry of ∇f (x).
This i-th entry is !
Y Y
(∇f )i = xk − 1 xk
k k6=i
156
Proof. The fact that kAk ≤ kAkF is Exercise 45. To bound the Frobenius
norm, we use the previous lemma to compute
!2
Y
∇2 f (x)ii = xi ≤ c2
k6=i
and for i 6= j,
Y Y Y
∇2 f (x)ij ≤ 2 xk xk + xk ≤ 3c2 .
k6=i k6=j k6=i,j
2
Hence, k∇2 f (x)kF ≤ 9d2 c4 . Taking square roots, the statement follows.
This now implies smoothness of f along the whole trajectory of gradi-
ent descent, under the usual “smooth stepsize” γ = 1/L = 1/3dc2 .
Lemma 6.8. Let x > 0 be c-balanced with k xk < 1, L = 3dc2 . Let γ := 1/L.
Q
We already know from Lemma 6.5 that
x0 := x − γ∇f (x) ≥ x
Proof. Image traveling from x to x0 along the line segment. As long as the
product of all variables remains bounded by 1, Hessians remain bounded
by Lemma 6.7, and f is smooth over the part of the segment traveled so
far, by Lemma 6.1. So f can only fail to be smoothQover the whole segment
when there is y 6= x0 on the segment such that k yk = 1. Consider the
first such y. Note that f is still smooth with parameter LQover the segment
connecting x and y. Also, ∇f (x) 6= 0 (due to x > 0, k xk < 1), so x is
not a critical point, and y results from x by a gradient descent step with
stepsize < 1/L (stepsize 1/L takes us toQ x0 ). Hence, y is also not a critical
point by Lemma 6.3, and we can’t have k yk = 1.
Consequently, f is smooth over the whole line segment connecting x
and x0 .
157
6.2.4 Convergence
Theorem
Q 6.9. Let c ≥ 1 and δ > 0 such that x0 > 0 is c-balanced with δ ≤
k (x )
0 k < 1. Choosing stepsize
1
γ= ,
3dc2
gradient descent satisfies
T
δ2
f (xT ) ≤ 1 − 4 f (x0 ), T ≥ 0.
3c
This means that the loss indeed converges to its optimal value 0, and
does so with a fast exponential error decrease. Exercise 46 asks you to
prove that also the iterates themselves converge (to an optimal solution),
so gradient descent will not run off to infinity.
Proof. For each t ≥ 0, f is smooth over conv({xt , xt+1 }) with parameter
L = 3dc2 , hence Lemma 3.7 yields sufficient decrease:
1
f (xt+1 ) ≤ f (xt ) − 2
k∇f (xt )k2 . (6.5)
6dc
Q
For every c-balanced x with δ ≤ k xk ≤ 1, we have
d
!2
X Y
k∇f (x)k2 = 2f (x) xk
i=1 k6=i
!2−2/d
d Y
≥ 2f (x) xk (Lemma 6.6)
c2 k
!2
d Y
≥ 2f (x) 2 xk
c k
d
≥ 2f (x) 2 δ 2 .
c
Then, (6.5) further yields
δ2
1 d 2
f (xt+1 ) ≤ f (xt ) − 2f (xt ) 2 δ = f (xt ) 1 − 4 ,
6dc2 c 3c
proving the theorem.
158
This looks great: just as for strongly convex functions, we seem to have
fast convergence since the function value goes down by a constant factor
in each step. There is a catch, though. To see this, consider the starting
solution x0 = (1/2, . . . , 1/2). This is c-balanced with c = 1, but the δ that
we get is 1/2d . Hence, the “constant factor” is
1
1− ,
3 · 4d
159
6.3 Exercises
Exercise 40. Let f : dom(f ) → R be convex and twice differentiable, with
X ⊆ dom(f ) an open convex set, and suppose that f is smooth with parameter
L over X. Prove that under these conditions, k∇2 f (x)k ≤ L for all x ∈ X, where
k·k is the spectral norm.
Exercise 41. Prove that the statement of Theorem 6.2 implies that
Exercise 42. Prove Lemma 6.3 (gradient descent does not overshoot on smooth
functions).
Q 2
d
Exercise 43. Consider the function f (x) = 12 k=1 x k − 1 . Prove that for
any starting point x0 ∈ X = {x ∈ Rd : x > 0, k xk ≥ 1} and any ε > 0,
Q
gradient descent attains f (xT ) ≤ ε for some iteration T .
Q 2
1 d
Exercise 44. Consider the function f (x) = 2 k=1 xk − 1 . Prove that for
even dimension d ≥ 2, there is a point x0 (not a critical point) such that gradient
descent does not converge to a global minimum when started at x0 , regardless of
step size(s).
Exercise 45. Prove that for any matrix A, kAk ≤ kAkF , where k·k is the spectral
norm and k·kF the Frobenius norm.
Exercise 46. Prove that the sequence (xT )T ≥0 of iterates in Theorem 6.9 con-
verges to a an optimal solution x? .
160
Chapter 7
Contents
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
7.2 The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.3 On linear minimization oracles . . . . . . . . . . . . . . . . . 165
7.3.1 LASSO and the `1 -ball . . . . . . . . . . . . . . . . . . 165
7.3.2 Semidefinite Programming and the Spectahedron . . 166
7.4 Duality gap — A certificate for optimization quality . . . . . 167
7.5 Convergence in O(1/ε) steps . . . . . . . . . . . . . . . . . . . 168
7.5.1 Convergence analysis for γt = 2/(t + 2) . . . . . . . . 169
7.5.2 Stepsize variants . . . . . . . . . . . . . . . . . . . . . 170
7.5.3 Affine invariance . . . . . . . . . . . . . . . . . . . . . 171
7.5.4 The curvature constant . . . . . . . . . . . . . . . . . . 172
7.5.5 Convergence in duality gap . . . . . . . . . . . . . . . 174
7.6 Sparsity, extensions and use cases . . . . . . . . . . . . . . . . 175
7.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
161
7.1 Overview
As constrained optimization problems do appear often in practice, we will
give them a second look here. We again consider problems of the form
minimize f (x)
(7.1)
subject to x ∈ X,
f (x)
x
X ✓ Rd
<latexit sha1_base64="lA5r741TZdGyssowL328g73wxGg=">AAAFUnicddRBb9MwFABgd2thlME6OHKxqJA4oMqp1lFuE2MSF8SoSFepKZXtOF20JA62066L8ku4wk/iwG/hgtMWsbwyS4ms9z4/O45llkahNoT8qu3s1hv37u89aD7cf/T4oHX4ZKhlprhwuYykGjGqRRQmwjWhicQoVYLGLBIX7Oq0zF/MhdKhTD6bZSomMZ0lYRByamxo2joYeTpjWhjxFXuDL/601SYdctw7cvqYdHrE6Ts92+n2HEK62OmQVWujTTufHtZfeb7kWSwSwyOq9dghqZnkVJmQR6JoepkWKeVXdCbGtpvQWOhJvlp5gV/YiI8DqeyTGLyK3h6R01jrZcysjKm51DBXBv+XG2cm6E/yMEkzIxK+nijIImwkLrcB+6ES3ERL26FchXatmF9SRbmxm9Vseu+E/RglPtjCH1OhqJEq97hM5kW+et8h7G8o8vJlSyRiwWUc08TPvUGRe+UiGcsHRYFxNXv2L3tWwKHUTukxGfnlPsgop1ZUAAOAQcAB4BD4APgQCAAEBAEAAQQzAGYQxADEEKQApBBoADQEGQAZBHMA5hAsAFhAcA3ANQRLAJYQ3ABws3Ug3LgqXFhiCMBwqwSpAgIrhH4VeKE0dKvKXHLKNkeX0/U81YMnVXorf2rz9n75e4nguztut/Om43w6ap+83Vw0e+gZeo5eIge9RifoPTpHLuIoQ9/Qd/Sj/rP+u1Fr7K7pTm0z5imqtMb+H4RY72I=</latexit>
The only algorithm we have discussed for this case was projected gra-
dient descent in Chapter 4. This comes with a clear downside that pro-
jections onto a set X can sometimes be very complex to compute, even in
cases when the set is convex. Would it still be possible to solve constrained
optimization problems using a gradient-based algorithm, but without any
projection steps?
From a different perspective, coordinate descent, as we have discussed
in Chapter 5, had the attractive advantage that it only modified one coor-
dinate in every step, keeping all others unchanged. Yet, it is not applicable
in the general constrained case, as we can not easily know when a coordi-
nate step would exit the constraint set X (except in easy cases when X is
defined as a product of intervals). Is there a coordinate-like algorithm also
for general constraint sets X?
It turns out the answer to both previous questions is yes. The algorithm
was discovered by Marguerite Frank and Philip Wolfe in 1956 [FW56],
162
giving rise to the name of the method. Historically, the motivation for
the method was different from the two aspects mentioned above. After
the second world war, linear programming (that is to minimize a linear
function over set of linear constraints) had significant impact for many in-
dustrial applications (e.g. in logistics). Given these successes with linear
objectives, Marguerite Frank and Philip Wolfe studied if similar methods
could be generalized to non-linear objectives (including quadratic as well
as general objectives), that is problems of the form (7.1).
is any minimizer of the linear function g> z over X. We will assume that
a minimizer exists whenever we apply the oracle. If X is closed and
bounded, this is guaranteed.
The Frank-Wolfe algorithm proceeds iteratively, starting from an initial
feasible point x0 ∈ X, using a (time-dependent) stepsize γt ∈ [0, 1].
163
f
f (x)
s x
X ✓ Rd
<latexit sha1_base64="lA5r741TZdGyssowL328g73wxGg=">AAAFUnicddRBb9MwFABgd2thlME6OHKxqJA4oMqp1lFuE2MSF8SoSFepKZXtOF20JA62066L8ku4wk/iwG/hgtMWsbwyS4ms9z4/O45llkahNoT8qu3s1hv37u89aD7cf/T4oHX4ZKhlprhwuYykGjGqRRQmwjWhicQoVYLGLBIX7Oq0zF/MhdKhTD6bZSomMZ0lYRByamxo2joYeTpjWhjxFXuDL/601SYdctw7cvqYdHrE6Ts92+n2HEK62OmQVWujTTufHtZfeb7kWSwSwyOq9dghqZnkVJmQR6JoepkWKeVXdCbGtpvQWOhJvlp5gV/YiI8DqeyTGLyK3h6R01jrZcysjKm51DBXBv+XG2cm6E/yMEkzIxK+nijIImwkLrcB+6ES3ERL26FchXatmF9SRbmxm9Vseu+E/RglPtjCH1OhqJEq97hM5kW+et8h7G8o8vJlSyRiwWUc08TPvUGRe+UiGcsHRYFxNXv2L3tWwKHUTukxGfnlPsgop1ZUAAOAQcAB4BD4APgQCAAEBAEAAQQzAGYQxADEEKQApBBoADQEGQAZBHMA5hAsAFhAcA3ANQRLAJYQ3ABws3Ug3LgqXFhiCMBwqwSpAgIrhH4VeKE0dKvKXHLKNkeX0/U81YMnVXorf2rz9n75e4nguztut/Om43w6ap+83Vw0e+gZeo5eIge9RifoPTpHLuIoQ9/Qd/Sj/rP+u1Fr7K7pTm0z5imqtMb+H4RY72I=</latexit>
and makes a step into the direction of the minimizer; see Figure 7.2.
164
7.3 On linear minimization oracles
The algorithm is particularly useful for cases when the constraint set X can
be described as a convex hull of a finite or otherwise “nice” set of points
A, formally conv(A) = X. We call A the atoms describing the constraint
set.
In this case, a solution to the linear subproblem LMOX defined in (7.2)
is always attained by anPatom a ∈ A. Indeed, every s ∈ Pnconv(X) is a
n
convex combination s = i=1 λi ai of finitely many atoms ( i=1 λi = 1, all
λi nonnegative). It follows that for every g, there is always an atom such
that g> s ≥ a> >
i g. Hence, if s minimizes g z, then there is also an atomic
minimizer.
This allows us to significantly reduce the candidate solutions for the
step directions used by the Frank-Wolfe algorithm. (Note that subprob-
lem (7.2) might still have optimal solutions which are not atoms, but there
is always at least one atomic solution LMOX (g) ∈ A).
The set A = X is a valid (but not too useful) set of atoms. The “opti-
mal” set of atoms is the set of extreme points. A point x ∈ X is extreme if
x 6∈ conv(X \ {x}). Such an extreme point must be in every set of atoms,
but not every atom must be extreme. All that we require for A to be a set
of atoms is that conv(A) = X.
We give two interesting examples next.
165
vectors and their negatives):
So we only have to look at the vector g and identify its largest coordinate
(in absolute value). This operation is of course significantly more efficient
than projection onto an `1 -ball. The latter we have analyzed in Section 4.5
and have shown a more sophisticated algorithm that still did not have
runtime linear in the dimension.
166
sired convex combination of atoms. We remark that ai is a (unit length)
eigenvector of Z w.r.t. eigenvalue λi .
Lemma 7.1. Let λ1 be the smallest eigenvalue of G, and let s1 be a corresponding
eigenvector of unit length. Then we can choose LMOX (G) = s1 s> 1.
The second equality follows from G • zz> = z> Gz for all z (simple rewrit-
ing), and the last equality is a standard result from linear algebra that can
be proved via elementary calculations, involving diagonalization of G.
Now, s1 is easily seen to attain the last minimum, hence s1 s>
1 attains the
>
first minimum, and LMOX (G) = s1 s1 follows.
167
f
f (x)
g(x)
s x
X ✓ Rd
<latexit sha1_base64="lA5r741TZdGyssowL328g73wxGg=">AAAFUnicddRBb9MwFABgd2thlME6OHKxqJA4oMqp1lFuE2MSF8SoSFepKZXtOF20JA62066L8ku4wk/iwG/hgtMWsbwyS4ms9z4/O45llkahNoT8qu3s1hv37u89aD7cf/T4oHX4ZKhlprhwuYykGjGqRRQmwjWhicQoVYLGLBIX7Oq0zF/MhdKhTD6bZSomMZ0lYRByamxo2joYeTpjWhjxFXuDL/601SYdctw7cvqYdHrE6Ts92+n2HEK62OmQVWujTTufHtZfeb7kWSwSwyOq9dghqZnkVJmQR6JoepkWKeVXdCbGtpvQWOhJvlp5gV/YiI8DqeyTGLyK3h6R01jrZcysjKm51DBXBv+XG2cm6E/yMEkzIxK+nijIImwkLrcB+6ES3ERL26FchXatmF9SRbmxm9Vseu+E/RglPtjCH1OhqJEq97hM5kW+et8h7G8o8vJlSyRiwWUc08TPvUGRe+UiGcsHRYFxNXv2L3tWwKHUTukxGfnlPsgop1ZUAAOAQcAB4BD4APgQCAAEBAEAAQQzAGYQxADEEKQApBBoADQEGQAZBHMA5hAsAFhAcA3ANQRLAJYQ3ABws3Ug3LgqXFhiCMBwqwSpAgIrhH4VeKE0dKvKXHLKNkeX0/U81YMnVXorf2rz9n75e4nguztut/Om43w6ap+83Vw0e+gZeo5eIge9RifoPTpHLuIoQ9/Qd/Sj/rP+u1Fr7K7pTm0z5imqtMb+H4RY72I=</latexit>
168
7.5.1 Convergence analysis for γt = 2/(t + 2)
Theorem 7.3. Consider the constrained minimization problem (7.1) where f :
Rd → R is convex and smooth with parameter L, and X is convex, closed
and bounded (in particular, a minimizer x? of f over X exists, and all linear
minimization oracles have minimizers). With any x0 ∈ X, and with stepsizes
γt = 2/(t + 2), the Frank-Wolfe algorithm yields
2L diam(X)2
f (xT ) − f (x? ) ≤ , T ≥ 1,
T +1
where diam(X) := maxx,y∈X kx − yk is the diameter of X (which exists since X
is closed and bounded).
The following descent lemma forms the core of the convergence proof:
Lemma 7.4. For a step xt+1 := xt + γt (s − xt ) with stepsize γt ∈ [0, 1], it holds
that
L
f (xt+1 ) ≤ f (xt ) − γt g(xt ) + γt2 ks − xt k2 ,
2
where s = LMOX (∇f (xt )).
Proof. From the definition of smoothness of f , we have
f (xt+1 ) = f (xt + γt (s − xt ))
L
≤ f (xt ) + ∇f (xt )> γt (s − xt ) + γt2 ks − xt k2 (7.11)
2
L
= f (xt ) − γt g(xt ) + γt2 ks − xt k2 ,
2
using the definition (7.9) of the duality gap.
Proof of Theorem 7.3. Writing h(x) := f (x) − f (x? ) for the (unknown) op-
timization gap at point x, und using the certificate property (7.10) of the
duality gap, that is h(x) ≤ g(x), Lemma 7.4 implies that
L
h(xt+1 ) ≤ h(xt ) − γt g(xt ) + γt2 ks − xt k2
2
L
≤ h(xt ) − γt h(xt ) + γt2 ks − xt k2
2
L
= (1 − γt )h(xt ) + γt2 ks − xt k2
2
2
≤ (1 − γt )h(xt ) + γt C, (7.12)
169
where C := L2 diam(X)2 .
The convergence proof finishes by induction. Exercise 47 asks you to
2
prove that for γt = t+2 , we obtain
4C
h(xt ) ≤ , t ≥ 1.
t+1
Line search stepsize. Here, γt ∈ [0, 1] is chosen such that the progress in
f -value (and hence also in h-value) is maximized,
γt := argmin f (1 − γ)xt + γs .
γ∈[0,1]
Let yt+1 be the iterate obtained from xt with the standard stepsize µt .
From (7.12) and the definition of γt , we obtain the desired inequality
h(xt+1 ) ≤ h(yt+1 ) ≤ (1 − µt )h(xt ) + µ2t C. (7.13)
Gap-based stepsize. This chooses γt such that the right-hand side in the
first line of (7.12) is minimized. A simple calculation shows that this results
in
g(xt )
γt := min ,1 .
L ks − xt k2
Now we establish (7.13) as follows:
L
h(xt+1 ) ≤ h(xt ) − γt g(xt ) + γt2 ks − xt k2
2
L
≤ h(xt ) − µt g(xt ) + µ2t ks − xt k2
2
L
≤ h(xt ) − µt h(xt ) + µ2t ks − xt k2
2
2
≤ (1 − µt )h(xt ) + µt C.
170
Directly plugging in the definition of γt yields
2L diam(X)2
f (xT ) − f (x? ) ≤ ,
T +1
is in some sense bad. Consider the problem of minimizing f (x1 , x2 ) =
x21 + x22 over the unit square X = {(x1 , x2 ) : 0 ≤ x1 ≤ 1, 0 ≤ x2 ≤ 1}. The
function f (the two-dimensional supermodel) is smooth with L = 2, and
diam(X)2 = 2. Next consider f 0 (x1 , x2 ) = x21 + (10x2 )2 over the rectangle
X 0 = {(x1 , x2 ) : 0 ≤ x1 ≤ 1, 0 ≤ x2 ≤ 1/10}. The function f 0 is smooth with
L0 = 200, and diam(X 0 )2 = 1 + 1/100. Hence, our convergence analysis
seems to suggest that the error after T steps of the Frank-Wolfe algorithm
on f 0 over X 0 is roughly 100 times larger than on f over X.
In reality, however, there is no such difference. The reason is that the
two problems (f, X) and (f 0 , X 0 ) are equivalent under rescaling of vari-
able x2 , and the Frank-Wolfe algorithm is invariant under this and more
generally all affine transformations of space. Figure 7.4 depicts the two
problems (f, X) and (f 0 , X 0 ) from our example above.
To argue about the affine invariance formally, we call two problems
(f, X) and (f 0 , X 0 ) affinely equivalent if f 0 (x) = f (Ax+b) for some invertible
matrix A and some vector b, and X 0 = {A−1 (x − b) : x ∈ X}. The equiva-
lence is that x ∈ X with function value f (x) if and only if x0 = A−1 (x−b) ∈
X 0 with the same function value f 0 (x0 ) = f (AA−1 (x − b) + b) = f (x). We
call x0 the vector corresponding to x. In Figure 7.4, we have
1 0
A= , b = 0.
0 10
171
Figure 7.4: Two optimization problems (f, X) and (f 0 , X 0 ) that are equiva-
lent under an affine transformation.
where c is some constant, the linear minimization oracle in (b) returns the
step direction s0 = A−1 (s − b) ∈ X 0 corresponding to the step direction s ∈
X in (a). It follows that also the next iterates in (a) and (b) will correspond
to each other and have the same function values. In particular, after any
number of steps, both (a) and (b) will incur the same optimization error.
172
transformations, unlike the bound of Theorem 7.3. For this, we define
a curvature constant of the constrained optimization problem (7.1). The
quantity serves as a combined notion of complexity of both the objective
function f and the constraint set X:
1 >
C(f,X) := sup f (y) − f (x) − ∇f (x) (y − x) . (7.15)
x,s∈X,γ∈(0,1] γ2
y=(1−γ)x+γs
4C(f,X)
f (xT ) − f (x? ) ≤ , T ≥ 1.
T +1
Proof. The crucial step is to prove the following version of (7.11):
After this, we can follow the remainder of the proof of Theorem 7.3, with
C(f,X) instead of C = L2 diam(X)2 . To show (7.16), we use
173
and rewrite the definition of the curvature constant (7.15) to get
Lemma 7.6 (Exercise 48). Let f be a convex function which is smooth with
parameter L over X. Then
L
C(f,X) ≤ diam(X)2 .
2
27/2 · C(f,X)
g(xt ) ≤
T +1
Still, compared to our previous theorem, the convergence of the gap
here is a stronger and more useful result, because g(xt ) is easy to compute
in any iteration of the Frank-Wolfe algorithm, and as we have seen in (7.10)
serves as an upper bound (certificate) to the unknown primal error, that is
f (xt ) − f (x? ) ≤ g(xt ).
The proof of the theorem is left as Exercise 49, and is difficult. The
argument leverages that not all gaps can be small, and will again crucially
rely on the descent Lemma 7.4.
174
7.6 Sparsity, extensions and use cases
A very important feature of the Frank-Wolfe algorithm has been pointed
out before, but we would like to make it explicit here. Consider the con-
vergence bound of Theorem 7.5,
4C(f,X)
f (xT ) − f (x? ) ≤ , T ≥ 1.
T +1
This means that O(1/ε) many iterations are sufficent to obtain optimality
gap at most ε. At this time, the current solution is a convex combination of
x0 and O(1/ε) many atoms of the constraint set X. Thinking of ε as a con-
stant (such as 0.01), this means that constantly many atoms are sufficient in
order to get an almost optimal solution. This is quite remarkable, and it
connects to the notion of coresets in computational geometry. A coreset is a
small subsets of a given set of objects that is representative (with respect to
some measure) for the set of all objects. Some algorithms for finding small
coresets are inspired by the Frank-Wolfe algorithm [Cla10].
The algorithm and analysis above can be extended to several settings,
including
• Approximate LMO, that is we can allow a linear minimization oracle
which is not exact but is of a certain additive or multiplicative ap-
proximation quality for the subproblem (7.2). Convergence bounds
are essentially as in the exact case [Jag13].
• Randomized LMO, that is that the LMOX solves the linear minimiza-
tion oracle only over a random subset of X. Convergence in O(1/ε)
steps still holds [KPd18].
• Stochastic LMO, that is LMOX is fed with a stochastic gradient instead
of the true gradient [HL20].
• Unconstrained problems. This is achieved by considering growing ver-
sions of a constraint set X. For instance when X is an `1 -norm ball,
the algorithm will become similar to popular steepest coordinate
methods as we have discussed in Section 5.4.3. In this case, the
resulting algorithms are also known as matching-pursuit, and are
widely used in the literature on sparse recovery of a signal, also
known as compressed sensing. For more details, we refer the reader
to [LKTJ17].
175
The Frank-Wolfe algorithm and its variants have many popular use-
cases. The most attractive uses are for constraint sets X where a projection
step bears significantly more computational cost compared to solving a
linear problem over X. Some examples of such sets include:
• Lasso and other L1-constrained problems, as discussed in Section 7.3.1.
• Matrix Completion. For several low-rank approximation problems,
including matrix completion as in recommender systems, the Frank-
Wolfe algorithm is a very scalable algorithm, and has much lower
iteration cost compared to projected gradient descent. For a more
formal treatment, see Exercise 50.
• Relaxation of combinatorial problems, where we would like to opti-
mize over a discrete set A (e.g. matchings, network flows etc). In
this case, the Frank-Wolfe algorithm is often used together with early
stopping, in order to achieve a good iterate xt being a combination
of at most t of the original points A.
Many of these applications can also be written as constraint sets of the
form X := conv(A) for some set of atoms A, as illustrated in the following
table:
Examples A |A| dim. LMOX (g)
L1-ball {±ei } 2d d ±ei with argmaxi |gi |
Simplex {ei } d d ei with argmini gi
Spectahedron {xx> , kxk = 1} ∞ d2 argminkxk=1 x> Gx
Norms {x, kxk ≤ 1} ∞ d argmin hs, gi
s,ksk≤1
Nuclear norm {Y, kY k∗ ≤ 1} ∞ d2 ..
Wavelets .. ∞ ∞ ..
7.7 Exercises
Exercise 47 (Induction for the Frank-Wolfe convergence analysis). Given
some constant C > 0 and a sequence of real values h0 , h1 , . . . satisfying (7.12),
i.e.
ht+1 ≤ (1 − γt )ht + γt2 C for t = 0, 1, . . .
176
2
for γ = t+2
, prove that
4C
ht ≤ for t ≥ 1.
t+1
Exercise 48 (Relating Curvature and Smoothness). Prove Lemma 7.6:
where the optimization domain X is the set of matrices in the unit ball of the trace
norm (or nuclear norm), which is defined the convex hull of the rank-1 matrices
n o
> u∈Rn , kuk2 =1
X := conv(A) with A := uv v∈Rm , kvk =1 .
2
Here Ω ⊆ [n] × [m] is the set of observed entries from a given data matrix Z
(collecting the ratings given by users to items for example).
1. Derive the LMOX for this set X for a gradient at iterate Y ∈ Rn×m .
2. Derive the projection step onto X. How do the LMOX and the projection
step compare, in terms of computational cost?
177
Chapter 8
Newton’s Method
Contents
8.1 1-dimensional case . . . . . . . . . . . . . . . . . . . . . . . . 179
8.2 Newton’s method for optimization . . . . . . . . . . . . . . . 181
8.3 Once you’re close, you’re there. . . . . . . . . . . . . . . . . . . 183
8.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
178
8.1 1-dimensional case
The Newton method (or Newton-Raphson method, invented by Sir Isaac
Newton and formalized by Joseph Raphson) is an iterative method for
finding a zero of a differentiable univariate function f : R → R. Starting
from some number x0 , it computes
f (xt )
xt+1 := xt − , t ≥ 0. (8.1)
f 0 (xt )
Figure 8.1 shows what happens. xt+1 is the point where the tangent line
to the graph of f at (xt , f (xt )) intersects the x-axis. In formulas, xt+1 is the
solution of the linear equation
f (x)
xt xt+1
The Newton step (8.1) obviously fails if f 0 (xt ) = 0 and may get out of
control if |f 0 (xt )| is very small. Any theoretical analysis will have to make
suitable assumptions to avoid this. But before going into this, we look at
Newton’s method in a benign case.
179
√ √
Let f (x) = x2 − R, where R ∈ R+ . f has two zeros, √ R and − R.
Starting for example at x0 = R, we hope to converge to R quickly. In this
case, (8.1) becomes
x2t − R
1 R
xt+1 = xt − = xt + . (8.2)
2xt 2 xt
This is in fact the Babylonian method to compute square roots, and here we
see that it is just a special case of Newton’s method. √
Can we prove that we indeed quickly converge to R? What we im-
mediately see from (8.2) is that all iterates will be positive and hence
1 R xt
xt+1 = xt + ≥ .
2 xt 2
√
So we cannot be too fast. Suppose R ≥ 1. In order to even get xt < 2 R,
we need at least T ≥ log(R)/2 steps. It√turns out that the Babylonian
method starts taking off only when xt − R < 1/2, say (Exercise 51 asks
you to prove that it takes O(log R) steps to get there).√
√ let us now suppose that x0 − R < 1/2, so we are
To watch takeoff,
starting close to R already. We rewrite (8.2) as
√ xt R √ 1 √ 2
xt+1 − R = + − R= xt − R . (8.3)
2 2xt 2xt
√
Assuming for now that R ≥ 1/4, all iterates have value at least R ≥
1/2, hence we get
√ √ 2
xt+1 − R ≤ xt − R .
This means that the error goes to 0 quadratically, and
2T
√ √ 2T 1
xT − R ≤ x0 − R < , T ≥ 0. (8.4)
2
√
What does this tell us? In order to get xT − R < ε, we only √ need
1
T = log log( ε ) steps! Hence, it takes a while to get to roughly R, but
from there, we achieve high accuracy very fast.
Let us do a concrete example of the practical behavior (on a computer
with IEEE√ 754 double arithmetic). If R = 1000, the method takes
√ 7 steps to
get x7 − 1000 < 1/2, and then 3 more steps to get x13 equal to 1000 up to
the machine precision (53 binary digits). In this last phase, we essentially
double the number of correct digits in each iteration!
180
8.2 Newton’s method for optimization
Suppose we want to find a global minimum x? of a differentiable con-
vex function f : R → R (assuming that a global minimum exists). Lem-
mata 2.22 and 2.23 guarantee that we can equivalently search for a zero of
the derivative f 0 . To do this, we can apply Newton’s method if f is twice
differentiable; the update step then becomes
f 0 (xt )
xt+1 := xt − = xt − f 00 (xt )−1 f 0 (xt ), t ≥ 0. (8.5)
f 00 (xt )
There is no reason to restrict to d = 1. Here is Newton’s method for min-
imizing a convex function f : Rd → R. We choose x0 arbitrarily and then
iterate:
xt+1 := xt − ∇2 f (xt )−1 ∇f (xt ), t ≥ 0. (8.6)
The update vector ∇2 f (xt )−1 ∇f (xt ) is the result of a matrix-vector mul-
tiplication: we invert the Hessian at xt and multiply the result with the
gradient at xt . As before, this fails if the Hessian is not invertible, and may
get out of control if the Hessian has small norm.
We have introduced iteration (8.6) simply as a (more or less natural)
generalization of (8.5), but there’s more to it. If we consider (8.6) as a
special case of a general update scheme
xt+1 = xt − H(xt )∇f (xt ),
where H(xt ) ∈ Rd×d is some matrix, then we see that also gradient de-
scent (3.1) is of this form, with H(xt ) = γI. Hence, Newton’s method can
also be thought of as “adaptive gradient descent” where the adaptation is
w.r.t. the local geometry of the function at xt . Indeed, as we show next,
this allows Newton’s method to converge on all nondegenerate quadratic
functions in one step, while gradient descent only does so with the right
stepsize on “beautiful” quadratic functions whose sublevel sets are Eu-
clidean balls (Exercise 30).
Lemma 8.1. A nondegenerate quadratic function is a function of the form
1
f (x) = x> M x − q> x + c,
2
d×d
where M ∈ R is an invertible symmetric matrix, q ∈ Rd , c ∈ R. Let x? =
M −1 q be the unique solution of ∇f (x) = 0 (the unique global minimum if f is
convex). With any starting point x0 ∈ Rd , Newton’s method (8.6) yields x1 = x? .
181
Proof. We have ∇f (x) = M x − q (this implies x? = M −1 q) and ∇2 f (x) =
M . Hence,
g g −1
Nf ◦g
yt yt+1
182
Hence, while gradient descent suffers if the coordinates are at very dif-
ferent scales, Newton’s method doesn’t.
We conclude the general exposition with another interpretation of New-
ton’s method: each step minimizes the local second-order Taylor approxi-
mation.
1
xt+1 = argmin f (xt ) + ∇f (xt )> (x − xt ) + (x − xt )> ∇2 f (xt )(x − xt ).
x∈Rd 2
183
a step size to (8.6) and always making only steps that decrease the function
value (which may not happen under the full Newton step).
An alternative is to use gradient descent to get us sufficiently close to
the global minimum, and then switch to Newton’s method for the rest. In
Chapter 3, we have seen that under favorable conditions, we may know
when gradient descent has taken us close enough.
In practice, Newton’s method is often (but not always) much faster
than gradient descent in terms of the number of iterations. The price to pay
is a higher iteration cost, since we need to compute (and invert) Hessians.
After this disclaimer, let us state the main result right away. We follow
Vishnoi [Vis15], except that we do not require convexity.
Theorem 8.4. Let f : dom(f ) → R be twice differentiable with a critical
point x? . Suppose that there is a ball X ⊆ dom(f ) with center x? such that
the following two properties hold.
(i) Bounded inverse Hessians: There exists a real number µ > 0 such that
1
k∇2 f (x)−1 k ≤ , ∀x ∈ X.
µ
In both cases, the matrix norm is the spectral norm defined in Lemma 3.6. Prop-
erty (i) in particular stipulates that Hessians are invertible at all points in X.
Then, for xt ∈ X and xt+1 resulting from the Newton step (8.6), we have
B
kxt+1 − x? k ≤ kxt − x? k2 .
2µ
As an example, let us consider a nondegenerate quadratic function f
(constant Hessian M = ∇2 f (x) for all x; see Lemma 8.1). Then f has ex-
actly one critical point x? . Property (i) is satisfied with µ = 1/kM −1 k over
X = Rd ; property (ii) is satisfied for B = 0. According to the statement of
the theorem, Newton’s method will thus reach x? after one step—which
we already know from Lemma 8.1.
In general, there could be several critical points for which properties
(i) and (ii) hold, and it may seem surprising that the theorem makes a
184
statement about all of them. But in fact, if xt is far away from such a
critical point, the statement allows xt+1 to be even further away from it; we
cannot expect to make progress towards all critical points simultaneously.
The theorem becomes interesting only if we are very close to some critical
point. In this case, we will actually converge to it. In particular, this critical
point is then isolated and the only one nearby, so that Newton’s method
cannot avoid getting there.
Corollary 8.5 (Exercise 53). With the assumptions and terminology of Theo-
rem 8.4, and if x0 ∈ X satisfies
µ
kx0 − x? k ≤ ,
B
then Newton’s method (8.6) yields
2T −1
? µ 1
kxT − x k ≤ , T ≥ 0.
B 2
Hence, we have a bound as (8.4) for the last phase of the Babylonian
method: in order to get kxT − x? k < ε, we only need T = log log( 1ε ) steps.
But before this fast behavior kicks in, we need to be µ/B-close to x? al-
ready. The fact that x0 is this close to only one critical point necessarily
follows.
An intuitive reason for a unique critical point near x0 (and for fast con-
vergence to it) is that under our assumptions, the Hessians we encounter
are almost constant when we are close to x? . This means that locally, our
function behaves almost like a nondegenerate quadratic function which
has truly constant Hessians and allows Newton’s method to convergence
to its unique critical point in one step (Lemma 8.1).
Lemma 8.6 (Exercise 54). With the assumptions and terminology of Theorem 8.4,
and if x0 ∈ X satisfies
µ
kx0 − x? k ≤ ,
B
then the Hessians in Newton’s method satisfy the relative error bound
2t −1
k∇2 f (xt ) − ∇2 f (x? )k 1
≤ , t ≥ 0.
k∇2 f (x? )k 2
185
We now still owe the reader the proof of the main convergence result,
Theorem 8.4:
Proof of Theorem 8.4. To simplify notation, let us abbreviate H := ∇2 f , x =
xt , x0 = xt+1 . Subtracting x? from both sides of (8.6), we get
x0 − x? = x − x? − H(x)−1 ∇f (x)
= x − x? + H(x)−1 (∇f (x? ) − ∇f (x))
Z 1
? −1
= x − x + H(x) H(x + t(x? − x))(x? − x)dt.
0
The last step, which applies the fundamental theorem of calculus, needs
some explanations. In fact, we have applied it to each component hi (t) of
the vector-valued function h(t) = ∇f (x + t(x? − x)):
Z 1
hi (1) − hi (0) = h0i (t), i = 1, . . . , d.
0
where h0 (t) has components h01 (t), . . . , h0d (t), and the integral is also under-
∂f
stood componentwise. Furthermore, as hi (t) = ∂x i
(x + t(x? − x)), the chain
rule yields h0i (t) = dj=1 ∂x∂f
(x + t(x? − x))(x?j − xj ). This summarizes to
P
ij
h0 (t) = H(x + t(x? − x))(x? − x).
Also note that we are allowed to apply the fundamental theorem of
calculus in the first place, since f is twice continuously differentiable over
X (as a consequence of assuming Lipschitz continuous Hessians), so also
h0 (t) is continuous.
After this justifying intermezzo, we further massage the expression we
have obtained last. Using
Z 1
? −1 ? −1
x − x = H(x) H(x)(x − x ) = H(x) −H(x)(x? − x)dt,
0
186
Taking norms, we have
Z 1
0 ? −1
kx − x k ≤ kH(x) k · (H(x + t(x? − x)) − H(x)) (x? − x)dt ,
0
We can now use the properties (i) and (ii) (bounded inverse Hessians, Lip-
schitz continuous Hessians) to conclude that
Z 1 Z 1
0 ? 1 ? ? B ? 2
kx − x k ≤ kx − xk Bkt(x − x)kdt = kx − xk tdt .
µ 0 µ 0
| {z }
1/2
How realistic are properties (i) and (ii)? If f is twice continuously dif-
ferentiable (meaning that the second derivative ∇2 f is continuous), then
we will always find suitable values of µ and B over a ball X with center
x? —provided that ∇2 f (x? ) 6= 0.
Indeed, already in the one-dimensional case, we see that under f 00 (x? ) =
0 (vanishing second derivative at the global minimum), Newton’s method
will in the worst reduce the distance to x? at most by a constant factor in
each step, no matter how close to x? we start. Exercise 56 asks you to find
such an example. In such a case, we have linear convergence, but the fast
quadratic convergence (O(log log(1/ε)) steps cannot be proven.
One way to ensure bounded inverse Hessians is to require strong con-
vexity over X.
187
Lemma 8.7 (Exercise 58). Let f : dom(f ) → R be twice differentiable and
strongly convex with parameter µ over an open convex subset X ⊆ dom(f )
according to Definition 3.10, meaning that
µ
f (y) ≥ f (x) + ∇f (x)> (y − x) + kx − yk2 , ∀x, y ∈ X.
2
Then ∇2 f (x) is invertible and k∇2 f (x)−1 k ≤ 1/µ for all x ∈ X, where k · k is
the spectral norm defined in Lemma 3.6.
8.4 Exercises
Exercise
√ 51. Consider the Babylonian method (8.2). Prove that we get xT −
R < 1/2 for T = O(log R).
Exercise 52. Prove Lemma 8.2!
Exercise 53. Prove Corollary 8.5!
Exercise 54. Prove Lemma 8.6!
Exercise 55. Prove Lemma 8.3!
Exercise 56. Let δ > 0 be any real number. Find an example of a convex function
f : R → R such that (i) the unique global minimum x? has a vanishing second
derivative f 00 (x? ) = 0, and (ii) Newton’s method satisfies
|xt+1 − x? | ≥ (1 − δ)|xt − x? |,
for all xt 6= x? .
Exercise 57. This exercise is just meant to recall some basics around integrals.
Show that for a vector-valued function g : R → Rd , the inequality
Z 1 Z 1
g(t)dt ≤ kg(t)kdt
0 0
holds, where k · k is the 2-norm (always assuming that the funtions under consid-
eration are integrable)! You may assume (i) that integrals are linear:
Z 1 Z 1 Z 1
(λ1 g1 (t) + λ2 g2 (t))dt = λ1 g1 (t)dt + λ2 g2 (t)dt,
0 0 0
R1
And (ii), if g(t) ≥ 0 for all t ∈ [0, 1], then 0
g(t)dt ≥ 0.
188
Exercise 58. Prove Lemma 8.7! You may want to proceed in the following steps.
(i) Prove that the function g(x) = f (x) − µ2 kxk2 is convex over X (see also
Exercise 28).
(iii) Prove that all eigenvalues of ∇2 f (x)−1 are positive and at most 1/µ.
(iv) Prove that for a symmetric matrix M , the spectral norm kM k is the largest
absolute eigenvalue.
189
Chapter 9
Quasi-Newton Methods
Contents
9.1 The secant method . . . . . . . . . . . . . . . . . . . . . . . . 191
9.2 The secant condition . . . . . . . . . . . . . . . . . . . . . . . 193
9.3 Quasi-Newton methods . . . . . . . . . . . . . . . . . . . . . 193
9.4 Greenstadt’s approach . . . . . . . . . . . . . . . . . . . . . . 194
9.4.1 The method of Lagrange multipliers . . . . . . . . . . 196
9.4.2 Application to Greenstadt’s Update . . . . . . . . . . 197
9.4.3 The Greenstadt family . . . . . . . . . . . . . . . . . . 198
9.4.4 The BFGS method . . . . . . . . . . . . . . . . . . . . 201
9.4.5 The L-BFGS method . . . . . . . . . . . . . . . . . . . 202
9.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
190
The main computational bottleneck in Newton’s method (8.6) is the
computation and inversion of the Hessian matrix in each step. This matrix
has size d × d, so it will take up to O(d3 ) time to invert it (or to solve the
system ∇2 f (xt )∆x = −∇f (xt ) that gives us the next Newton step ∆x).
Already in the 1950s, attempts were made to circumvent this costly step,
the first one going back to Davidon [Dav59].
In this chapter, we will (for a change) not prove convergence results;
rather, we focus on the development of Quasi-Newton methods, and how
state-of-the-art methods arise from first principles. To motivate the ap-
proach, let us go back to the 1-dimensional case.
191
approximates the Newton step (two starting values x0 , x1 need to be cho-
sen here). Figure 9.1 shows what the method does: it constructs the line
through the two points (xt−1 , f (xt−1 )) and (xt , f (xt )) on the graph of f ; the
next iterate xt+1 is where this line intersects the x-axis. Exercise 59 asks
you to formally prove this.
f (x)
xt−1 xt xt+1
192
9.2 The secant condition
Applying finite difference approximation to the second derivative of f
(we’re still in the 1-dimensional case), we get
f 0 (xt ) − f 0 (xt−1 )
Ht := ≈ f 00 (xt ),
xt − xt−1
which we can write as
f 0 (xt ) − f 0 (xt−1 ) = Ht (xt − xt−1 ) ≈ f 00 (xt )(xt − xt−1 ). (9.3)
Now, while Newton’s method for optimization uses the update step
xt+1 = xt − f 00 (xt )−1 f 0 (xt ), t ≥ 0,
the secant method works with the approximation Ht ≈ f 00 (xt ):
xt+1 = xt − Ht−1 f 0 (xt ), t ≥ 1. (9.4)
The fact that Ht approximates f 00 (xt ) in the twice differentiable case
was our motivation for the secant method, but in the method itself, there
is no reference to f 00 (which is exactly the point). All that is needed is the
secant condition from (9.3) that defines Ht :
f 0 (xt ) − f 0 (xt−1 ) = Ht (xt − xt−1 ). (9.5)
This view can be generalized to higher dimensions. If f : Rd → R is
differentiable, (9.4) becomes
xt+1 = xt − Ht−1 ∇f (xt ), t ≥ 1, (9.6)
where Ht ∈ Rd×d is now supposed to be a symmetric matrix satisfying the
d-dimensional secant condition
∇f (xt ) − ∇f (xt−1 ) = Ht (xt − xt−1 ). (9.7)
193
We might therefore hope that Ht ≈ ∇2 f (xt ), and this would mean that
(9.6) approximates Newton’s method. Therefore, whenever we use (9.6)
with a symmetric matrix satisfying the secant condition (9.7), we say that
we have a Quasi-Newton method.
In the 1-dimensional case, there is only one Quasi-Newton method—
the secant method (9.1). Indeed, equation (9.5) uniquely defines the num-
ber Ht in each step.
But in the d-dimensional case, the matrix Ht in the secant condition is
underdetermined, starting from d = 2: Taking the symmetry requirement
into account, (9.7) is a system of d equations in d(d + 1)/2 unknowns, so if
it is satisfiable at all, there are many solutions Ht . This raises the question
of which one to choose, and how to do so efficiently; after all, we want to
get some savings over Newton’s method.
Newton’s method is a Quasi-Newton method if and only if f is a non-
degenerate quadratic function (Exercise 60). Hence, Quasi-Newton meth-
ods do not generalize Newton’s method but form a family of related algo-
rithms.
The first Quasi-Newton method was developed by William C. Davi-
don in 1956; he desperately needed iterations that were faster than those
of Newton’s method in order obtain results in the short time spans be-
tween expected failures of the room-sized computer that he used to run
his computations on.
But the paper he wrote about his new method got rejected for lacking
a convergence analysis, and for allegedly dubious notation. It became a
very influential Technical Report in 1959 [Dav59] and was finally officially
published in 1991, with a foreword giving the historical context [Dav91].
Ironically, Quasi-Newton methods are today the methods of choice in a
number of relevant machine learning applications.
194
We draw some intuition from (the analysis of) Newton’s method. Re-
call that we have shown ∇2 f (xt ) to fluctuate only very little in the region
of extremely fast convergence (Lemma 8.6); in fact, Newton’s method is
optimal (one step!) when ∇2 f (xt ) is actually constant— this is the case of
a quadratic function (Lemma 8.1). Hence, in a Quasi-Newton method, it
also makes sense to have that Ht ≈ Ht−1 , or Ht−1 ≈ Ht−1
−1
.
−1
Greenstadt’s approach from 1970 [Gre70] is to update Ht−1 by an “error
matrix” Et to obtain
Ht−1 = Ht−1 −1
+ Et .
Moreover, the errors should be as small as possible, subject to the con-
straints that Ht−1 is symmetric and satisfies the secant condition (9.7). A
simple measure of error introduced by an update matrix E is its squared
Frobenius norm
Xd X d
2
kEkF := e2ij .
i=1 j=1
195
Greenstadt’s approach can now be distilled into the following convex
constrained minimization problem in the d2 variables Eij :
196
9.4.2 Application to Greenstadt’s Update
In order to apply this method to (9.10), we need to compute the gradient
of f (E) = 12 kAEA> k2F . Formally, this is a d2 -dimensional vector, but it is
customary and more practical to write it as a matrix again,
∂f (E)
∇f (E) = .
∂Eij 1≤i,j≤d
Fact 9.2 (Exercise 62). Let A, B ∈ Rd×d two matrices. With f : Rd×d → R,
f (E) := 12 kAEBk2F , we have
197
Note that λy> is the outer product of a column and a row vector and
hence a matrix. As we assume A to be invertible, the quadratic func-
tion f (E) is easily seen to be strongly convex and as a consequence has
a unique minimizer E ? subject to the set of linear equations in (9.10) (see
Lemma 3.12 which also applies if we minimize over a closed set). Hence,
we know that the minimizer E ? and corresponding Lagrange multipiers
λ, Γ exist.
198
To also eliminate λ, we now use (9.12)—the secant condition in the next
step—to get
1
Ey = M λy> + yλ> M y = r.
2
−1
Premultiplying with 2M gives
2M −1 r = λy> + yλ> M y = λy> M y + yλ> M y.
Hence,
1 −1 >
λ= 2M r − yλ M y . (9.17)
y> M y
To get rid of λ on the right hand side, we premultiply this with y> M to
obtain
1 > 2y> r
y> M λ = > 2y r − (y> M y)(λ> M y) = > − λ> M y
| {z } y M y | {z } y M y | {z }
z z z
It follows that
y> r
z = λ> M y = .
y> M y
This in turn can be substituted into the right-hand side of (9.17) to remove
λ there, and we get
(y> r)
1 −1
λ= > 2M r − > y .
y My y My
Consequently,
(y> r)
> 1
λy = >
2M −1 ry> − yy >
,
y My y> M y
(y> r)
1
yλ> = 2yr> M −1 − yy >
.
y> M y y> M y
This gives us an explicit formula for E, by substituting the previous ex-
pressions back into (9.16). For this, we compute
(y> r)
> 1 > >
M λy M = 2ry M − > M yy M ,
y> M y y My
(y> r)
> 1 > >
M yλ M = 2M yr − > M yy M ,
y> M y y My
199
and consequently,
(y> r)
1 1
E = M λy> + yλ> M = > > > >
ry M + M yr − > M yy M .
2 y My y My
(9.18)
Finally, we use r = σ − Hy to obtain the update matrix E ? in terms
−1
of the original parameters H = Ht−1 (previous approximation of the in-
verse Hessian that we now want to update to Ht−1 = H 0 = H + E ? ),
σ = xt − xt−1 (previous Quasi-Newton step) and y = ∇f (xt ) − ∇f (xt−1 )
(previous change in gradients). This gives us the Greenstadt family of
Quasi-Newton methods.
where H0 = I (or some other positive definite matrix), and Ht−1 = Ht−1
−1
+ Et is
−1
chosen for all t ≥ 1 in such a way that Ht is symmetric and satisfies the secant
condition
∇f (xt ) − ∇f (xt−1 ) = Ht (xt − xt−1 ).
For any fixed t, set
−1
H := Ht−1 ,
H0 := −1
Ht ,
σ := xt − xt−1 ,
y := ∇f (xt ) − ∇f (xt−1 ),
and define
1 >
?
E = > σy M + M yσ > − Hyy> M − M yy> H
y My
1 > > >
− (y σ − y Hy)M yy M . (9.19)
y> M y
200
9.4.4 The BFGS method
In his paper, Greenstadt suggested two obvious choices for the matrix M
In Definition 9.4, namely M = H (the previous approximation of the in-
verse Hessian) and M = I. In the next paper of the same issue of the same
journal, Goldfarb suggested to use the matrix M = H 0 , the next approxi-
mation of the inverse Hessian. Even though we don’t yet have it, we can
use it in the formula (9.19) since we know that H 0 will by design satisfy the
secant condition H 0 y = σ. And as M always appears next to y in (9.19),
M y = H 0 y = σ, so H 0 disappears from the formula!
Definition 9.5. The BFGS method is the Greenstadt method with parameter
M = H 0 = Ht−1 in step t, in which case the update matrix E ? assumes the form
1 > > > 1 > > >
E? = 2σσ − Hyσ − σy H − (y σ − y Hy)σσ
y> σ σ>y
1 > >
y> Hy >
= − Hyσ − σy H + 1 + σσ ., (9.20)
y> σ y> σ
−1
where H = Ht−1 , σ = xt − xt−1 , y = ∇f (xt ) − ∇f (xt−1 ).
We leave it as Exercise 63 (i) to prove that the denominator y> σ appear-
ing twice in the formula is positive, unless the function f is flat between
the iterates xt−1 and xt . And under y> σ > 0, the BFGS method has an-
other nice property: if the previous matrix H is positive definite, then also
the next matrix H 0 is positive definite; see Exercise 63 (ii). In this sense, the
matrices Ht−1 behave like proper inverse Hessians.
The method is named after Broyden, Fletcher, Goldfarb and Shanno
who all came up with it independently around 1970. Greenstadt’s name is
mostly forgotten.
Let’s take a step back and see what we have achieved. Recall that our
starting point was that Newton’s method needs to compute and invert
Hessian matrices in each iteration and therefore has in practice a cost of
O(d3 ) per iteration. Did we improve over this?
First of all, any method in Greenstadt’s family avoids the computation
of Hessian matrices altogether. Only gradients are needed. In the BFGS
method in particular, the cost per iteration drops to O(d2 ). Indeed, the
computation of the update matrix E ? in Definition 9.5 reduces to matrix-
vector multiplications and outer-product computations, all of which can
be done in O(d2 ) time.
201
Newton and Quasi-Newton methods are often performed with scaled
steps. This means that the iteration becomes
for some αt ∈ R+ . This parameter can for example be chosen such that
f (xt+1 ) is minimized (line search). Another approach is backtracking line
search where we start with αt = 1, and as long as this does not lead to
sufficient progress, we halve αt . Line search ensures that the matrices Ht−1
in the BFGS method remain positive definite [Gol70].
As the Greenstadt update method just depends on the step σ = xt −
xt−1 but not on how it was obtained, the update works in exactly the same
way as before even if scaled steps are being used.
To verify this, simply expand the product in the right-hand side and
compare with (9.20).
We further observe that we do not need the actual matrix H 0 = Ht−1 to
perform the next Quasi-Newton step (9.6), but only the vector H 0 ∇f (xt ).
Here is the crucial insight.
202
Let g0 ∈ Rd . Suppose that we have an oracle to compute s = Hg for any vector
g. Then s0 = H 0 g0 can be computed with one oracle call and O(d) additional
arithmetic operations, assuming that σ and y are known.
σσ > 0 σ > g0
h= g = σ ,
y> σ y> σ
so h can be computed with two inner products, a real division, and a mul-
tiplication of σ with a scalar. For g, we obtain
yσ > σ > g0
g= I− > g0 = g0 − y > .
y σ y σ
H 0 g0 = z = w + h
203
How do we implement the oracle? We simply apply the previous
Lemma recursively. Let
σ k = xk − xk−1 ,
yk = ∇f (xk ) − ∇f (xk−1 )
By Lemma 9.7, the runtime of BFGS- STEP(t, ∇f (xt )) is O(td). For t >
d, this is slower (and needs more memory) than the standard BFGS step
according to Definition 9.5 which always takes O(d2 ) time.
204
The benefit of the recursive variant is that it can easily be adapted to
a step that is faster (and needs less memory) than the standard BFGS step.
The idea is to let the recursion bottom out after a fixed number m of recur-
sive calls (in practice, values of m ≤ 10 are not uncommon). The step then
has runtime O(md) which is a substantial saving over the standard step if
m is much smaller than d.
The only remaining question is what we return when the recursion
now bottoms out prematurely at k = t − m. As we don’t know the matrix
−1 −1
Ht−m , we cannot return Ht−m g0 (which would be the correct output in this
case). Instead, we pretend that we have started the whole method just now
and use our initial matrix H0 instead of Ht−m .1 The resulting algorithm is
depicted in Algorithm 2.
205
the matrix H 0 will satisfy the secant condition by design, irrespective of H.
9.5 Exercises
Exercise 59. Consider a step of the secant method:
xt − xt−1
xt+1 = xt − f (xt ) , t ≥ 1.
f (xt ) − f (xt−1 )
Assuming that xt 6= xt−1 and f (xt ) 6= f (xt−1 ), prove that the line through
the two points (xt−1 , f (xt−1 )) and (xt , f (xt )) intersects the x-axis at the point
x = xt+1 .
Exercise 61. Prove the direction (i)⇒(ii) of Theorem 9.1! You may want to do
proceed in the following steps.
206
Exercise 62. Prove Fact 9.2!
(i) Prove that y> σ > 0, unless xt = xt−1 , or f (λxt +(1−λ)xt−1 ) = λf (xt )+
(1 − λ)f (xt−1 ) for all λ ∈ (0, 1).
(ii) Prove that if H is positive definite and y> σ > 0, then also H 0 is positive
definite. You may want to use the product form of the BFGS update as
developed in Observation 9.6.
207
Chapter 10
Subgradient Methods
Contents
10.1 Subgradient and Subdifferential . . . . . . . . . . . . . . . . . 209
10.1.1 Definition and examples . . . . . . . . . . . . . . . . . 209
10.1.2 Topological properties . . . . . . . . . . . . . . . . . . 211
10.1.3 Subdifferential and directional derivative . . . . . . . 213
10.1.4 Calculus of Subgradient . . . . . . . . . . . . . . . . . 214
10.2 Subgradient Method . . . . . . . . . . . . . . . . . . . . . . . 215
10.2.1 Subgradient
√ Descent . . . . . . . . . . . . . . . . . . . 216
10.2.2 O(1/ t) convergence for convex functions . . . . . . 217
10.2.3 O(1/t) convergence for strongly convex functions . . 221
10.3 Lower Bound Complexity . . . . . . . . . . . . . . . . . . . . 223
10.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
208
Figure 10.1: Subgradients
209
Lemma 10.2. If f is convex and differentiable at x ∈ dom(f ), then ∂f (x) =
{∇f (x)}.
Proof. By definition, let y = x + εd, g ∈ ∂f (x), f (x + εd) ≥ f (x) + εg> d.
f (x + εd) − f (x)
≥ g> d, ∀d, ∀ε.
ε
Letting ε → 0, we have ∇f (x)> d ≥ g> d, ∀d. This only holds when g =
∇f (x).
Lemma 10.3 (Exercise 64). Prove that if f is differentiable at x ∈ dom(f ), then
∂f (x) ⊆ {∇f (x)}.
Example 10.4. Below, we provide some specific examples of subgradients.
(a) f (x) = 12 x2 , ∂f (x) = {x};
(
{sgn(x)}, x 6= 0
(b) f (x) = |x|, ∂f (x) = ;
[−1, 1], x=0
( √
− x, x≥0
(c) f (x) = , ∂f (0) = ∅;
+∞, otherwise
1,
x=0
(d) f (x) = 0, x>0 , ∂f (0) = ∅.
+∞, otherwise
210
10.1.2 Topological properties
In the following theorem, we discuss some topological properties of the
subdifferential set.
First of all, it can be easily seen that the subdifferential set is always
closed and convex.
Lemma 10.7. Let f be a convex function and x ∈ dom(f ). Then ∂f (x) is
convex and closed.
Proof. Convexity and closedness are evident due to
which is the set of interior points relative to the affine subspace that contains X.
Definition 10.9. Let S and T be two nonempty convex sets in Rn . A hyperplane
H = x ∈ Rn : a> x = b with a 6= 0 is said to separate S and T if S ∪ T 6⊂ H
and
S ⊂ H − = x ∈ Rn : a> x ≤ b ,
T ⊂ H + = x ∈ Rn : a> x ≥ b .
S ⊂ H −− = x ∈ Rn : a> x < b ,
T ⊂ H ++ = x ∈ Rn : a> x > b .
211
Figure 10.2: (a) Separation of two sets, (b) Strict separation of two sets
relint(S) ∩ relint(T ) = ∅.
212
(Boundedness) Suppose ∂f (x) is unbounded, i.e. ∃gk ∈ ∂f (x), s.t.
kgk k2 → ∞, as k → ∞. Since x ∈ int(dom(f )), ∃δ > 0, s.t. B(x, δ) ⊆
dom(f ). Hence, yk = x + δ kggkkk ∈ dom(f ). By convexity,
2
213
Proof. By definition, We have f (x + δd) − f (x) ≥ δg> d for all δ and g ∈
∂f (x). Hence, f 0 (x; d) ≥ g> d, ∀g ∈ ∂f (x). Moreover, this implies that
It suffices to show that ∃g̃ ∈ ∂f (x), s.t. f 0 (x; d) ≤ g̃> d. Consider the two
sets
g0> (x + αd) + β(f (x) + αf 0 (x; d)) ≤ g0> y + βt, ∀α ≥ 0, ∀t > f (y)
Setting α = 0, we have
214
2. Taking affine composition: If h(x) = f (Ax + b), where f is convex,
then
∂h(x) = A> ∂f (Ax + b).
3. Taking supremum: If h(x) = supα∈A fα (x) and each fα (x) is convex,
then
∂h(x) ⊇ conv{∂fα (x)|α ∈ α(x)}
where α(x) := {α : h(x) = fα (x)}.
4. Taking superposition: If h(x) = F (f1 (x), . . . , fm (x)), where F (y1 , . . . , ym )
is non-decreasing and convex, then
( m )
X
∂h(x) ⊇ di ∂fi (x) : (d1 , . . . , dm ) ∈ ∂F (y1 , . . . , ym ) .
i=1
Example 10.17. Let h(x) = maxy∈C f (x, y) where f (x, y) is convex in x for any
y and C is closed, then ∂f (x, y∗ (x)) ⊂ ∂h(x), where y∗ (x) = argmaxy∈C f (x, y).
This is because if g ∈ ∂f (x, y∗ (x)), we have
h(z) ≥ f (z, y∗ (x)) ≥ f (x, y∗ (x)) + g> (z − x) = h(z) + g> (z − x).
Lemma 10.18 (Exercise 68). Consider the function f (x) = kxk, here k·k is a
general norm. Then
∂f (x) = {g : g> x = kxk and kgk∗ ≤ 1}.
where k·k∗ is the dual norm: kyk∗ = maxx:kxk≤1 y> x. In particular, ∂f (0) :=
{g : kgk∗ ≤ 1}.
215
• R2 := max kx − yk22 is the squared diameter of X.
x,y∈X
|f (x)−f (y)|
• B := sup kx−yk2
< +∞ is the constant that characterizes the Lip-
x,y∈X
schitz continuity of f under k·k2 norm.
Note that the convexity of the function f can actually lead to local Lips-
chitz continuity. We will simply make this an assumption in the subse-
quent text. In addition, as we showed earlier, subgradient of f always
exists at interior of X, which motivates the subgradient method.
• gt ∈ ∂f (xt ) is a subgradient of f at xt ;
Remark 10.19. Note that unlike Gradient Descent, Subgradient Descent is not
a descent method, i.e., moving along the negative direction of subgradient is not
necessarily decreasing the objective function.
216
Choices of Stepsizes Stepsize γt is an important parameter that needs to
be selected during the iterations, which will affect the convergence analy-
sis as we will show later. Four most commonly used stepsizes include:
f (xt ) − f ?
γt = .
kgt k22
√
10.2.2 O(1/ t) convergence for convex functions
Theorem 10.20. Assume f is convex, then Subgradient Descent satisfies
T
!−1 T
!
X 1 2 1 X 2
min f (xt ) − f ? ≤ γt kx1 − x? k2 + γ 2 kgt )k2 . (10.1)
1≤t≤T
t=1
2 2 t=1 t
217
and
T
!−1 T
!
X 1 1 X
f (x̂T ) − f ? ≤ γt kx1 − x? k22 + γ 2 kgt k22 , (10.2)
t=1
2 2 t=1 t
P −1 P
T T
where x̂T = t=1 γt t=1 γt xt ∈ X.
Proof. The proof uses the similar technique as in the convergence for Gra-
dient Descent. First, by definition, we have
Combining (10.3) and (10.4) and adding both sides of the inequality from
t = 1 to t = T , we obtain
T T
!
X 1 X
γt (f (xt ) − f ? ) ≤ kx1 − x? k22 − kxT +1 − x? k22 + γt2 kgt k22
t=1
2 t=1
T
!
1 X
≤ kx1 − x? k22 + γt2 kgt k22 . (10.5)
2 t=1
For the proof of (10.1), by definition, the left hand side of (10.5) can be
lower bounded by
T T
!
X X
? ?
γt (f (xt ) − f ) ≥ γt · min f (xt ) − f
1≤t≤T
t=1 t=1
218
For the proof of (10.2), by convexity, the left hand side of (10.5) is lower
bounded by
T T
!
X X
γt (f (xt ) − f ? ) ≥ γt · (f (x̂T ) − f ? ) .
t=1 t=1
1 2
+ 21 Tt=T0 γt2 B 2
P
2
R
min f (xt ) − f ? ≤ PT , ∀1 ≤ T0 ≤ T.
t=T0 γt
T0 ≤t≤T
Note that the above general result is obtained by slightly modifying the
summation or averaging from T0 to T instead of from 1 to T .
(1/2)R2 + (T /2)γ 2 B 2 R2 1 B 2 T →∞ B 2
εT ≤ = · + γ −−−→ γ.
Tγ 2T γ 2 2
Note that the error does not diminish to zero as T grows to infinity,
which shows one of the drawbacks of using arbitrary constant step-
sizes. By minimizing the upper bound, we can select the optimal
stepsize γ∗ to obtain:
R RB
γ∗ = √ ⇒ εT ≤ √ .
B T T
Similar analysis applies to the scaled stepsize.
219
2. Non-summable but diminishing stepsize:
T
!, T !
1 2 1 X X
εT ≤ R + γt2 B 2 γt
2 2 t=1 t=1
T1
!, T ! T
!, T
!
2 X
1 2 1X X B X
≤ R + γ 2B2 γt + γt2 γt
2 2 t=1 t t=1
2 t=T +1 t=T1 +1
1
1
An example choice of the stepsize is γt = O tq
with q ∈ (0, 1]. If we
choose γt = BR√t , then
BR(1 + Tt=1 1t )
P
R BR ln(T )
γt = √ ⇒ εT ≤ =O √ .
B t 2 Tt=1 √1t
P
T
220
?
The Polyak step γt = f (xkgt )−f2 is exactly the minimizer of the right
t k2
hand side. In fact, the stepsize yields
(f (xt ) − f ? )2
kxt+1 − x? k22 ≤ kxt − x? k22 − , (10.6)
kgt k22
Therefore, we have εT → 0 as T → ∞.
B 2 (ln(T ) + 1)
min f (xt ) − f ? ≤ (10.8)
1≤t≤T 2µT
and
? B 2 (ln(T ) + 1)
f (x̂T ) − f ≤ , (10.9)
2µT
1
PT
where x̂T := T t=1 xt .
221
Proof. First recall that µ-strongly convex implies that
µ
f (y) ≥ f (x) + g> (y − x) + kx − yk22 , ∀x, y ∈ X, ∀g ∈ ∂f (x).
2
Similarly as the proof for the convex case, the left hand side of (10.3) can
be lower bounded by
µ
γt gt> (xt − x? ) ≥ γt f (xt ) − f ? + kxt − x? k22 .
2
1
Combining (10.3) and plug in γt = µt
we have
? µ ? 2 µ ? 2 1 2
f (xt ) − f ≤ (t − 1) kxt − x k2 − t kxt+1 − x k2 + kgt k2 .
2 2 2µt
With another choice of stepsize and averaging strategy, we can get rid
of the log factor in the bound. The following theorem can be obtained
[Bubeck (2014)].
2B 2 2B 2
min f (xt ) − f ? ≤ and f (x̂T ) − f ? ≤ (10.10)
1≤t≤T µ(T + 1) µ(T + 1)
PT 2t
where x̂T = t=1 T (T +1) xt .
222
Table 10.1: Comparison of nonsmooth and smooth convex optimization.
223
Proof. From the following construction, one can see that we can assume
x1 = 0 without loss of generality.
Let X = {x ∈ Rd , kxk2 ≤ R2 }. Then by triangle inequality we know that
the diameter of X is R. Let f : Rd → R be a function such that
µ
f (x) = C · max xj + kxk22 ,
1≤j≤t 2
where C is some constant to be determined. Note that it is never optimal
to have (x? )i 6= 0 for t < i ≤ d and by symmetry √
we know that (x? )1 =
(x? )2 = . . . = (x? )t . Thus, as long as C ≤ Rµ2 t , the optimal solution and
optimal value of the problem minx∈X f (x) is given by
C
? − µt 1 ≤ i ≤ t C2
(x )i = and f ? = − .
0 t<i≤d 2µt
On the other hand, the subdifferential of function f is
∂f (x) = µx + C · conv{ei : i such that xi = max xj }.
1≤j≤t
224
Remark 10.25. Recall that to obtain an ε-solution, the number of subgradient
call for convex function required by Subgradient Descent is at most
2
|f (x)−f (y)|
max · maxx,y∈X kx − yk2
x∈X kx−yk2
O
ε 2
10.4 Exercises
Exercise 64. Prove that if f is differentiable at x ∈ dom(f ), then ∂f (x) ⊆
{∇f (x)}.
Exercise 65 (Lipschitz continuity and bounded gradient). Let f : dom(f ) →
R be convex, dom(f ) open, B ∈ R+ . Then the following two statements are
equivalent.
(i) kgk ≤ B for all x ∈ dom(f ) and all g ∈ ∂f (x).
(ii) |f (x) − f (y)| ≤ B kx − yk for all x, y ∈ dom(f ).
Exercise 66 (Monotonicity). Prove that the subdifferential of a convex function
f (x) at x ∈ dom(f ) is a monotone operator, i.e.,
(u − v)T (x − y) ≥ 0, ∀x, y ∈ dom(f ), u ∈ ∂f (x), v ∈ ∂f (y).
Exercise 67 (Directional derivative). Let f be a convex function and x ∈
dom(f ) and let d be such that x + αd ∈ dom(f ) for α ∈ (0, δ) for some
δ > 0. Show that the scalar function
f (x + αd) − f (x)
φ(α) =
α
is non-decreasing function of α on (0, δ).
225
Exercise 68. Consider the function f (x) = kxk, here k·k is a general norm.
Show that
∂f (x) = {g : g> x = kxk and kgk∗ ≤ 1}.
where k·k∗ is the dual norm: kyk∗ = maxx:kxk≤1 y> x. In particular, ∂f (0) :=
{g : kgk∗ ≤ 1}.
226
Chapter 11
Contents
11.1 Mirror Decent . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.1.1 Bregman divergence . . . . . . . . . . . . . . . . . . . 228
11.1.2 Mirror
√ Descent . . . . . . . . . . . . . . . . . . . . . . 228
11.1.3 O(1/ t) convergence for convex functions . . . . . . 230
11.2 A Quick Tour of Convex Conjugate Theory . . . . . . . . . . 232
11.3 Smoothing Techniques . . . . . . . . . . . . . . . . . . . . . . 233
11.3.1 Common smoothing techniques . . . . . . . . . . . . 235
11.4 Nesterov’s smoothing . . . . . . . . . . . . . . . . . . . . . . 237
11.4.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . 238
11.4.2 Theoretical Guarantees . . . . . . . . . . . . . . . . . . 240
11.5 Moreau-Yosida Regularization . . . . . . . . . . . . . . . . . 241
11.5.1 Proximal Operators . . . . . . . . . . . . . . . . . . . . 242
11.5.2 Proximal Point Algorithm . . . . . . . . . . . . . . . 244
11.6 Proximal Gradient Methods . . . . . . . . . . . . . . . . . . . 246
11.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
227
11.1 Mirror Decent
Recall the subgradient decent updating rule can be equivalently written
as
1 2
xt+1 = argmin kx − xt k2 + hγt gt , xi
x∈X 2
Why should we restrict to the Euclidean k.k2 distance? Next we introduce
another algorithm, Mirror Descent, that generalizes subgradient descent
with non-Euclidean distances.
228
The Mirror Descent algorithm, originally introduced by Nemirovski &
Yudin in 1983, adopts the update
Example 11.4 (`1 -setup). X = {x ∈ Rn+ , ni=1 xi = 1}, ω(x) = ni=1 xi ln(xi ),
P P
k·k = k·k1 . One can verify that ω(x) is 1-strongly convex with respect to the
k·k1 -norm on X. In this case, we have
(a) Bregman distance: Vω (x, y) = ni=1 xi ln(xi /yi ), known as the Kullback-
P
Leibler divergence;
n
!−1 x e−ξ1
X 1
Proxx (ξ) = xi e−ξi ... ;
i=1 xn e−ξn
229
√
11.1.3 O(1/ t) convergence for convex functions
We first present the useful three point identity lemma:
Lemma 11.5. (Three point identity) For any x, y, z ∈ dom(ω):
Remark 11.6. When ω(x) = 12 kxk22 , this is the same as law of cosines, i.e.,
Theorem 11.7. For Mirror Decent, let f be convex and ω(·) be 1-strongly con-
vex on X with regard to norm k·k, then we have:
? 1
PT 2 2
? V ω (x , x 1 ) + 2 t=1 γt kgt k∗
min f (xt ) − f ≤ PT , (11.2)
t=1 γt
1≤t≤T
and ! PT
γt2 kgt k2∗
PT
γt xt ? Vω (x? , x1 ) + 21 t=1
f Pt=1
T
−f ≤ PT , (11.3)
t=1 γt t=1 γt
where k.k∗ denotes dual norm.
Proof. Since xt+1 = argminx∈X {ω(x) + hγt gt − ∇ω(xt ), xi}, by optimality
condition, we have
hγt gt , xt+1 −xi ≤ h∇ω(xt+1 )−∇ω(xt ), x−xt+1 i = Vω (x, xt )−Vω (x, xt+1 )−Vω (xt+1 , xt )
230
By Young’s inequality,
γt2 1
hγt gt , xt − xt+1 i ≤ kgt k2∗ + kxt − xt+1 k2 .
2 2
From the strongly convexity of ω(x), Vω (xt+1 , xt ) ≥ 12 kxt − xt+1 k2 . Adding
these two inequalities, we get the key inequality:
γt2
kgt k2∗ .
hγt gt , xt − x? i ≤ Vω (x? , xt ) − Vω (x? , xt+1 ) + (11.4)
2
Following similar line of proof for Subgradient Descent, we obtain the de-
sired results.
Remark 11.8 (Mirror Decent vs. Subgradient Decent). Let f be convex, with
proper choice of stepsize as before, we can see that the convergence of these two
methods looks very similar.
• For Subgradient Decent, εt ∼ O RB √
t
,
where R2 := kx − x1 k22 and B := maxx∈X maxg∈∂f (x) kgk2 .
√
• For Mirror Decent, εt ∼ O √ΩB t
,
where Ω := maxx∈X Vω (x, x1 ) and B := maxx∈X maxg∈∂f (x) kgk∗ .
The rate remains the same, but the constants differ. In some cases, one can
show that using Mirror Descent significantly improves upon the constant. Con-
sider X = {x ∈ Rd : xi ≥ 0, di=1 xi = 1}.
P
231
11.2 A Quick Tour of Convex Conjugate Theory
Definition 11.9 (convex conjugate). For a function f : dom(f ) → R, its
convex conjugate is given as:
kxk2 kyk2∗
x> y ≤ + , ∀x, y.
2 2
Lemma 11.10 (Sec.12, [Roc97]). If function f is convex, lower semi-continuous
and proper, then (f ∗ )∗ = f .
Here lower semi-continuity means that lim inf x→x0 f (x) ≥ f (x0 ). In
other words, the level set ({x : f (x) ≤ α}) of f is a closed set. A proper con-
vex function means that f (x) > −∞. Hence, for f satisfying the lemma,
f (x) admits the Fenchel representation
232
Note that for all y, the optimal solution of the above problem is unique due
to strong convexity. Hence, ∂f ∗ (y) is a singleton, i.e. ∂f ∗ (y) = {∇f ∗ (x)}.
Hence, f ∗ is differentiable. Now, we need to show the following:
1
k∇f ∗ (y1 ) − ∇f ∗ (y2 )k2 ≤ ky1 − y2 k2 , ∀y1 , y2 (11.6)
µ
Let x1 = argmaxx∈dom(f ) {y1> x−f (x)}. Similarly, let x2 = argmaxx∈dom(f ) {y2> x−
f (x)}. From the optimality condition, we get:
hy1 , x2 − x1 i ≤ h∂f (x1 ), x2 − x1 i (11.7)
hy2 , x1 − x2 i ≤ h∂f (x2 ), x1 − x2 i (11.8)
From the µ-strong convexity of f , we have:
µ
kx2 − x1 k22
f (x2 ) ≥ f (x1 ) + ∂f (x1 )> (x2 − x1 ) + (11.9)
2
µ
f (x1 ) ≥ f (x2 ) + ∂f (x2 )> (x1 − x2 ) + kx1 − x2 k22 (11.10)
2
Combining equations 11.7, 11.8 with 11.9, 11.10, we get:
hy1 − y2 , x1 − x2 i ≥ µ kx1 − x2 k22 .
From the Cauchy-Schwarz inequality, this further implies that
1
=⇒ kx1 − x2 k2 ≤ ky1 − y2 k2
µ
Hence, (11.6) follows from the definitions of x1 , x2 .
Lemma 11.12 (Exercise 73). Let f and g be two proper, convex and semi-continuous
functions, then
(a) (f + g)∗ (x) = inf y {f ∗ (y) + g ∗ (x − y)},
(b) (αf )∗ (x) = αf ∗ αx for α > 0.
233
about the structure of the optimization problem we intend to solve. One
can then utilize this structure to come up with more efficient algorithms as
compared to Subgradient Descent and Mirror Descent algorithms.
fµ (x) µ=1
4 µ=2
µ=3
µ=4
x
−4 −2 2 4 6
Example 11.13. Consider the simplest non-smooth and convex function, f (x) =
|x|. The following function, known as Huber function (Figure 11.1)
( 2
x
, if |x| ≤ µ
fµ (x) = 2µ µ
(11.13)
|x| − 2 , if |x| > µ
234
is a smooth approximation of the absolute value function. fµ (x) is clearly contin-
uous and differentiable everywhere. It can also been easily seen that
µ
f (x) − ≤ fµ (x) ≤ f (x).
2
Hence, if µ → 0, then fµ (x) → f (x). Moreover, we also have fµ00 (x) ≤ µ1 .
This implies that fµ (x) is µ1 -Lipschitz continuous. Therefore, µ determines the
approximation accuracy and the smoothness level.
The Huber function approximation has been widely used in machine learn-
ing to approximate non-smooth loss functions, e.g. absolute loss (robust regres-
sion), hinge loss (SVM), etc. For example, suppose we have m data samples
(a1 , b1 ), ..., (am , bm ), and we intend to solve the regression problem with absolute
loss: m
X
min a>i x − bi
x∈Rd
i=1
We can approximate the absolute loss by Huber loss and solve instead the follow-
ing smooth convex optimization problem:
m
X
min fµ (ai > x − bi ).
x∈Rd
i=1
235
By adding the strongly convex term µd(y) term, the function (f ∗ +µd)
is strongly convex. Therefore, based on Proposition 11.11, function
fµ (x) is continuously differentiable and Lipschitz-smooth.
1
fµ (x) = min {f (y) + kx − yk22 } (11.15)
y∈dom(f ) 2µ
Remark 11.14. Under the simple proximity function d(y) = 21 kyk22 , Nes-
terov’s smoothing is indeed equivalent to Moreau-Yosida regularization.
Let f ∗ denote the conjugate of the function f . Suppose f is proper, con-
vex and lower-semicontinuous, then
1 1
fµ,δ (x) = max min{f (z) + kz − yk22 − ky − xk22 } (11.16)
y z 2µ 2δ
236
This smoothing technique is only applicable to a particular class of
function which can be represented as:
f (x) = F (f1 (x), f2 (x), . . . , fm (x)), (11.17)
where F (y) = maxx∈dom(g) {g(x + y) − g(x)} is the recession func-
tion of some function g : Rm → R here. For a function f satisfying
the above condition, the Ben-Tal and Teboulle’s smoothing technique
uses the following function to approximate f (x):
f1 (x) fm (x)
fµ (x) = µg ,..., . (11.18)
µ µ
with φ(y) being a convex and continuous function and Y a convex and
compact set. Note that the aforementioned representation generalizes the
Fenchel representation using conjugate function and needs not be unique.
Indeed, for many cases, we are able to construct such representation easily
as compared to using the convex conjugate.
Example 11.15. Let f (x) = max1≤i≤m a> i x − bi . Computing the convex con-
∗
jugate for f is a cumbersome task and f is quite complex. Instead, we can easily
represent f as follows:
Xm Xm
f (x) = max (a>
i x − bi )yi , where Y := {y ∈ Rm : |yi | ≤ 1}.
y∈Y i=1 i=1
237
Proximity function. We now proceed to discuss some properties of the
proximity function d(y). The function d(y) should satisfy the following
properties:
(iii) d(y) ≥ 0, ∀y ∈ Y .
Example 11.16. Let y0 ∈ Y , here are some examples of valid proximity functions:
• d(y) = 12 ky − y0 k22
11.4.1 Example
Below, we provide a simple example to illustrate the smoothed function
under different choices of proximity function d(·) and Fenchel representa-
tion. Consider the absolute value function f (x) = |x|. Note that f admits
the following two different representation:
f (x) = sup yx
|y|≤1
238
1. d(y) = 12 y 2 . Clearly, d(·) is 1-strongly convex on Y = {y : |y| ≤ 1},
and d(y) ≥ 0.
Nesterov’s smoothing gives rise to
(
x2
n µ 2o 2µ
, |x| ≤ µ
fµ (x) = sup yx − y = (11.20)
|y|≤1 2 |x| − µ2 , |x| > µ
which is the well-known Huber function.
239
Remark. The same approximation can be obtained from Ben-Tal &
Teboulle smoothing based on recession function.
|x| = max{x, −x} = sup {g(x + µ) − g(y)} , g(y) = log (ey1 + ey2 )
y
x x
−µ x
fµ (x) = µg = µ log e + e µ
µ
kAk22
• fµ (x) is µ
-Lipschitz smooth, where kAk2 := maxx:kxk2 ≤1 kAxk2 .
Proposition 11.18. For any µ > 0, let DY2 = maxy∈Y d(y), we have
Remark. Let f∗ = minx∈X f (x) and fµ,∗ = minx∈X fµ (x), we have fµ,∗ ≤
f∗ . Moreover, for any xt generated by an algorithm
Suppose we have access to the gradient of fµ (x) when solving the re-
sulting smooth convex optimization problem
min fµ (x)
x∈X
240
(i) If we apply projected gradient descent to solve the smooth problem,
!
kAk22 DX
2
f (xt ) − f∗ ≤ O + µDY2
µt
241
11.5.1 Proximal Operators
Definition 11.19. Given a convex function f , the proximal operator of f at a
given point x is defined as
1 2
proxf (x) = argmin f (y) + kx − yk
y 2
Note that for continuous convex function f , the proximal operator al-
ways exists and is unique. In fact, for simple functions, proximal operators
can sometimes be computed efficiently with closed-form solutions at low
computation cost.
Then the proximal operator reduces to the projection operator onto X, i.e.,
1 2
proxf (x) = argmin kx − yk = ΠX (x).
y∈X 2
242
Proof. (a) First, if x? minimizes f (x), we have f (x) ≥ f (x) , ∀x ∈ X.
Hence,
1 1
f (x) + kx − x? k2 ≥ f (x? ) + kx? − x? k2
2 2
This implies that
1
x = argmin f (x) + kx − x? k2
?
= proxf (x? )
x 2
To prove the converse, consider if
? ? 1 ? 2
x = proxf (x ) = argmin f (x) + kx − x k
x 2
Therefore, x? minimizes f .
(b) Let us denote ux = proxf (x) and uy = proxf (y). Equivalently,
hx − ux − (y − uy ), ux − uy i ≥ 0
Hence, we have
hx − y, ux − uy i ≥ kux − uy k2 .
243
Recall the definition of fµ (x), by Danskin’s theorem, we can prove that
the gradient of fµ (x) is given by
1
∇fµ (x) = (x − proxµf (x)) (11.25)
µ
Theorem 11.22. Let f be a convex function, the proximal point algorithm satis-
fies
? kx0 − x? k22
f (xt ) − f ≤ Pt−1
2 τ =0 γτ
Proof. First, by optimality of xt+1 :
1
f (xt+1 ) + kxt+1 − xt k22 ≤ f (xt )
2γt
i.e.,
1
f (xt ) − f (xt+1 ) ≥ kxt+1 − xt k22 .
2γt
244
This further implies that f (xt ) is non-increasing at each iteration. Let g ∈
∂f (xt+1 ), by convexity of f , we have f (xt+1 ) − f ? ≤ g> (xt+1 − x? ). From
the optimality condition of xt+1 , we have
1 xt − xt+1
0 ∈ ∂f (xt+1 ) + (xt+1 − xt ) =⇒ ∈ ∂f (xt+1 )
γt γt
Hence,
1
f (xτ +1 ) − f ? ≤ (xτ − xτ +1 )> (xτ +1 − x? )
γτ
1
≤ (xτ − x? + x? − xτ +1 )> (xτ +1 − x? )
γt
1
(xτ − x? )> (xτ +1 − x? ) − kxτ +1 − x? k2
≤
γt
Therefore,
? kx0 − x? k2
f (xt ) − f ≤ Pt−1
2 τ =0 γτ
245
Remark. Note that
1. Unlike most algorithms we discussed so far in this course, the algo-
rithm is not a gradient-based algorithm.
P
2. γt can be arbitrarily, the algorithm converges as long as t γt → ∞,
however, the cost of the proximal operator will depend on γt . For
larger γt , the algorithm converges faster, but the proximal operator
proxγt f (xt ) might be harder to solve.
1
3. If γt = µ (const.), then f (xt ) − f ? = O µt . This matches with the
O (1/t) rate we obtain from the gradient descent perspective.
11.7 Exercises
Exercise 70 (Generalized Pythagorean Theorem). Let ω(·) : Ω → R be
strictly convex and continuously differentiable, X ⊆ Ω be closed and convex.
Define the Bregman projection of a point y onto X as:
Exercise 71 (Mirror Descent, smooth setting). Let f be convex and if the gradi-
ent of f is Lipschitz continuous such that k∇f (x) − ∇f (y)k∗ ≤ L kx − yk , ∀x, y.
Show that by setting γt = 1/L, the sequence of iterates {xt } generated by Mirror
Descent satisfies that
? L · Vω (x? , x1 )
min f (xt ) − f ≤ .
1≤t≤T T
Exercise 72 (Compute Conjugate). Calculate the conjugate of the following
convex functions:
(a) f (x) = ex on R
246
(b) f (x) = kxk on Rd
(b) (Direct Summation) Let f (x1 ) and g(x2 ) be convex and h(x1 , x2 ) = f (x1 )+
g(x2 ), then
h∗ (y1 , y2 ) = f ∗ (y1 ) + g ∗ (y2 )
(c) (Weighted Summation) Let f (x) and g(x) be closed convex functions, and
h(x) = f (x) + g(x), then
247
Chapter 12
Stochastic Optimization
Contents
12.1 Stochastic Gradient Descent . . . . . . . . . . . . . . . . . . . 250
12.1.1 Convergence for strongly convex functions . . . . . . 252
12.1.2 Convergence for convex functions . . . . . . . . . . . 253
12.1.3 Convergence of SGD under constant stepsize . . . . . 253
12.1.4 Convergence for nonconvex functions . . . . . . . . . 255
12.2 Adaptive Stochastic Gradient Methods . . . . . . . . . . . . . 257
12.2.1 Popular variants: AdaGrad, RMSProp and Adam . . 257
12.2.2 Theory and Practice . . . . . . . . . . . . . . . . . . . 259
12.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
248
Stochastic optimization involves decision-making in the presence of
randomness and lies at the heart of Data Science. The stochastic optimiza-
tion problem is often formulated as
n
1X
min F (x) = fi (x), (12.1)
x∈X n i=1
where `(·, ·) is some loss function such as least square loss, hinge loss, lo-
gistic loss, etc., and the predictor h(·) can come from a parametric fam-
ily such as linear models or neural networks or a non-parametric family
such as reproducing kernel Hilbert space or random forests. In statistical
learning, instead, we often seek to minimize the expected risk over the
population rather than the empirical distribution (testing error):
249
where P is the unknown data distribution, and (a, b) is a random testing
data point sampled from the distribution. The expected risk measures the
generalization performance and can be well approximated by the empiri-
cal risk if n is sufficiently large.
250
regularity conditions, say e.g., following dominated convergence theo-
rem). In other words, the stochastic gradient is unbiased, i.e.,
Z Z
E [∇f (x, ξ)] = ∇f (x, ξ)P (ξ)dξ = ∇ f (x, ξ)P (ξ)dξ = ∇F (x).
ξ ξ
where {(ai , bi )}ni=1 are the training data. Full GD works as follows:
n
γX >
xt+1 = xt − (a xt − bi )ai ;
n i=1 i
xt+1 = xt − γt (a>
it xt − bit )ait , where it ∼ Unif{1, . . . , n}.
251
12.1.1 Convergence for strongly convex functions
Theorem 12.3 ([NJLS09]). Assume F (x) is µ-strongly convex, and ∃M > 0,
s.t. E k∇f (x, ξ)k22 ≤ M 2 , ∀x ∈ X, then SA method with γt = γt at iteration t
(21.1)
h∇F (xt ), xt −x? i ≥ µ kxt − x? k22 +h∇F (x? ), xt −x? i ≥ µ kxt − x? k22 , ∀xt ∈ X.
252
12.1.2 Convergence for convex functions
Analogous to the deterministic setting, we can also generalize SGD to non-
Euclidean setting by leveraging Bregman divergence. This will immedi-
ately lead to the Stochastic Mirror Descent, where we simply replace the
gradient by the stochastic gradient estimator.
Stochastic Mirror Descent, works as follows:
where for given input x, ξ, the estimator G(x, ξ) satisfies that E[G(x, ξ)] ∈
∂F (x) and E[kG(x, ξ)k2∗ ] ≤ M 2 . Note that we don’t necessarily require
F (x) or f (x, ξ) to be differentiable. Here ω(x) is the distance-generating
function that is continuously differentiable and 1-strongly convex function
w.r.t. some norm k·k on X. And k·k∗ is the dual norm of k·k. The Bregman
divergence is defined as Vω (x, y) = ω(x)−ω(y)−∇ω(y)> (x−y), ∀x, y ∈ X.
The proof follows similarly as the proof for Mirror Descent, which we
simply
omit
here. As an immediate result, if we set the stepsize γt =
R M
√R
O √
M T
, we have E[F (x̂T ) − F (x? )] ≤ O T
, which implies an overall
2
sample complexity of O (1/ε ) in order to achieve an ε-optimal solution in
expectation.
It is worth pointing out that these complexity bounds, namely, O (1/ε)
and O (1/ε2 ) for strongly convex and convex cases, respectively, match
with the information-theoretic lower bound established in [AWBR09], thus
they are unimprovable without further structural assumptions.
253
convergence rate. On the other hand, SGD with constant stepsize may
converge faster, but is only guaranteed to converge to a neighborhood of
the optimal solution, up to constant error.
Below we present one of such results established in the literature. We
omit the proof here and leave it as a self-exercise.
Theorem 12.5 ([BCN18]). Assume that F (x) is both µ-strongly convex and
L-smooth. Moreover, assume that stochastic gradient satisfies that
E[k∇f (x, ξ)k22 ] ≤ σ 2 + c k∇F (x)k22 . (12.5)
1
Then, SGD with constant stepsize γt ≡ γ ≤ Lc
achieves:
γLσ 2
E[F (xt ) − F (x? )] ≤ + (1 − γµ)t−1 [F (x1 ) − F (x? )],
2µ
where x? is the optimal solution.
The assumption on the stochastic gradient in (12.5) is much weaker
than bounded stochastic gradients used in previous results. The assump-
tion can be viewed as a generalization of bounded variance assumption:
if the stochastic gradient has bounded variance, namely,
E[k∇f (x, ξ) − ∇F (x)k22 ] ≤ σ 2 ,
then the assumption in (12.5) holds with c = 1. When σ 2 = 0, the condition
reduces to E[k∇f (x, ξ)k22 ] ≤ c k∇F (x)k22 , which is also called the strong
growth condition (SGC) with constant c. This implies that the stochastic
gradients shrink relative to the full gradient. Note that in the purely de-
terministic setting, we have σ 2 = 0 and c = 1.
The above theorem implies that SGD with constant stepsize converges
linearly to some neighborhood of the optimal solution. Moreover, there
is a tradeoff between the convergence speed and the accuracy of the solu-
tion: as γ decreases, the convergence rate deteriorates, but the last iterate
is closer to the optimal solution.
Remark 12.6 (SGC). Under the strong growth condition, namely, when
E[k∇f (x, ξ)k22 ] ≤ c k∇F (x)k22 ,
SGD with constant stepsize converges to the global optimum at a linear rate.
Recently, it has been shown that modern overparameterized machine learning
models falling into the interpolation regime commonly satisfy such strong growth
condition and enjoys fast linear convergence [VBS19].
254
Remark 12.7 (Interpolation). Consider the finite-sum objective
n
1X
F (x) = fi (x),
n i=1
where each component function fi (·) corresponds to the loss under one data point.
In the interpolation regime, each individual loss attains its minimum at x? , thus
∇fi (x? ) = 0, ∀i = 1, . . . , n. In particular, for many regression or classification
problems in the realizable setting, using over-parameterized model often leads
to interpolation and zero training loss. Observe that the SGC in the finite-sum
setting implies interpolation.
Lγt2
> 2
E[F (xt+1 ) − F (xt )] ≤ E −γt ∇F (xt ) ∇f (xt , ξ t ) + k∇f (xt , ξ t )k .
2
255
Invoking the unbiasedness of the stochastic gradient E[∇f (xt , ξ t )|xt ] =
∇F (xt ) and the fact that E[k∇f (xt , ξ t )k2 |xt ] ≤ σ 2 + k∇F (xt )k22 , this further
implies that
Lγt2 Lσ 2 γt2
E[F (xt+1 ) − F (xt )] ≤ − γt − Ek∇F (xt )k2 + .
2 2
Lγt2
Since γt ≤ L1 , we have γt − 2
≥ γt /2. Therefore,
γt Lσ 2 γt2
E[F (xt+1 ) − F (xt )] ≤ − Ek∇F (xt )k2 +
2 2
The rest follows by telescoping sum and definition of x̂T and γt . Recall
γt = γ = min{ L1 , σγ√0T }.
T
1X
E[k∇F (x̂T )k2 ] = Ek∇F (xt )k2
T t=1
2(F (x1 ) − F (x∗ ))
≤ + γσ 2 L
γT
√
2(F (x1 ) − F (x∗ )) σ T γ0
≤ max{L, } + √ σ2T
T γ σ T
∗
0
2L(F (x1 ) − F (x )) 2(F (x1 ) − F (x∗ ))
σ
≤ +√ + Lγ0
T T γ0
Remark 12.9. The above theorem implies that to find an ε-stationary point x̄
such that E[k∇F (x̄)k] ≤ ε, SGD requires at most O(1/ε4 ) stochastic gradient
evaluations. In other words, the sample complexity for finding an approximate
stationary point is at most O(1/ε4 ). Recently, [ACD+ 22] proved that this sample
complexity is unimprovable for general stochastic optimization given unbiased
stochastic oracles, without further assumptions.
Before we proceed, below we summarize the computation complexity
between SGD and GD for solving finite-sum problems of form (12.1) for a
comparison.
As we can see that GD converges faster but with expensive iteration
cost, whereas SGD converges slowly but with cheaper iteration cost. For
problems with large n and moderate accuracy ε, SGD is more appealing
than GD as the total complexity is independent of n.
256
Table 12.1: Complexity for smooth and strongly convex problems: κ =
L/µ
257
1. AdaGrad: AdaGrad rescales the learning rate component-wise by
the square root of the cumulative sum of the previous gradients:
(
vt = vt−1 + ∇f (xt , ξ t ) 2
xt+1 = xt − ε+γ√0 vt ∇f (xt , ξ t )
Here the operator stands for component-wide product and ε > 0
ensures the denominator is positive. The key idea is to adapt the
learning rate to the parameters non-uniformly – use smaller step-
sizes for parameters with frequent features. The downside of Ada-
Grad is that the learning rate decreases too aggressively and the
learning rate becomes too small at a later stage.
AdaGrad can be also viewed as adaptively setting the Bregman di-
vergence of Mirror Descent as follows:
1 1 Xt 1
ω(x) = xt x =⇒ ωt (x) = xt Ht x, where Ht = εI + [ gt gt> ] 2
2 2 t=1
where gt = ∇f (xt , ξ t ).
2. RMSProp: RMSProp uses a moving average of the squared gradi-
ents with a discount factor to slow down the decay of the learning
rates. (
vt = βvt−1 + (1 − β)∇f (xt , ξ t ) 2
xt+1 = xt − ε+γ√0 vt ∇f (xt , ξ t )
Here β ∈ (0, 1) and is chosen to be close to 1.
3. Adam: Adam combines RMSProp with Momentum estimation. Sim-
ilar to RMSProp, Adam also keeps an exponentially decaying aver-
age of past gradients, similar to the momentum estimation. Because
of the factor β1 , β2 , the estimates mt and vt of the first and second
moments of the gradient become biased, Adam also counteract these
biases by normalizing these terms.
v t
= β2 vt−1 + (1 − β2 ∇f (xt , ξ t ) 2
mt = β1 mt−1 + (1 − β1 )∇f (xt , ξ t )
xt+1 = xt − ε+γ√0 ṽt m̃t
vt mt
Here ṽt = 1−β t and m̃t = 1−αt are bias-corrected estimates. Both β1
258
Below we introduce a generic framework proposed in [RKK19]. This
framework recovers several popular adaptive methods. The generic setup
is as follow:
for some β1 , β2 ∈ (0, 1), this recovers the well-known Adam algorithm [KB14].
In practice, a common choice is to set β1 = 0.9 and β2 = 0.99.
259
initial progress on the training set, but their performance quickly plateaus
on the testing set.
On the theoretical front, some adaptive methods can achieve nearly the
same convergence guarantees as (stochastic) gradient descent [DHS11a,
WWB19, RKK18]. For instance, [DHS11a] √ introduce AdaGrad for con-
vex online learning and achieve O T regrets. [LO19] and [WWB19]
show an O(εe −4 ) complexity for AdaGrad in the nonconvex stochastic op-
timization. On the other hand, [RKK18] point out √ the non-convergence of
Adam for simple convex problems when β1 < β2 and provide a remedy
with non-increasing stepsizes. There is a surge in the study of Adam-
type algorithms due to their popularity in the deep neural network train-
ing [ZRS+ 18, CLSH19, LJH+ 20]. Some work provides the convergence re-
sults for adaptive methods in the strongly-convex optimization [WLC+ 20,
Lev17, MH17].
12.3 Exercises
Exercise 75 (Weak Growth Condition). Suppose F (·) is L-smooth and has a
minima at x? . We say the stochastic gradient satisfies the weak growth condi-
tion with constant c if
Prove that
1. For convex function F , strong growth condition implies weak growth con-
dition.
Exercise 77 (Individual Smoothness). Let F (x) = E[f (x, ξ)], where f (x, ξ)
is convex and L-smooth for any realization of ξ. Define x? = argminx F (x).
Show that
260
(a) E[k∇f (x, ξ) − ∇f (x? , ξ)k22 ] ≤ 2L[F (x) − F (x? )].
(b) E[k∇f (x, ξ)k22 ] ≤ 4L[F (x) − F (x? )] + 2E[k∇f (x? , ξ)k22 ].
Exercise 78 (SGD inP the Interpolation Regime). Consider the finite sum prob-
lem minx F (x) := n ni=1 fi (x). Suppose each fi (x) is non-negative, L-smooth
1
and convex. The function F (x) is µ-strongly convex. Define x? = argminx F (x).
Assume that for all 1 ≤ i ≤ n, fi (x? ) = 0. In the context of least square regres-
sion, this means the model interpolates the data with zero loss.
Under the above assumption, prove that SGD with stepsize γt = L1 achieves
linear convergence:
µ
E[kxt+1 − x? k22 ] ≤ (1 − )E[kxt − x? k22 ].
L
Furthermore, we have
L µ
E[F (xt+1 )] ≤ (1 − )t kx1 − x? k22 .
2 L
261
Chapter 13
Contents
13.1 Variance Reduction Technique . . . . . . . . . . . . . . . . . . 263
13.1.1 Mini-batch and importance sampling . . . . . . . . . 263
13.1.2 Using control variate . . . . . . . . . . . . . . . . . . . 264
13.2 Stochastic Variance-Reduced Algorithms . . . . . . . . . . . 265
13.2.1 SAG/SAGA . . . . . . . . . . . . . . . . . . . . . . . . 266
13.2.2 SVRG . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
13.2.3 SPIDER/SARAH/STORM . . . . . . . . . . . . . . . 272
13.2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . 274
262
13.1 Variance Reduction Technique
In the previous theoretical analysis, we have seen the important role of
variance in the convergence. For instance, when using constant stepsize,
for strongly convex and smooth objectives, SGD achieves
? γLσ 2
E[F (xt ) − F (x )] ≤ + (1 − γµ)t−1 [F (x1 ) − F (x? )],
2µ
P (η t )
G(xt , ξ t ) =⇒ G(xt , η t )
Q(η t )
263
• Momentum: add momentum to the gradient step
Xt
xt+1 = xt − γt m̂t , where m̂t = c · αt−τ ∇fiτ (xτ )
τ =1
264
13.2 Stochastic Variance-Reduced Algorithms
In this section, we focus on finite-sum optimization problem
n
1X
min F (x) = fi (x).
x n i=1
265
13.2.1 SAG/SAGA
SAG: The key idea of SAG is to keep track of the average of the past
stored gradient of each component (denoted as vi ) as an estimate of the
full gradient
n n
1X 1X t
∇fi (xt ) = ∇F (xt ) ≈ gt = v
n i=1 n i=1 i
where the past gradient {vi }ni=1 for each component function are updated
as: (
∇fit (xt ), if i = it ,
vit =
vit−1 , if i 6= it .
Note that at every iteration, only the vector vit that corresponds to the
random index it is updated.
Note that equivalently, we can compute the moving average gt as a
recursive update
1 1
gt = gt−1 − vit−1 + ∇fit (xt ).
n t
n
This implies that computing the gradient estimator gt only requires O (d)
computation cost, as cheap as SGD. To see the connection to variance re-
duction technique, let us further rewrite the gradient estimator as follows
n
1 1X
gt = (∇fit (xt ) − vit ) + vi .
n n i=1
From the discussion in previous section, we see that this is a biased esti-
mator and likely has smaller variance than the direct stochastic gradient
estimator ∇fit (xt ).
To summarize, in a compact form, SAG works as follows:
n
(
γX t t ∇fit (xt ), if i = it
xt+1 = xt − vi , where vi = .
n i=1 vit−1 , otherwise
We further describe the detailed implementation in Algorithm 6 below.
Compared to SGD, the per-iteration cost is almost the same, but there
is an additional O (nd) memory cost to store the past gradients of each
components. On the theory side, this is the first stochastic method to enjoy
linear rate using a constant stepsize for finite-sum problems with strongly-
convex and smooth objectives.
266
Algorithm 6 SAG
1: Initialize vi = 0, i = 1, . . . , n
2: for t = 1, 2, . . . , T do
3: Randomly pick it ∈ {1, 2, . . . , n}
4: gt = gt−1 − n1 vit
5: vit = ∇fit (xt )
6: gt = gt + n1 vit
7: xt+1 = xt − γgt
8: end for
SAGA: The idea of SAGA is similar to SAG except that SAGA uses a
different coefficient to keep the gradient estimator unbiased. SAGA works
as follows:
" n
#
1 X
xt+1 = xt − γ (∇fit (xt ) − vit−1 )+ vt−1
t
n i=1 i
13.2.2 SVRG
We now introduce another algorithm called SVRG, which is one of the
most popular variance-reduced algorithms. In particular, SVRG algorithm
267
does not require storage of gradients as seen in SAG or SAGA. Moreover,
as we shall see, the convergence rate for SVRG can be proved easily and a
very intuitive explanation can be provided by linking increased speed to
reduced variance.
The idea of the algorithm is to use fixed reference point to build the
variance-reduced gradient:
gt = ∇fit (xt ) − ∇fit (x̃) + ∇F (x̃)
where the reference point x̃ is only updated once a while.
The intuition is that the closer x̃ is to xt , the smaller the variance of the
gradient estimator:
E[kgt − ∇F (xt )k2 ] ≤ E[k∇fit (xt ) − ∇fit (x̃)k2 ] ≤ L2max kxt − x̃k2 .
The full algorithm of SVRG is described in Algorithm 7 below.
Theorem 13.2. Assume fi (x) is convex and L-smooth and F (x) := n1 ni=1 fi (x)
P
is µ-strongly convex. Let x? = argminx F (x). Assume m is sufficiently large
1
(and η < 2L ), so that,
1 2Lη
ρ= + < 1,
µη(1 − 2Lη)m 1 − 2Lη
268
then we have geometric convergence in expectation for SVRG (under Option II
and Option III), i.e.,
≤ 2E k∇fit (xt−1 ) − ∇fit (x? )k22 |xt−1 , x̃ + 2E k∇fit (x̃) − ∇fit (x? ) − ∇F (x̃)k22 |xt−1 , x̃
≤ 2E k∇fit (xt−1 ) − ∇fit (x? )k22 |xt−1 , x̃ + 2E k∇fit (x̃) − ∇fit (x? )k22 |xt−1 , x̃
= kxt−1 − x? k22 − 2η(xt−1 − x? )> E [gt |xt−1 , x̃] + η 2 E kgt k22 |xt−1 , x̃
≤ kxt−1 − x? k22 − 2η(xt−1 − x? )> ∇F (xt−1 ) + 4Lη 2 [F (xt−1 ) − F (x? ) + F (x̃) − F (x? )]
≤ kxt−1 − x? k22 − 2η(F (xt−1 ) − F (x? )) + 4Lη 2 [F (xt−1 ) − F (x? ) + F (x̃) − F (x? )]
≤ kxt−1 − x? k22 − 2η(1 − 2Lη)(F (xt−1 ) − F (x? )) + 4Lη 2 (F (x̃) − F (x? ))
269
By taking the telescoping sum over t = 1, 2, . . . , m and applying law of
total expectation, we have
m
X
? 2 ? 2
E [F (xt−1 ) − F (x? )]
E kxm − x k2 ≤E kx0 − x k2 − 2η(1 − 2Lη)
t=1
m
X
+ 4Lη 2 E [F (x̃) − F (x? )] .
t=1
Pm
If Option II is used, then by the convexity of f we have F (x̃0 ) ≤ 1
m t=1 F (xt−1 ),
from which, by taking expectation, we obtain
m
X
− E [F (xt−1 ) − F (x? )] ≤ −mE [F (x̃) − F (x? )] (13.5)
t=1
If Option III is used, namely, x̃0 is P chosen randomly from {x0 , . . . , xm−1 },
we have E [F (x̃)|x0 , . . . , xm−1 ] = m1 mt=1 F (xt−1 ), which also leads to (13.5)
by law of total expectation. Therefore, we have
2
≤ E [F (x̃) − F (x? )] + 4Lmη 2 E [F (x̃) − F (x? )]
µ
The last inequality holds because F (x) is µ-strongly convex. Clearly, from
the above inequality we get,
0 ? 1 2Lη
E [F (x̃ ) − F (x )] ≤ + E [F (x̃) − F (x? )] .
µη(1 − 2Lη)m 1 − 2Lη
This gives us the desired linear convergence rate.
Remark 13.4. Setting η = θ/L with some constant θ > 0, this gives
L 2θ L
ρ= + =O + const .
µθ(1 − 2θ)m 1 − 2θ µm
Hence, if we set m = O(L/µ), then this will result in a constant rate ρ. The
number of epochs needed to achieve an ε optimal solution is O(log( 1ε )). Therefore,
270
the overall complexity for SVRG is
1 L 1
O (2m + n) log =O n+ log
ε µ ε
Note that the complexity is significantly better that of Gradient Descent, i.e.,
L 1
O n · log
µ ε
when the condition number L/µ is large.
Extensions.
1. Non-uniform sampling: SVRG algorithm assumes uniform sam-
pling, however, one may choose an adaptive sampling rate,
Li
P(it = i) = P
i Li
where fi (x) are smooth and convex, but g(x) is convex but possibly
nonsmooth. Such problems can be handle by prox-SVRG [XZ14] by
imposing an additional proximal operator of g at iteration.
3. Acceleration: SVRG can be further accelerated to achieve an optimal
complexity of s ! !
nL 1
O n+ log( ) .
µ ε
L
This improvement is significant in problems where µ
is large.
271
Table 13.1: Comparisons between SVRG and SAG/SAGA
SVRG SAG/SAGA
memory cost O (d) O (nd)
epoch-based yes no
# gradients per step at least 2 1
parameters stepsize & epoch length stepsize
unbiasedness yes yes/no
1
O (n + κmax ) log 1ε
total complexity O (n + κmax ) log ε
13.2.3 SPIDER/SARAH/STORM
The previous variance-reduced methods are designed primarily for solv-
ing smooth and strongly-convex finite-sum problems. For other settings,
sometimes variance-reduction technique may not be theoretically benefi-
cial; in other times, modifications need to be made. Below we introduce
some recent variance-reduced methods designed specially for nonconvex
optimization.
For smooth functions with finite-sum structure F (x) := n1 ni=1 fi (x)
P
As we have shown in previous sections, GD finds a point with k∇F (x̄)k ≤
ε in O (n/ε2 ) gradient evaluations, whereas SGD finds a point with E[k∇F (x̄)k] ≤
ε in O (1/ε4 ) gradient evaluations.
Recently, several algorithms have been designed to achieve better per-
formance than both GD and SGD, by exploiting variance reduction tech-
niques, for example SPIDER [FLLZ18, WJZ+ 19], SARAH [NLST17], STORM
[CO19], PAGE [LBZR21]. Specifically, when the objective satisfies the so-
2 2 2
√Ei k∇f
called average-smoothness condition: i (x) − ∇fi (y)k ≤ L kx − yk , an
improved complexity of O (min{ n/ε2 , ε−3 }) can be obtained. Note that
when each individual function fi (x) is smooth, the average-smoothness
√
property automatically holds. The complexity of O (min{ n/ε2 , ε−3 }) im-
272
√
proves the O (n/ε2 ) complexity of GD with an O ( n) factor and improves
the O (1/ε4 ) complexity of SGD with an O (1/ε) factor.
Consider the general problem setting:
end if
xt+1 = argminx∈X {gt> x + α1 Vω (x, xt )}.
end for
Output: xτ with τ chosen uniformly at random from {0, 1, · · · , T − 1}.
273
When the momentum parameter η = 1, gt reduces to a mini-batch esti-
mator of ∇f (xt ) and loses the variance recursion property. The framework
thus reduces to mini-batch SGD. When η < 1, gt has a similar form as the
classical variance reduction techniques SPIDER and SARAH (when η = 0),
and STORM (when the time-varying ηt ∈ (0, 1) is used).
The following table summarizes different choices of parameters and
their relations to existing VR methods and two alternative variants [Zha21].
13.2.4 Summary
So far, we have learned several different methods for solving stochas-
tic optimization with finite-sum structure, such as GD, AGD, SGD, and
variance-reduced methods. The following two tables give a glimpse of the
summary of the complexity comparisons for smooth strongly-convex or
nonconvex objectives.
274
(a) MNIST (b) CIFAR-10
275
Table 13.3: Complexity of finding an ε-optimal solution for strongly-
convex finite-sum optimization, κ = LµF , κmax = Lmax
µ
276
Chapter 14
Min-Max Optimization
Contents
14.1 Motivational Applications . . . . . . . . . . . . . . . . . . . . 278
14.1.1 Zero-sum Matrix Games . . . . . . . . . . . . . . . . . 278
14.1.2 Quadratic Minimax Problems . . . . . . . . . . . . . . 279
14.1.3 Nonsmooth Optimization . . . . . . . . . . . . . . . . 279
14.2 Saddle Points and Global Minimax Points . . . . . . . . . . . 280
14.3 Minimax Theorem and Existence of Saddle Point . . . . . . . 284
14.4 Frist-order Methods for Minimax Problems . . . . . . . . . . 288
14.4.1 Strongly-Convex-Strongly-Concave Setting . . . . . . 288
14.4.2 Convex-Concave Setting . . . . . . . . . . . . . . . . . 291
14.5 Extension to Variational Inequalities . . . . . . . . . . . . . . 296
14.5.1 Stampacchia VI and Minty VI . . . . . . . . . . . . . . 296
14.5.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . 298
14.5.3 Algorithms for Solving VIs . . . . . . . . . . . . . . . 300
14.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
277
The past decade has witnessed a paradigm shift from risk minimiza-
tion to min-max optimization for a myriad of emerging machine learning
applications from training generative adversarial networks (GANs) to re-
inforcement learning (RL), and from adversarial training to algorithmic
fairness. The problem of interest in such applications is often a smooth
minimax optimization problem (also referred to as saddle point problems):
278
14.1.2 Quadratic Minimax Problems
Quadratic minimax problems are fundamental problems which arise in
numerical analyses, optimal control, and many other areas. The minimax
objective is quadratic in x and y:
min max φ(x, y) = x> Bx + y> Ax − yT Cy. (14.3)
x∈Rm y∈Rn
Recall that g(Ax) = maxy∈Rm hAx, yi − g ∗ (y) where g ∗ is the Fenchel con-
jugate. We can rewrite the original problem with the min-max reformula-
tion:
minn maxm f (x) + hAx, yi − g ∗ (y). (14.4)
x∈R y∈R
Example 14.2. Suppose g(x) = max gi (x) where each gi (x) is smooth and con-
1≤i≤m
vex for all 1 ≤ i ≤ m. Note that g(x) is the maximum of convex
P functions and is
typically non-smooth. This can be written as g(x) = max m i=1 yi gi (x), where
P y∈∆m
the simplex ∆m = {y : y ≥ 0, yi = 1} is a compact convex set. Hence, we
have m
X
min g(x) ⇒ min max φ(x, y) = yi gi (x).
x x y∈∆m
i=1
279
Note that φ(x, y) is a smooth function since each gi is smooth and it is concave
(linear) in y for any x and convex in x for any fixed y ∈ ∆m .
Example 14.3. Consider g(x) = ||Ax − b||p where ||.||p denotes the p-norm
1
given by ||x||p = ( ni=1 xpi ) p . The function g(x) is convex but non-smooth be-
P
cause it is not differentiable at zero. This can be rewritten as g(x) = max hAx −
||y||q ≤1
b, yi. Denote Y = {y : ||y||q ≤ 1} as the unit q-norm ball, where q is such that
1
p
+ 1q = 1. We have
Note that φ(x, y) is a smooth function that is concave (linear) in y for any x and
convex (linear) in x for any fixed y.
280
Figure 14.1: Saddle point
We now define the primal and dual problems induced by the minimax
optimization problem (14.5).
281
Immediately, based on the definition, we can see that weak duality
holds, i.e., Opt(D) ≤ Opt(P), namely,
Note that for any x ∈ X , y ∈ Y, we have φ(x, y) ≤ maxy∈Y φ(x, y). Tak-
ing minimum on both side implies that minx∈X φ(x, y) ≤ minx∈X maxy∈Y φ(x, y)
for any y ∈ Y, namely φ(y) ≤ Opt(P) for any y ∈ Y. Therefore, Opt(D) =
maxy∈Y φ(y) ≤ Opt(P). ¯
¯ following, we show that if a saddle point exists, then strong du-
In the
ality holds, namely, Opt(D) = Opt(P).
Lemma 14.7. The point (x∗ , y∗ ) is a saddle point of φ(x, y) if and only if
Therefore,
Opt(D) = max φ(y) ≥ φ(y∗ ) = φ(x∗ , y∗ ).
y∈Y ¯ ¯
Similarly, we have
This implies Opt(P) ≤ Opt(D). Together with the weak duality, we further
have Opt(P) = Opt(D). In fact, all the inequality above should hold for
eqauality, namely,
and
Opt(P) = φ̄(x∗ ) = max φ(x∗ , y) ≥ φ(x∗ , y∗ ).
y∈Y
Remark 14.8. Based on the above analysis, it can be seen that a saddle point, if
exists, is also a global minimax point.And there is no advantage to the players of
knowing the opponent’s choice or to play second. The minimax, maximin, and the
equilibrium all give the same payoff.
Howeer, saddle point may not always exist. In contrast, a global minimax
point always existis under mild regularity condition. For eample, if function
φ(x, y) is continuous on X × Y and X , Y are compact sets, then the global mini-
max point exists due to the extreme-value theorem.
283
14.3 Minimax Theorem and Existence of Saddle
Point
In the last section, we have seen that saddle point exists if and only if the
induced primal and dual problems are solvable and there is no duality
gap. But in general, what structural conditions guarantee the existence of
saddle point. This has been extensively studied since the seminal work by
John von Neumann in 1929. Below we present a few classical results.
Theorem 14.11. (von Neumann’s Minimax theorem) For any payoff matrix
A ∈ Rm×n ,
min max x> Ay = max min x> Ay,
x∈∆m y∈∆n y∈∆n x∈∆m
There are different proof techniques for the von Neumann’s Minimax
Theorem. The classical proof is based on the separating hyperplane the-
orem from convex analysis. A modern proof is based on regret analysis
from online learning. Below we briefly discuss the high-level proof from
the low regret analysis.
Consider the repeated two-player games for T rounds. At round t =
1, . . . , T :
• The row player chooses a strategy xt ∈ ∆m ;
• The column player chooses a strategy yt ∈ ∆n ;
• The row player receives a penalty/cost of x>
t Ayt ;
The regret of the row player after T rounds is defined as the difference in
total costs when compared to the best fixed strategy at hindsight :
T
X T
X
RT (y1 , . . . , yT ) = x>
t Ayt − min x> Ayt .
x∈∆m
t=1 t=1
284
Lemma 14.12 (Exercise 79). Consider the repeated zero-sum matrix game. Sup-
pose row player chooses xt+ according to the gradient descent update rule at each
round:
xt+1 = Π∆m (xt − ηAyt )
where Π∆m is the projection operator
p on ∆m and η > 0 is the stepsize. Let G =
maxy∈∆n kAyk. Then with η = 2/(G2 T ), the row player’s regret satisfies:
T T
X X √
RT (y1 , . . . , yT ) := x>
t Ayt − min x> Ayt ≤ 2G2 T .
x∈∆m
t=1 t=1
1
PT 1
PT
Define x̄ = T t=1 xt ∈ ∆m and ȳ = T t=1 yt ∈ ∆n . We have
min max x> Ay ≤ max x̄> Ay
x∈∆m y∈∆n y∈∆n
T
1X >
= max xt Ay
y∈∆n T
t=1
T
1X
≤ max x> Ay
T t=1 y∈∆n t
T
1X >
= x Ayt
T t=1 t
T
1 X
≤ min x> Ayt + RT (y1 , . . . , yT )/T
T x∈∆m t=1
T
X
= min x> Aȳ + RT (y1 , . . . , yT )/T
x∈∆m
t=1
≤ max min x> Ay + RT /T
y∈∆n x∈∆m
285
Combined with the weak duality, this leads to the minimax theorem.
The von Neumann Minimax Theorem is specifically for bilinear matrix
games. In fact, for general continuous games with convex-concave cost
function, the minimax theorem also holds and a saddle point exists.
Remark 14.14. Note that the above assumptions are only sufficient conditions
for the existence of saddle point. There are many extensions of minimax theo-
rem with weaker assumptions. For example, continuity of φ(x, y) can be relaxed
to semi-continuity, convexity of of φ(·, y) can be realxed to quasi-convexity. It
is sufficient to have only one of the two sets to be compact. When φ(x, y) is
both strongly convex in x and strongly concave in y, we can further remove the
compactness assumption. Results can be generalized to Hilbert spaces and even
function spaces, see e.g., [Roc97, ET99] for detailed results.
Lemma 14.15 (Minimax Lemma, Exercise 80). Let fi (x), i = 1, ...,Pm be con-
vex and continuous on a convex compact set X . Let ∆n = {λ ∈ R+ : ni=1 λi =
n
1}. We have
Xn Xn
min max λi fi (x) = max min λi fi (x)
x∈X λ∈∆n λ∈∆n x∈X
i=1 i=1
∗
Equivalently, this means there exists some λ ∈ ∆n such that
n
X
min max fi (x) = min λ∗i fi (x).
x∈X 1≤i≤n x∈X
i=1
286
Lemma 14.16. (Helley’ Theorem) Let F be any collection of compact convex sets
in Rm . If every (m + 1) sets have common point, then all sets have a point in
common.
Now we are ready to prove the Sion’s minimax theorem based on these
two results. Define the induced primal and dual problems:
First, since X and Y are compact, φ(x, y) is continuous, both φ̄(x) and φ(y)
are continuous and attain their optimum on compact set. It is sufficient¯ to
show Opt(D) ≥ Opt(P), i.e.,
287
14.4 Frist-order Methods for Minimax Problems
In this section, we introduce first-order methods for finding an approxi-
mate saddle point for convex-concave minimax problem:
288
Assumption 14.17 (SC-SC setting). We assume φ(x, y) is µ-strongly convex
in x for any fixed y ∈ Y and is µ-strongly concave in y for any fixed x ∈ X ,
namely, for any x, x1 , x2 ∈ X and y, y1 , y2 ∈ Y,
µ
φ(x1 , y) ≥ φ(x2 , y) + ∇x φ(x2 , y)> (x1 − x2 )) +kx1 − x2 k2 ,
2
> µ
−φ(x, y1 ) ≥ −φ(x, y2 ) − ∇y φ(x, y2 ) (y1 − y2 ) + ky1 − y2 k2 .
2
In the SC-SC setting, it can be easily shown that the saddle point is also
unique. We also assume the function is smooth.
Theorem 14.19 (Convergence of GDA). Under the Assumptions 14.17 and 14.18,
GDA with stepsize η < 2Lµ 2 converges linearly:
µ
When η = 4L2
,
T
kxT − x∗ k2 + kyT − y∗ k2 ≤ 1 − µ2 /(4L2 ) kx0 − x∗ k2 + ky0 − y∗ k2 .
289
Proof. First of all, by the definition of strong convexity, we have
µ
φ(x2 , y1 ) ≥ φ(x1 , y1 ) + ∇x φ(x1 , y1 )> (x2 − x1 ) + kx2 − x1 k2 ,
2
µ
φ(x1 , y2 ) ≥ φ(x2 , y2 ) + ∇x φ(x2 , y2 )> (x1 − x2 ) + kx1 − x2 k2 ,
2
µ
−φ(x1 , y2 ) ≥ −φ(x1 , y1 ) − ∇y φ(x1 , y1 ) (y2 − y1 ) + ky2 − y1 k2 ,
>
2
µ
−φ(x2 , y1 ) ≥ −φ(x2 , y2 ) − ∇y φ(x2 , y2 ) (y1 − y2 ) + ky1 − y2 k2 .
>
2
Summing four equations together, we get:
(∇x φ(x1 , y1 ) − ∇x φ(x2 , y2 ))> (x1 − x2 ) + (∇y φ(x2 , y2 ) − ∇y φ(x1 , y1 ))> (y1 − y2 )
≥ µkx1 − x2 k2 + µky1 − y2 k2 .
kxt+1 − x∗ k2 + kyt+1 − y∗ k2
= kΠX (xt − η∇x φ(xt , yt )) − ΠX (x∗ − η∇x φ(x∗ , y∗ ))k2 +
kΠY (yt + η∇y φ(xt , yt )) − ΠY (y∗ + η∇y φ(x∗ , y∗ ))k2
≤ kxt − η∇x φ(xt , yt ) − x∗ + η∇x φ(x∗ , y∗ )k2 +
kyt + η∇y φ(xt , yt ) − y∗ − η∇y φ(x∗ , y∗ )
≤ kxt − x∗ k2 + η 2 k∇x φ(xt , yt ) − ∇y φ(x∗ , y∗ )k2 −
2η(∇x φ(xt , yt ) − ∇y φ(x∗ , y∗ ))> (xt − x∗ ) +
kyt − y∗ k2 + η 2 k∇y φ(xt , yt ) − ∇y φ(x∗ , y∗ )k2 −
2η(∇y φ(x∗ , y∗ ) − ∇y φ(xt , yt ))> (yt − y∗ ).
290
Remark 14.20 (Upper bound complexity). Define the condition number κ =
L
µ
. The above theorem implies that the iteration complexity of GDA to output a
solution -close to the saddle point is at most O(κ2 log(1/)). The best-known
complexity for solving SC-SC minimax problems under the exact same setting is
O(κ log(1/)) [Tse95, MOP20], which can be achieved by extragradient method
(EG) and optimistic GDA, to be introduced in the next subsection.
Remark 14.21 (Lower bound complexity). The above results can be extended
to more general class of SC-SC minimax problems, F(Lx , Ly , Lxy , µx , µy ), where
Lx , Ly , Lxy correspond to the gradient Lipshitz constants with respect to different
blocks of variables, and µx , µy are the strong convexity or concavity constants
with respect to variables x, y. To find an -approximate saddle point, [ZHZ19]
recently showed that any first-order algorithm with the linear span assumption
requires at least s !
L L 2
x xy L y
1
Ω + + log
µx µx µy µy
calls to a gradient oracle for φ(x, y). Directly
applying the above GDA would
L2 1
yield the upper bound complexity O µ2 log , where µ = min{µx , µy }, L =
max{Lx , Ly , Lxy }.
GDA with constant stepsize may not converge. Consider the function
φ(x, y) = xy, which has the saddle point (0, 0). GDA with constant stepsize
gives the update: xt+1 = xt − ηyt ; yt+1 = yt + ηxt . This implies that
x2t+1 + yt+1
2
= (xt − ηyt )2 + (yt + ηxt )2 = (1 + η 2 )(x2t + yt2 )
It does not converge to the saddle point (0, 0). For any η > 0, the iterate
(xt , yt ) will diverge.
291
Extragradient Method (EG). Extragradient method [Kor76] is a classical
method introduced by Korpelevich in 1976. The main idea of EG is to
use the gradient at the current point to find a mid-point, and then use the
gradient at that mid-point to find the next iterate. The algorithm behaves
as follows:
1
PT 1
PT 1
Denote x̂T = T t=1 xt+ 1 , ŷT = T t=1 yt+ 1 . Setting η = 2L
, this implies that
2 2
L(DX2 + DY2 )
Esad (x̂T , ŷT ) ≤ .
T
Proof. For convenience, we denote
Thus,
xt+ 1 = ΠX x
et+ 1 , yt+ 1 = ΠY yet+ 1
2 2 2 2
xt+1 = ΠX (e
xt+1 ), yt+1 = ΠY (e
yt+1 ).
292
First, we note that
> >
∇x φ xt+ 1 , yt+ 1 (xt+ 1 − x) = ∇x φ xt+ 1 , yt+ 1 (xt+1 − x)+
2 2 2 2 2
>
∇x φ (xt , yt ) (xt+ 1 − xt+1 )+
2
>
∇x φ xt+ 1 , yt+ 1 − ∇x φ (xt , yt ) (xt+ 1 − xt+1 ).
2 2 2
We will bound each term of the right hand side. For the first term, we have
> 1
∇x φ xt+ 1 , yt+ 1 (xt+1 − x) = (xt − xet+1 )> (xt+1 − x)
2 2 η
1
≤ (xt − xt+1 )> (xt+1 − x)
η
1
kx − xt k2 − kx − xt+1 k2 − kxt − xt+1 k2 ,
=
2η
where the second inequality uses the property of projection. For the sec-
ond term, we have
1
∇x φ (xt , yt )> (xt+ 1 − xt+1 ) = (xt − xet+ 1 )> (xt+ 1 − xt+1 )
2 η 2 2
1
≤ (xt − xt+ 1 )> (xt+ 1 − xt+1 )
η 2 2
1 h i
= kxt+1 − xt k2 − kxt+ 1 − xt+1 k2 − kxt − xt+ 1 k2 .
2η 2 2
L 2 L 2 2
≤ xt+ 1 − xt + yt+ 1 − yt + L xt+ 1 − xt+1 ,
2 2 2 2 2
293
Combine three inequalities above gives rise to
>
∇x φ xt+ 1 , yt+ 1 (xt+ 1 − x)
2 2 2
1 2 2
1 2
≤ kxt − xk − kx − xt+1 k + L − xt+ 1 − xt+1 +
2η 2η 2
L 1 2 L 2
− xt+ 1 − xt + yt+ 1 − yt .
2 2η 2 2 2
1 1
Since η ≤ 2L , we have L − 2η ≤ 0. Taking the telescope sum of the above
two equations from t = 1, . . . , T leads to
> >
∇x φ xt+ 1 , yt+ 1 (xt+ 1 − x) − ∇y φ xt+ 1 , yt+ 1 (yt+ 1 − y)
2 2 2 2 2 2
1
kx1 − xk2 + ky1 − yk2 .
≤
2η
Lastly, invoking the convexity of φ(·, y) and concavity of φ(x, ·), for any
x, y, it holds that
T
! T
!
1X 1X
φ xt , y − φ x, yt
T t=1 T t=1
T
1 Xh i
≤ φ xt+ 1 , y − φ x, yt+ 1
T t=1 2 2
T
1X > >
≤ −∇y φ xt+ 1 , yt+ 1 (yt+ 1 − y) + ∇x φ xt+ 1 , yt+ 1 (xt+ 1 − x)
T t=1 2 2 2 2 2 2
DX2 + DY2
≤ .
2ηT
294
Remark 14.24. The above theorem shows that the average iterate of the mid-
points from EG method achieves the convergence rate of O(1/T ): Esad (x̂T , ŷT ) ≤
O TL . The rate is known to be unimprovable among first-order methods for
solving the general convex-concave minimax problems, without further assump- √
tions [OX21]. It is shown that the last-iterate of EG has a slower O(1/ T )
convergence rate that the average-iterate [GPDO20, COZ22].
Note that in sharp contrast to EG, OGDA only requires evaluating one
gradient at each iteration and reuses the previous gradient. In the uncon-
strained setting, the algorithm can be simplified as
(
xt+1 = xt − 2η∇x φ(xt , yt )+η∇x φ(xt−1 , yt−1 )
yt+1 = yt + 2η∇y φ(xt , yt )−η∇y φ(xt−1 , yt−1 )
or equivalently,
(
xt+1 = xt − η∇x φ(xt , yt ) − η(η∇x φ(xt , yt ) − ∇x φ(xt−1 , yt−1 ))
yt+1 = yt + η∇y φ(xt , yt ) + η(∇y φ(xt , yt ) − ∇y φ(xt−1 , yt−1 ))
295
the proximal point algorithm for solving convex-concave minimax prob-
lems. This was initially studied by Rockafellar in 1976 [?] At each iteration,
PPA performs the update:
1 2 1 2
(xt+1 , yt+1 ) = argmin argmax φ(x, y) + kx − xt k − ky − yt k .
x∈X y∈Y 2η 2η
Note that for any η > 0, the above subproblem is strongly convex in x
and strongly concave in y, thus admitting a unique solution. In the un-
constrained case when X = Rm , Y = Rn , the PPA update can be rewritten
as the implicit update:
xt+1 = xt − η∇x φ(xt+1 , yt+1 ), yt+1 = yt + η∇y φ(xt+1 , yt+1 ).
This is a conceptual algorithm as implementing the algorithm requires
solving the SC-SC auxiliary problems at each iteration, which may not ad-
mit closed form update. EG and OGDA can be viewed as approximately
computing the implicit update:
• EG: ∇x φ(xt+1 , yt+1 ) ≈ ∇x φ(xt+ 1 , yt+ 1 )
2 2
• OGDA: ∇x φ(xt+1 , yt+1 ) ≈ ∇x φ(xt , yt )+(∇x φ(xt , yt )−∇x φ(xt−1 , yt−1 )).
Similar as in convex minimization, this approximate proximal point per-
spective can be used to design and analyze accelerated algorithms for solv-
ing minimax problems.
296
Figure 14.2: Variational inequality problem: in geometric terms, the vari-
ational inequality states that F (x∗ ) is orthogonal to the feasible set at the
point x∗ .
This is also known as the Minty Variational Inequality, which was intro-
duced in [Min62] by Minty in 1962. We call the solution to the Minty Vari-
ational Inequality as weak solution. Below we discuss the relationships
between these two solution concepts.
297
Lemma 14.26 (Exercise 81). The following statements hold:
hF (v), u − vi ≥ 0 ⇒ hF (u), u − vi ≥ 0, ∀ u, v ∈ Z .
Note that EVI (ẑ) ≥ 0 for any ẑ ∈ Z, and the inaccuracy or error vanishes
exactly at the set of weak solutions. If ẑ is a weak solution, then hF (z), ẑ −
zi ≤ 0, so EVI (ẑ) ≤ 0, which implies that EVI (ẑ) = 0.
14.5.2 Examples
Many problems of interest that we discussed in this course can be framed
as solving VIs.
min f (x)
x∈X
298
Convex-concave Saddle Point Problems. Consider the convex-concave
saddle point problem:
min max φ(x, y)
x∈X y∈Y
where φ(x, y) is convex in x for any fixed y ∈ Y and concave in y for any
fixed x ∈ X , X , Y are convex sets. Assume φ(·, ·) are also continuously
differential. Set
The operator F is monotone due to the convexity of φ(·, y) and −φ(x, ·).
Finding a saddle point of φ(x, y) is equivalent to finding a weak solution
to the corresponding Minty VI(Z, F ) with Z and F as defined above.
299
14.5.3 Algorithms for Solving VIs
In this section, we introduce algorithms for solving VIs. Let Z ⊂ Rd be a
nonempty subset and consider a mapping F : Z → Rd . The goal is to find
a solution z∗ Z that satisfies
Algorithm 9 EG
1: Initialize z1 ∈ Z
2: for t = 1, 2, . . . , T do
3: z̃t = ΠZ (zt − ηt F (zt ))
4: zt+1 = ΠZ (zt − ηt F (z̃t ))
5: end for
300
Algorithm 10 OGDA
1: Initialize z1 = z1/2 ∈ Z
2: for t = 1, 2, . . . , T do
3: zt+ 1 = ΠZ (zt− 1 − ηt F (zt ))
2 2
4: zt+1 = ΠZ (zt+ 1 − ηt F (zt ))
2
5: end for
1
V (z, z0 ) = ω(z) − ω(z0 ) − ∇ω(z0 )> (z − z0 ) ≥ ||z − z0 ||2 .
2
The Mirror Prox algorithm work as follows: initialize z1 ∈ Z and update
at each iteration t,
Note that this is not the same as two consecutive steps of the mirror
descent algorithm since the first term in the minimization, V (z, zt ) is same
in both the steps of the update. This is illustrated in Figure 14.3.
301
Theorem 14.28 ([Nem04]). Denote the diameter of the Bregman distance Ω =
maxz∈Z V (z, z1 ). The Mirror Prox algorithm with step-size γt ≤ L1 satisfies
PT
Ω γt ẑt
EVI (z̄T ) := max hF (z), z̄T − zi ≤ PT , where z̄T = Pt=1 T
.
t=1 γt t=1 γt
z∈Z
Proof. From the Bregman three-point identity and the optimality condition
for ẑt to be the solution of (14.10), we have
hγt F (zt ), ẑt − zi ≤ V (z, zt ) − V (z, ẑt ) − V (ẑt , zt ), ∀z ∈ Z. (14.12)
Similarly optimality at zt+1 for (14.11) gives
hγt F (ẑt ), zt+1 − zi ≤ V (z, zt ) − V (z, zt+1 ) − V (zt+1 , zt ), ∀z ∈ Z. (14.13)
Set z = zt+1 in (14.12) to obtain
hγt F (zt ), ẑt − zt+1 i ≤ V (zt+1 , zt ) − V (zt+1 , ẑt ) − V (ẑt , zt ). (14.14)
Combing (14.13) and (14.14), we have
hγt F (ẑt ), ẑt − zi
= hγt F (ẑt ), ẑt − zt+1 i} + hγt F (ẑt ), zt+1 − zi
= γt hF (ẑt ) − F (zt ), ẑt − zt+1 i + hγt F (zt ), ẑt − zt+1 i + hγt F (ẑt ), zt+1 − zi
≤ γt hF (ẑt ) − F (zt ), ẑt − zt+1 i − V (zt+1 , ẑt ) − V (ẑt , zt ) + V (z, zt ) − V (z, zt+1 )
Let σt = γt hF (ẑt ) − F (zt ), ẑt − zt+1 i − V (zt+1 , ẑt ) − V (ẑt , zt ). By as-
sumption of smoothness, we have kF (ẑt ) − F (zt )k∗ ≤ Lkẑt − zt k. In-
voking Cauchy-Schwatz inequality and the property of Bregman distance,
V (z, z0 ) ≥ 12 ||z − z0 ||2 , to obtain
1 1
σt ≤ γt L||zt+1 − ẑt || · ||ẑt − zt || − ||zt+1 − ẑt ||2 − ||ẑt − zt ||2 .
2 2
Since γt ≤ 1/L, we have σt ≤ 0.
Thus we have
hγt F (ẑt ), ẑt − zi ≤ V (z, zt ) − V (z, zt+1 ).
By monotonicity of F , we have hF (ẑt ), ẑt − zi ≥ hF (z), ẑt − zi. Hence,
T
X
γt hF (z), ẑt − zi ≤ V (z, z1 ), ∀z ∈ Z.
t=1
Ω
Taking maximum on both sizes leads to the desired result, EVI (z̄T ) ≤ PT
γt
.
t=1
302
Remark. If the step-size is assumed to be constant, γt = L1 , then we have
ΩL
EVI (z̄T ) ≤ .
T
Mirror Prox algorithm achieves a O(1/T ) rate of convergence for solving
VIs. EG can be viewed as a special case if setting Euclidean distance as the
Bregman divergence and achieves similar guarantees. If additional struc-
ture is available, e.g., strong monotonicity of the operator F , then linear
convergence can be obtained for EG, OGDA, and Mirror Prox algrithms.
14.6 Exercises
Exercise 79. Consider the repeated zero-sum matrix game. Suppose row player
chooses xt+ according to the gradient descent update rule at each round:
such that m
X
min max fi (x) = min yi∗ fi (x).
x∈X 1≤i≤m x∈X
i=1
303
Exercise 81. Show that the following statements hold:
304
Bibliography
[ACD+ 22] Yossi Arjevani, Yair Carmon, John C Duchi, Dylan J Foster,
Nathan Srebro, and Blake Woodworth. Lower bounds for non-
convex stochastic optimization. Mathematical Programming,
pages 1–50, 2022.
[ACGH18] Sanjeev Arora, Nadav Cohen, Noah Golowich, and Wei Hu. A
convergence analysis of gradient descent for deep linear neu-
ral networks. CoRR, abs/1810.02281, 2018.
[BB07] Léon Bottou and Olivier Bousquet. The tradeoffs of large scale
learning. Advances in neural information processing systems, 20,
2007.
305
[BEHW89] Anselm Blumer, A. Ehrenfeucht, David Haussler, and Man-
fred K. Warmuth. Learnability and the vapnik-chervonenkis
dimension. J. ACM, 36(4):929–965, 1989.
[CLSH19] Xiangyi Chen, Sijia Liu, Ruoyu Sun, and Mingyi Hong. On
the convergence of a class of adam-type algorithms for non-
convex optimization. In ICLR, 2019.
306
[Dav59] William C. Davidon. Variable metric method for minimization.
Technical Report ANL-5990, AEC Research and Development,
1959.
[Dav91] William C. Davidon. Variable metric method for minimization.
SIAM J. Optimization, 1(1):1–17, 1991.
[DBLJ14] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. Saga:
A fast incremental gradient method with support for non-
strongly convex composite objectives. In Advances in neural
information processing systems, pages 1646–1654, 2014.
[DHS11a] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgra-
dient methods for online learning and stochastic optimization.
Journal of machine learning research, 12(7), 2011.
[DHS11b] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgra-
dient methods for online learning and stochastic optimization.
Journal of machine learning research, 12(7), 2011.
[Die69] J. Dieudonneé. Foundations of Modern Analysis. Academic
Press, 1969.
[Don17] David Donoho. Fifty years of data science. Journal of Computa-
tional and Graphical Statistics, 24(6):745–766, 2017.
[DSSSC08] John Duchi, Shai Shalev-Shwartz, Yoram Singer, and Tushar
Chandra. Efficient projections onto the `1 -ball for learning in
high dimensions. In Proceedings of the 25th International Confer-
ence on Machine Learning, pages 272–279, 2008.
[ET99] Ivar Ekeland and Roger Temam. Convex analysis and variational
problems. SIAM, 1999.
[FLLZ18] Cong Fang, Chris Junchi Li, Zhouchen Lin, and Tong Zhang.
Spider: Near-optimal non-convex optimization via stochastic
path-integrated differential estimator. In Advances in Neural
Information Processing Systems, pages 689–699, 2018.
[FM91] M. Furi and M. Martelli. On the mean value theorem, in-
equality, and inclusion. The American Mathematical Monthly,
98(9):840–846, 1991.
307
[FW56] Marguerite Frank and Philip Wolfe. An algorithm for
quadratic programming. Naval Research Logistics Quarterly,
3(1-2):95–110, 1956.
308
[HS66] Philip Hartman and Guido Stampacchia. On some non-linear
elliptic differential-functional equations. 1966.
[KM72] Victor Klee and George J. Minty. How good is the simplex
algorithm? In Oliver Shisha, editor, Inequalities, III, pages 159–
175, New York, 1972. Academic Press.
[KNS16] Hamed Karimi, Julie Nutini, and Mark Schmidt. Linear Con-
vergence of Gradient and Proximal-Gradient Methods Under
the Polyak-Łojasiewicz Condition. In ECML PKDD 2016: Ma-
chine Learning and Knowledge Discovery in Databases, pages 795–
811. Springer, 2016.
309
[KPd18] Thomas Kerdreux, Fabian Pedregosa, and Alexandre
d’Aspremont. Frank-wolfe with subsampling oracle, 2018.
[LJH+ 20] Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xi-
aodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of
the adaptive learning rate and beyond. In ICLR, 2020.
[MG07] Jiřı́ Matoušek and Bernd Gärtner. Understanding and Using Lin-
ear Programming. Universitext. Springer-Verlag, 2007.
310
[Min62] George J Minty. Monotone (nonlinear) operators in hilbert
space. 1962.
[NLST17] Lam M Nguyen, Jie Liu, Katya Scheinberg, and Martin Takáč.
Sarah: A novel method for machine learning problems using
stochastic recursive gradient. In Proceedings of the 34th Inter-
national Conference on Machine Learning-Volume 70, pages 2613–
2621. JMLR. org, 2017.
311
[Noc80] J. Nocedal. Updating quasi-newton matrices with limited stor-
age. Mathematics of Computation, 35(151):773–782, 1980.
[RKK18] Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the con-
vergence of adam and beyond. In ICLR, 2018.
[RKK19] Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the con-
vergence of adam and beyond. arXiv preprint arXiv:1904.09237,
2019.
312
[ST04] Daniel A. Spielman and Shang-Hua Teng. Smoothed analysis
of algorithms: Why the simplex algorithm usually takes poly-
nomial time. J. ACM, 51(3):385–463, 2004.
[VBS19] Sharan Vaswani, Francis Bach, and Mark Schmidt. Fast and
faster convergence of sgd for over-parameterized models and
an accelerated perceptron. In The 22nd international conference
on artificial intelligence and statistics, pages 1195–1204. PMLR,
2019.
[WJZ+ 19] Zhe Wang, Kaiyi Ji, Yi Zhou, Yingbin Liang, and Vahid Tarokh.
Spiderboost and momentum: Faster variance reduction algo-
rithms. In Advances in Neural Information Processing Systems,
pages 2406–2416, 2019.
313
[WLC+ 20] Guanghui Wang, Shiyin Lu, Quan Cheng, Wei-wei Tu, and Li-
jun Zhang. Sadam: A variant of adam for strongly convex
functions. In ICLR, 2020.
[WRS+ 17] Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nati Srebro,
and Benjamin Recht. The marginal value of adaptive gradient
methods in machine learning. Advances in neural information
processing systems, 30, 2017.
[WWB19] Rachel Ward, Xiaoxia Wu, and Leon Bottou. Adagrad step-
sizes: Sharp convergence over nonconvex landscapes. In
ICML, pages 6677–6686. PMLR, 2019.
[ZRS+ 18] Manzil Zaheer, Sashank Reddi, Devendra Sachan, Satyen Kale,
and Sanjiv Kumar. Adaptive methods for nonconvex opti-
mization. NeurIPS, 31, 2018.
314