No-Regret Algorithms for Unconstrained Online Convex Optimization
Matthew Streeter, H. Brendan McMahan
Introduction
Over the past several years, online convex optimization has emerged as a fundamental tool for solving problems in machine learning (see, e.g., for an introduction). The reduction from general online convex optimization to online linear optimization means that simple and efficient (in memory and time) algorithms can be used to tackle large-scale machine learning problems. The key theoretical techniques behind essentially all the algorithms in this field are the use of a fixed or increasing strongly convex regularizer (for gradient descent algorithms, this is equivalent to a fixed or decreasing learning rate sequence). In this paper, we show that a fundamentally different type of algorithm can offer significant advantages over these approaches. Our algorithms adjust their learning rates based not just on the number of rounds, but also based on the sum of gradients seen so far. This allows us to start with small learning rates, but effectively increase the learning rate if the problem instance warrants it.
The Unconstrained Experts Problem and Portfolio Management
In the classic problem of predicting with expert advice (e.g., ), there are experts, and on each round the player selects an expert (say ), and obtains reward from a bounded interval (say $p_{t}p_{t}\cdot g_{t}$.
Our algorithms apply to an unconstrained version of this problem: there are still experts with payouts in $x_{t,i}i\sum_{i}x_{t,i}g_{t,i}=x_{t}\cdot g_{t}\mathring{x}=0$ (which equals total loss) is bounded by a constant.
It is useful to contrast our results in this setting to previous applications of online convex optimization to portfolio management, for example and . By applying algorithms for exp-concave loss functions, they obtain log-wealth within of the best constant rebalanced portfolio. However, this approach requires a “no-junk-bond” assumption: on each round, for each investment, you always retain at least an fraction of your initial investment. While this may be realistic (though not guaranteed!) for blue-chip stocks, it certainly is not for bets on derivatives that can lose all their value unless a particular event occurs (e.g., a stock price crosses some threshold). Our model allows us to handle such investments: if we play , an outcome of corresponds exactly to losing 100% of that investment. Our results imply that if even one investment (out of exponentially many choices) has significant returns, we will increase our wealth exponentially.
Notation and Problem Statement
We use the compressed summation notation for both vectors and scalars. We study the reward of our algorithms, and their regret against a fixed comparator :
Comparison of Regret Bounds
Table 1 compares the bounds for Reward-Doubling (this paper) to those of two previous algorithms: online gradient descent and projected exponentiated gradient descent . For each algorithm, we consider a fixed choice of parameter settings and then look at how regret changes as we vary the comparator point .
Gradient descent is minimax-optimal when the comparator point is contained in a hypershere whose radius is known in advance () and gradients are sparse (, top table). Exponentiated gradient descent excels when gradients are dense (, bottom table) but the comparator point is sparse ( for known in advance). In both these cases, the bounds for Reward-Doubling match those of the previous algorithms up to logarithmic factors, even when they are tuned optimally with knowledge of .
The advantage of Reward-Doubling shows up when the guess of used to tune the competing algorithms turns out to be wrong. When , Reward-Doubling offers constant regret compared to for the other algorithms. When can be arbitrary, only Reward-Doubling offers sub-linear regret (and in fact its regret bound is optimal, as shown in Theorem 8).
In order to guarantee constant origin-regret, Reward-Doubling frequently “jumps” back to playing the origin, which may be undesirable in some applications. In Section 4 we introduce Smooth-Reward-Doubling, which achieves similar guarantees without resetting to the origin.
Related Work
Our work is related, at least in spirit, to the use of a momentum term in stochastic gradient descent for back propagation in neural networks . These results are similar in motivation in that they effectively yield a larger learning rate when many recent gradients point in the same direction.
Hazan and Kale give regret bounds in terms of the variance of the . Letting and , they prove regret bounds of the form where . This result has some similarity to our work in that , and so if we hold constant, then when is low, the critical ratio that appears in our bounds is large. However, they consider the case of a known feasible set, and their algorithm (gradient descent with a constant learning rate) cannot obtain bounds of the form we prove.
Reward and Regret
In this section we present a general result that converts lower bounds on reward into upper bounds on regret, for one-dimensional online linear optimization. In the unconstrained setting, this result will be sufficient to provide guarantees for general -dimensional online convex optimization.
Consider an algorithm for one-dimensional online linear optimization that, when run on a sequence of gradients , with for all , guarantees
where and are constants. Then, against any comparator , we have
letting when . Further, any algorithm with the regret guarantee of Eq. (2) must guarantee the reward of Eq. (1).
We give a proof of this theorem in the appendix. The duality between reward and regret can also be seen as a consequence of the fact that and are convex conjugates. The term typically contains a dependence on like . This bound holds for all , and so for some small the term becomes negative; however, for real algorithms the term will ensure the regret bound remains positive. The minus one can of course be dropped to simplify the bound further.
Gradient Descent with Increasing Learning Rates
In this section we show that allowing the learning rate of gradient descent to sometimes increase leads to novel theoretical guarantees.
To build intuition, consider online linear optimization in one dimension, with gradients , all in $$. In this setting, the reward of unconstrained gradient descent has a simple closed form:
Consider unconstrained gradient descent in one dimension, with learning rate . On round , this algorithm plays the point . Letting and , the cumulative reward of the algorithm is exactly
We give a simple direct proof in Appendix A. Perhaps surprisingly, this result implies that the reward is totally independent of the order of the linear functions selected by the adversary. Examining the expression in Lemma 2, we see that the optimal choice of learning rate depends fundamentally on two quantities: the absolute value of the sum of gradients (), and the sum of the squared gradients (). If , we would like to use as large a learning rate as possible in order to maximize reward. In contrast, if , the algorithm will obtain negative reward, and the best it can do is to cut its losses by setting as small as possible.
One of the motivations for this work is the observation that the state-of-the-art online gradient descent algorithms adjust their learning rates based only on the observed value of (or its upper bound ); for example . We would like to increase reward by also accounting for . But unlike , which is monotonically increasing with time, can both increase and decrease. This makes simple guess-and-doubling tricks fail when applied to , and necessitates a more careful approach.
In this section we analyze algorithm Reward-Doubling-1D (Algorithm 1), which consists of a series of epochs. We suppose for the moment that an upper bound on is known in advance. In the first epoch, we run gradient descent with a small initial learning rate . Whenever the total reward accumulated in the current epoch reaches , we double and start a new epoch (returning to the origin and forgetting all previous gradients except the most recent one).
Applied to a sequence of gradients , all in $H=\sum_{t=1}^{T}g_{t}^{2}\leq\bar{H}$, Reward-Doubling-1D obtains reward satisfying
Suppose round occurs during the ’th epoch. Because epoch can only come to an end if , where , we have
We now lower bound . For let denote the round on which is initialized to 0, with , and define . By construction, is the total reward of a gradient descent algorithm that is active on rounds through inclusive, and that uses learning rate (note that on round , this algorithm gets 0 reward and we initialize to 0 on that round). Thus, by Lemma 2, we have that for any ,
Applying this bound to epoch , we have . Substituting into (4) gives
We now show that . At the end of round , we must have had (otherwise epoch would have begun earlier). Thus, again using Lemma 2,
so . Thus,
Rearranging gives , and combining with Eq. (5) proves the lemma. ∎
We can now apply Theorem 1 to the reward (given by Eq. (3)) of Reward-Doubling-1D to show
for any , where . When the feasible set is also fixed in advance, online gradient descent with a fixed learning obtains a regret bound of . Suppose we use the estimate . By choosing , we guarantee constant regret against the origin, (equivalently, constant total loss). Further, for any feasible set of radius , we still have worst-case regret of at most , which is only modestly worse than that of gradient descent with the optimal known in advance.
The need for an upper bound can be removed using a standard guess-and-doubling approach, at the cost of a constant factor increase in regret (see appendix for proof).
Consider algorithm Reward-Doubling-1D-Guess, which behaves as follows. On each era , the algorithm runs Reward-Doubling-1D with an upper bound of , and initial learning rate . An era ends when is no longer an upper bound on the sum of squared gradients seen during that era. Letting , this algorithm has regret at most
2 Extension to n𝑛n dimensions
To extend our results to general online convex optimization, it is sufficient to run a separate copy of Reward-Doubling-1D-Guess for each coordinate, as is done in Reward-Doubling (Algorithm 2). The key to the analysis of this algorithm is that overall regret is simply the sum of regret on one-dimensional subproblems which can be analyzed independently.
for , where and .
Fix a comparator . For any coordinate , define
This, together with the fact that , suffices to prove second inequality. ∎
In some applications, is not known in advance. In this case, we can set for the th coordinate we encounter, and get the same bound up to constant factors.
An Epoch-Free Algorithm
In this section we analyze Smooth-Reward-Doubling, a simple algorithm that achieves bounds comparable to those of Theorem 4, without guessing-and-doubling. We consider only the 1-d problem, as the technique of Theorem 5 can be applied to extend to dimensions. Given a parameter , we achieve
for all and , which is better (by constant factors) than Theorem 4 when (which implies ). The bound can be worse on a problems where .
The idea of the algorithm is to maintain the invariant that our cumulative reward, as a function of and , satisfies , for some fixed function . Because reward changes by on round , it suffices to guarantee that for any ,
where is the point the algorithm plays on round , and we assume .
This inequality is approximately satisfied (for small ) if we choose
This suggests that if we want to maintain reward at least , we should set . The following theorem (proved in the appendix) provides an inductive analysis of an algorithm of this form.
Fix a sequence of reward functions with , and let . We consider Smooth-Reward-Doubling, which plays on round and whenever ; otherwise, it plays
with a learning-rate parameter and
Then, at the end of each round , this algorithm has
Two main technical challenges arise in the proof: first, we prove a result like Eq. (8) for N(g_{1:t},t)=(1/t)\exp\big{(}|g_{1:t}|/\sqrt{t}\big{)}. However, this Lemma only holds for and when the sign of doesn’t change. We account for this by showing that a small modification to (costing only a constant over all rounds) suffices.
By running this algorithm independently for each coordinate using an appropriate choice of , one can obtain a guarantee similar to that of Theorem 5.
Lower Bounds
As with our previous results, it is sufficient to show a lower bound in one dimension, as it can then be replicated independently in each coordinate to obtain an dimensional bound. Note that our lower bound contains the factor , which can be negative when is small relative to , hence it is important to hold fixed and consider the behavior as . Here we give only a proof sketch; see Appendix A for the full proof.
Consider the problem of unconstrained online linear optimization in one dimension, and an online algorithm that guarantees origin-regret at most . Then, for any fixed comparator , and any integer , there exists a gradient sequence of length for which the algorithm’s regret satisfies
(Sketch) Assume without loss of generality that . Let be the algorithm’s reward when each is drawn independently uniformly from . We have , and because the algorithm guarantees origin-regret at most , we have with probability 1. Letting , it follows that for any threshold ,
We choose , where . Here and is a constant chosen using binomial distribution lower bounds so that . This implies
This implies there exists a sequence with and . On this sequence, regret is at least . ∎
For each coordinate , Theorem 7 implies that there exists a and a sequence of gradients such that
(The proof of Theorem 7 makes it clear that we can use the same for all .) Summing this inequality across all coordinates then gives the regret bound stated in the theorem. ∎
The following theorem presents a stronger negative result for Follow-the-Regularized-Leader algorithms with a fixed regularizer: for any such algorithm that guarantees origin-regret at most after rounds, worst-case regret with respect to any point outside grows linearly with .
Consider a Follow-The-Regularized-Leader algorithm that sets
where is a convex, non-negative function with . Let be the maximum origin-regret incurred by the algorithm on a sequence of gradients. Then, for any with , there exists a sequence of gradients such that the algorithm’s regret with respect to is at least .
In fact, it is clear from the proof that the above result holds for any algorithm that selects purely as a function of (in particular, with no dependence on ).
Future Work
This work leaves open many interesting questions. It should be possible to apply our techniques to problems that do have constrained feasible sets; for example, it is natural to consider the unconstrained experts problem on the positive orthant. While we believe this extension is straightforward, handling arbitrary non-axis-aligned constraints will be more difficult. Another possibility is to develop an algorithm with bounds in terms of rather than that doesn’t use a guess and double approach.
References
Appendix A Proofs
This appendix gives the proofs omitted in the body of the paper, with the corresponding lemmas and theorems restated for convenience.
Consider an algorithm for one-dimensional online linear optimization that, when run on a sequence of gradients , with for all , guarantees
where and are constants. Then, against any comparator , we have
letting when . Further, any algorithm with the regret guarantee of Eq. (2) must guarantee the reward of Eq. (1).
Let . By definition, given the reward guarantee of Eq. (1) we have
If , then Eq. (2) follows immediately. Otherwise, note this is a concave function in , and setting the first derivative equal to zero shows
maximizes regret (for large enough we could have , and so this is not actually achievable by the adversary, but this is fine for lower bounding regret). Plugging into Eq. (11) and simplifying yields the bound of Eq. (2). For the second claim, suppose Eq. (2) holds. Then, again by definition, we must have
This bound is a concave function of , and since it holds for any by assumption, we can choose the that maximizes the bound, namely . Note
and so plugging into Eq. (12) yields
Consider unconstrained gradient descent in one dimension, with learning rate . On round , this algorithm plays the point . Letting and , the cumulative reward of the algorithm is exactly
The algorithm’s cumulative reward after rounds is
To verify the second equality, note that , so on round the right hand side increases by , as does the left hand side. The equality then follows by induction on . ∎
It is worth noting that the standard bound can be derived from the above result fairly easily. We have
where the max is achieved by taking . Taking then gives the standard bound. However, this bound significantly underestimates the performance of constant-learning-rate gradient descent when is large. This is in contrast to our regret bounds, which are always tight with respect to their matching reward bounds.
Consider algorithm Reward-Doubling-1D-Guess, which behaves as follows. On each era , the algorithm runs Reward-Doubling-1D with an upper bound of , and initial learning rate . An era ends when is no longer an upper bound on the sum of squared gradients seen during that era. Letting , this algorithm has regret at most
Suppose round occurs in era , and let be the round on which era starts, with . Define . To prove the theorem we will need several inequalities. First, note that , or . Thus,
Note that the bound of Lemma 3 applies for all where , and thus so does Eq. (6). Thus, we can apply this bound to the regret in era on rounds through , as well as on the regret in each earlier era. Then, total regret with respect to the best point in is at most the sum of the regret in each era, so
Finally, because , we have , which completes the proof. ∎
Fix a sequence of reward functions with , and let . We consider Smooth-Reward-Doubling, which plays on round and whenever ; otherwise, it plays
with a learning-rate parameter and
Then, at the end of each round , this algorithm has
We present a proof for the case where ; since simply scales all of the played by the algorithm (and hence, reward), the result for general follows immediately. We use the minimum reward function
The proof will be by induction on , with the induction hypothesis that the cumulative reward of the algorithm at the end of round satisfies
We will then show that the sum of ’s is always bounded by a constant.
For the base case, , we play so end the round with zero reward, while the RHS of Eq. (15) is .
Now, suppose the induction hypothesis holds at the end of some round . Without loss of generality, suppose so . We consider two cases. First, suppose and (so ). In this case, does not change sign when we add ; thus, an invariant like that of Eq. (8) is sufficient; we prove such a result in Lemma 10 (given below). More precisely, we play according to Eq. (9), and
For the remaining case, we have , implying . In this case, we suffer some loss and arrive at . Lemma 11 (below) provides the key bound on the additional loss when the sign of changes. If , we have
If , we can take non-positive without loss of generality, and playing is no worse than playing , and so we conclude Eq. (15) holds for all . Finally,
where is the Euler gamma constant and is the exponential integral. The upper bound can be found easily using numerical methods. Adding gives for any . ∎
Let and . Then, for any such that ,
where is defined by Eq. (14) and is defined by Eq. (10).
or equivalently, multiplying by ,
Since , the term is maximized when , so
Now, we consider the case where . In order to show in this case, we need a tight upper bound on for . To derive one, we note that for , from the series representation of , and so . Thus, for we have . Then, starting from Eq. (16),
Let . Because and have the same sign, it suffices to show . We have
Since , we have , and , and so we conclude that is increasing in , and so taking we have
Taking the derivative with respect to reveals this expression is increasing in , and taking produces a positive value, proving this case. ∎
For any and such that , and any ,
where is defined by Eq. (14) and is defined by Eq. (10), and
Consider a Follow-The-Regularized-Leader algorithm that sets
where is a convex, non-negative function with . Let be the maximum origin-regret incurred by the algorithm on a sequence of gradients. Then, for any with , there exists a sequence of gradients such that the algorithm’s regret with respect to is at least .
For simplicity, we will prove that regret is at least when is even; if is odd, we simply take and consider the first rounds.
Let . We will consider two gradient sequences. First, suppose for , and otherwise. Observe that for any , we have , which implies . Thus, the algorithm’s total reward is
Because , we get that on this sequence the algorithm has origin-regret , and so by assumption .
Next, suppose for , and otherwise. For this sequence, we will have for all , so total reward is at most . For any positive with , this means that regret with respect to is at least
For , we can use a similar argument with the sign of the gradients reversed (for both gradient sequences) to get the same bound. ∎
In proving Theorem 7, we will use the following lemma.
Let be the sum of random variables, each drawn uniformly from . Then, for any integer that is a factor of , we have
First, for any define , and define
For any , we have trivially, and by the Central Limit Theorem, , where is the standard normal cumulative distribution function. It follows that , and using numerical methods we find .
Now, divide the length sequence into sequences of length . Let be the sum of gradients for the th of these sequences. Observe that if for all , then . Furthermore, for any , we have
Consider the problem of unconstrained online linear optimization in one dimension, and an online algorithm that guarantees origin-regret at most . Then, for any fixed comparator , and any integer , there exists a gradient sequence of length for which the algorithm’s regret satisfies
Let , and choose large enough so that and also so that is a multiple of (the latter is possible since grows much more slowly than ). Let be the algorithm’s reward when each is drawn uniformly from . Let . As shown in the proof sketch, we have
By Lemma 12, . Thus,
If the algorithm guaranteed whenever , then we would have , a contradiction. Thus, there exists a sequence where and , so on this sequence we have
Because , we have or , so regret is at least , where (and is the constant from Lemma 12). ∎