Black-Box Reductions for Parameter-free Online Learning in Banach Spaces
Ashok Cutkosky, Francesco Orabona
Parameter Free Online Learning
Our primary contribution is a series of three reductions that simplify the design of parameter-free algorithms,The name “parameter-free” was first used by Chaudhuri et al. for an expert algorithm that does not need to know the entropy of the competitor to achieve the optimal regret bound for any competitor. that is algorithms whose regret bound is optimal without the need to tune parameters (e.g. learning rates). First, we show that algorithms for online exp-concave optimization imply parameter-free algorithms for OLO (Section 2). Second, we show a general reduction from online learning in arbitrary dimensions with any norm to one-dimensional online learning (Section 3). Finally, given any two convex sets , we construct an online learning algorithm over from an online learning algorithm over (Section 4).
First, we use our reductions to design a new parameter-free algorithm that improves upon the prior regret bounds, achieving
Notation. The dual of a Banach space over a field , denoted , is the set of all continuous linear maps . We will use the notation to indicate the application of a dual vector to a vector . is also a Banach space with the dual norm: . For completeness, in Appendix A we recall some more background on Banach spaces.
Online Newton Step to Online Linear Optimization via Betting Algorithms
In this section we show how to use the Online Newton Step (ONS) algorithm to construct a 1D parameter-free algorithm. Our approach relies on the coin-betting abstraction for the design of parameter-free algorithms. Coin betting strategies record the wealth of the algorithm, which is defined by some initial (i.e. user-specified) plus the total “reward” it has gained:
Given this wealth measurement, coin betting algorithms “bet” a signed fraction of their current wealth on the outcome of the “coin” by playing , so that . The advantage of betting algorithms lies in the fact that high wealth is equivalent to a low regret , but lower-bounding the wealth of an algorithm is conceptually simpler than upper-bounding its regret because the competitor does not appear in (1). Thus the question is how to pick betting fractions that guarantee high wealth. This is usually accomplished through careful design of bespoke potential functions and meticulous algebraic manipulation, but we take a different and simpler path.
At a high level, our approach is to re-cast the problem of choosing betting fractions as itself an online learning problem. We show that this online learning problem has exp-concave losses rather than linear losses. Exp-concave losses are known to be much easier to optimize than linear losses and it is possible to obtain regret rather than the limit for linear optimization . So by using an exp-concave optimization algorithm such as the Online Newton Step (ONS), we find the optimal betting fraction very quickly, and obtain high wealth. The pseudocode for the resulting strategy is in Algorithm 1.
Later (in Section 7), we will see that this same 1D argument holds seamlessly in Banach spaces, where now the betting fraction is a vector in the Banach space and the outcome of the coin is a vector in the dual space with norm bounded by 1. We therefore postpone computing exact constants for the Big-O notation in Theorem 1 to the more general Theorem 8.
It is important to note that ONS in 1D is extremely simple to implement. Even the projection onto a bounded set becomes just a truncation between two real numbers, so that Algorithm 1 can run quickly. We can show the following regret guarantee:
For , Algorithm 1, guarantees the regret bound:
Define to be wealth of the betting algorithm that bets the constant (signed) fraction on every round, starting from initial wealth .
We begin with the regret-reward duality that is the start of all coin-betting analyses . Suppose that we obtain a bound for some . Then,
where indicates the Fenchel conjugate, defined by .
So, now it suffices to prove a wealth lower bound. First, observing that , we derive a simple expression for by recursion:
Similarly, we have . We subtract the identities to obtain
where is the regret of our method for choosing .
For the next step, observe that is exp-concave (a function is exp-concave if is concave), so that choosing is an online exp-concave optimization problem. Prior work on exp-concave optimization allows us to obtain for any using the ONS algorithm. Therefore (dropping all constants for simplicity), we use (3) to obtain for all .
Finally, we need to show that there exists such that is high enough to guarantee low regret on our original problem. Consider . Then, we invoke the tangent bound for (e.g. see ) to see:
where . To obtain the desired result, we recall that implies , and calculate (see Lemma 19).
In order to implement the algorithm, observe that our reference betting fraction lies in , so we can run ONS restricted to the domain . Exact constants can be computed by substituting the constants coming from the ONS regret guarantee, as we do in Theorem 8. ∎
From 1D Algorithms to Dimension-Free Algorithms
A common strategy for designing parameter-free algorithms is to first create an algorithm for 1D problems (as we did in the previous section), and then invoke some particular algorithm-specific analysis to extend the algorithm to high dimensional spaces [23; 6; 20]. This strategy is unappealing for a couple of reasons. First, these arguments are often somewhat tailored to the algorithm at hand, and so a new argument must be made for a new 1D algorithm (indeed, it is not clear that any prior dimensionality extension arguments apply to our Algorithm 1). Secondly, all such arguments we know of apply only to Hilbert spaces and so do not allow us to design algorithms that consider norms other than the standard Euclidean -norm. In this section we address both concerns by providing a black-box reduction from optimization in any Banach space to 1D optimization. In further contrast to previous work, our reduction can be proven in just a few lines.
Given these inputs, the reduction uses the 1D algorithm to learn a “magnitude” and the unit-ball algorithm to learn a “direction” . This direction and magnitude are multiplied together to form the final output . Given a gradient , the “magnitude error” is given by , which is intuitively the component of the gradient parallel to . The “direction error” is just . Our reduction is described formally in Algorithm 2.
Where by slight abuse of notation we set when . Further, the subgradients sent to satisfy .
First, observe that since for all . Now, compute:
With this reduction in hand, designing dimension-free and parameter-free algorithms is now exactly as easy as designing 1D algorithms, so long as we have access to a unit-ball algorithm . As mentioned, for any Hilbert space we indeed have such an algorithm. In general, algorithms exist for most other Banach spaces of interest , and in particular one can achieve whenever is -uniformly convex using the Follow-the-Regularized-Leader algorithm with regularizers scaled by .
Applying Algorithm 2 to our 1D Algorithm 1, for any -uniformly convex , we obtain:
Not only does this provide the fastest known parameter-free algorithm for an arbitrary norm, it is also the first parameter-free algorithm to obtain a dependence on the gradients of rather than Independently, achieved the same runtime in the supervised prediction setting, but with no adaptivity to .. This improved bound immediately implies much lower regret in easier settings, such as smooth losses with small loss values at .
Reduction to Constrained Domains
The previous algorithms have dealt with optimization over an entire vector space. Although common and important case in practice, sometimes we must perform optimization with constraints, in which each and the comparison point must lie in some convex domain that is not an entire vector space. This constrained problem is often solved with the classical Mirror Descent or Follow-the-Regularized-Leader analysis. However, these approaches have drawbacks: for unbounded sets, they typically maintain regret bounds that have suboptimal dependence on , or, for bounded sets, they depend explicitly on the diameter of . We will address these issues with a simple reduction. Given any convex domain and an algorithm that maintains regret for any , we obtain an algorithm that maintains for any in .
Before giving the reduction, we define the distance to a convex set as as well as the projection to as . Note that if is reflexive,All Hilbert spaces and finite-dimensional Banach spaces are reflexive. and that it is a singleton if is a Hilbert space [16, Exercise 4.1.4].
The intuition for our reduction is as follows: given a vector from , we predict with any . Then give a subgradient at of the surrogate loss function , which is just the original linearized loss plus a multiple of . The additional term serves as a kind of Lipschitz barrier that penalizes for predicting with any . Pseudocode for the reduction is given in Algorithm 3.
Assume that the algorithm obtains regret for any . Then Algorithm 3 guarantees regret:
Before proving this Theorem, we need a small technical Proposition, proved in Appendix D.
is convex and -Lipschitz for any closed convex set in a reflexive Banach space .
We conclude this section by observing that in many cases it is very easy to compute an element of and a subgradient of . For example, when is a unit ball, it is easy to see that and for any not in the ball. In general, we provide the following result that often simplifies computing the subgradient of (proved in Appendix D):
Let be a reflexive Banach space such that for every , there is a unique dual vector such that and . Let a closed convex set. Given and , let . Then .
Reduction for Multi-Scale Experts
In this section, we apply our reductions to the multi-scale experts problem considered in [9; 1]. Our algorithm improves upon both prior algorithms: the approach of has a mildly sub-optimal dependence on the prior distribution, while the approach of takes time per update, resulting in a quadratic total runtime. Our algorithm matches the regret bound of while running in the same time complexity as online gradient descent.
We accomplish this through two reductions. First, given any distribution and any family of 1-dimensional OLO algorithms that guarantees on 1-Lipschitz losses for any given (such as our Algorithm 1 or many other parameter-free algorithms), we apply the classic “coordinate-wise updates” trick to generate an -dimensional OLO algorithm with regret on losses that are -Lipschitz with respect to the -norm.
Suppose for any , guarantees regret
for 1-dimensional losses bounded by . Then Algorithm 4 guarantees regret
With this in hand, notice that applying our reduction Algorithm 3 with the -norm easily yields an algorithm over the probability simplex with the same regret (up to a factor of 2), as long as . Then, we apply an affine change of coordinates to make our multi-scale experts losses have , so that applying this algorithm yields the desired result (see Algorithm 5).
If satisfies for all and and satisfies the conditions of Theorem 5, then, for any in the probability simplex, Algorithm 5 satisfies the regret bound
In Appendix E we show how to compute the projection and a subgradient of in time via a simple greedy algorithm. As a result, our entire reduction runs in time per update.
Reduction to Adapt to Curvature
In this section, we present a black-box reduction to make a generic online learning algorithm over a Banach space adaptive to the curvature of the losses. Given a set of diameter , our reduction obtains regret on online -strongly convex optimization problems, but still guarantees regret for online linear optimization problems, both of which are only log factors away from the optimal guarantees. We follow the intuition of , who suggest adding a weighted average of previous s to the outputs of a base algorithm as a kind of “momentum” term. We improve upon their regret guarantee by a log factor and by the terms instead of . More importantly, their algorithm involves an optimization step which may be very slow for most domains (e.g. the unit ball). In contrast, thanks to our fast reduction in Section 4, we keep the same running time as the base algorithm. Finally, previous results for algorithms with similar regret (e.g. [7; 30]) show logarithmic regret only for stochastic strongly convex problems. We give a two-line argument extending this to the adversarial case as well.
Let be an online linear optimization algorithm that outputs in response to . Suppose is a convex closed set of diameter . Suppose guarantees for all and :
for constants , and and independent of . Then for all , Algorithm 6 guarantees
Where we have used .
Banach-space betting through ONS
Let be a -dimensional real Banach space and be an arbitrary unit vector. Then, there exists a linear operator such that using the Algorithm 7, we have for any ,
The main particularity of this bound is the presence of the terms rather than the usual . We can interpret this bound as being adaptive to any sequence of norms because . A similar kind of “many norm adaptivity” was recently achieved in , which competes with the best fixed norm (or the best fixed norm in any finite set). Our bound in Theorem 8 is a factor of worse,The dependence on is unfortunately unimprovable, as shown by . but we can compete with any possible sequence of norms rather than with any fixed one.
Conclusions
We have introduced a sequence of three reductions showing that parameter-free online learning algorithms can be obtained from online exp-concave optimization algorithms, that optimization in a vector space with any norm can be obtained from 1D optimization, and that online optimization with constraints is no harder than optimization without constraints. Our reductions result in simpler arguments in many cases, and also often provide better algorithms in terms of regret bounds or runtime. We therefore hope that these tools will be useful for designing new online learning algorithms.
Acknowledgments
This material is based upon work partly supported by the National Science Foundation under grant no. 1740762 “Collaborative Research: TRIPODS Institute for Optimization and Learning” and by a Google Research Award for FO.
References
Appendix
In Section A we collect some background information about Banach spaces, their duals, and other properties.
In Section B we provide an analysis of the ONS algorithm in Banach spaces that is useful for proving Theorem 8.
In Section C we apply this analysis of ONS in Banach spaces to prove Theorem 8, and provide the missing Fenchel conjugate calculation required to prove Theorem 1, which are our reductions from parameter-free online learning to Exp-concave optimization.
In Section D we prove Proposition 1, used in our reduction from constrained optimization to unconstrained optimization in Section 4. In this section we also prove Theorem 4, which simplifies computing subgradients of in many cases.
In Section E we show how to compute and a subgradient of on time for use in our multi-scale experts algorithm.
Finally, in Section F we prove Theorem 7, our regret bound for an algorithm that adapts to stochastic curvature.
Appendix A Banach Spaces
Given any vector space , there is a natural injection given by . When this injection is an isomorphism of Banach spaces, then the space is called reflexive. All finite-dimensional Banach spaces are reflexive.
Given any linear map of Banach spaces , we define the adjoint map by . has the property (by definition) that . As a special case, if is a reflexive Banach space and , then we can use the natural identification between and to view as . Thus, in this case it is possible to have , in which case we call self-adjoint.
We define a Banach space as uniformly convex if :
From this definition, we can see that if is uniformly convex, then is a -strongly convex function with respect to :
Let a convex function that satisfies
Then, satisfies for any subgradient . In particular for , is strongly convex with respect to .
that implies . So that as desired. ∎
Let be a uniformly convex Banach space, then is -strongly convex.
Let and . Then, from the definition of uniformly convex Banach space, we have
Using Lemma 9, we have the stated bound. ∎
Appendix B Proof of the regret bound of ONS in Banach spaces
First, we need some additional facts about self-adjoint operators. These are straight-forward properties in Hilbert spaces, but may be less familiar in Banach spaces so we present them below for completeness.
Suppose and are Banach spaces and is invertible. Then, is invertible and .
Let . Let . Recall that by definition . Then we have
where we used the definition of adjoint twice. Therefore, and so . ∎
Suppose is a reflexive Banach space and is such that
for some vectors . Then .
Let . Since is reflexive, corresponds to the function . Now, we compute:
Suppose , is a -dimensional real Banach space, are a basis for and are elements of . Then, defined by is invertible and self-adjoint, and for all .
First, is self-adjoint by Proposition 5.
Next, we show is invertible. Suppose otherwise. Then, since and are both -dimensional, must have a non-trivial kernel element . Therefore,
so that for all . Since the form a basis for , this implies for all , which implies . Therefore, has no kernel and so must be invertible.
Finally, observe that since (5) holds for any , we must have if . ∎
Now we state the ONS algorithm in Banach spaces and prove its regret guarantee:
Using the notation of Algorithm 8, suppose for some basis and that is -dimensional. Then for any ,
First, observe by Proposition 6 that is invertible and self-adjoint for all .
Now, define so that . Then, we have
where in the last line we used and . We now use the Lemma 8 from , extended to Banach spaces thanks to the last statement of Proposition 6, to have
It remains to choose properly and analyze the sum In order to do this, we introduce the concept of an Auerbach basis (e.g. see Theorem 1.16):
Let be a -dimensional Banach space. Then there exists a basis of of and a basis of such that for all and . Any bases and satisfying these conditions is called an Auerbach basis.
We will use an Auerbach basis to define , and also to provide a coordinate system that makes it easier to analyze the sum .
Suppose is -dimensional. Let and be an Auerbach basis for . Set . Define as in Algorithm 7. Then, for any , the following holds
First, we show that . To see this, observe that for any ,
Since , these maps respect the action of dual vectors in . That is,
Further, since each , we have
Further, when written as a matrix, the th element of is
These maps all commute properly: for any and , and similarly for any and . It follows that for any as well.
Now, let’s calculate :
so that the matrix is the identity.
Finally, if is the map , then a simple calculation shows
With these details described, recall that we are trying to bound the sum
We have and
where in the second inequality we used the fact that the determinant is maximized when all the eigenvalues are equal to . ∎
For completeness, we also state the regret bound and the setting of the parameters and to obtain a regret bound for exp-concave functions. Note that we use a different settings in Algorithms 1 and 7, tailored to our specific setting.
Suppose we run Algorithm 7 on exp-concave losses. Let be the diameter of the domain and for all the in . Then set and . Then
First, observe that classic analysis of exp-concave functions [12, Lemma 3] shows that for any ,
Therefore, by Theorems 11 and 13, we have
Substitute our values for and to conclude
where in the last line we used . ∎
Appendix C Proofs of Theorems 1 and 8
Now, observe that since and , as well so that . Further, since and , . Therefore, by Lemma 15 we have
where we have used . Then observe that so that . Finally, substitute the specified value of and numerically evaluate to conclude the bound. ∎
Now, we collect some Fenchel conjugate calculations that allow us to convert our wealth lower-bounds into regret upper-bounds:
Let , where . Then
Let , where and . Then
Case . In this case, we have that , so
where the last inequality is from Lemma 18 in .
Case . In this case, we have that , so
where the last inequality is from Lemma 18.
Considering the max over the two cases gives the stated bound. ∎
Let be an arbitrary unit vector and for . Then
Recall that for . Then, we compute
Choose . Then, clearly . Thus, we have
Let be an arbitrary unit vector in and . Then, using the Algorithm 7, we have
Let’s compute a bound on our wealth, . We have that
where we have used the calculation of Fenchel conjugate of from Lemma 19. Then observe that to conclude:
Given some , set and . Then observe that and apply the previous Lemma 21 to conclude the desired result. ∎
Appendix D Proof of Proposition 1 and Theorem 4
Let , , , and . Then
For the Lipschitzness, let and , and observe that
Similarly, let , such that and , then
So that . ∎
Now we restate and prove Theorem 4: See 4
Let . Then clearly . Since is 1-Lipschitz, and so .
Suppose . Then . Therefore, . Since , we must have and . By assumption, this uniquely specifies the vector . Since is not the empty set, . ∎
In this section we show how to compute and a subgradient of in Algorithm 5. First we tackle . Without loss of generality, assume the are ordered so that . We also consider instead of . Obviously we are particularly interested in the case , but working in this mild generality allows us to more easily state an algorithm for computing in a recursive manner.
Let and , and let . Suppose the are ordered so that . Then for any , there exists a such that
First, suppose . Then clearly there is only one element of and so the choice of is forced. So now assume .
Let be such that is as small as possible (such a point exists because is compact).
We consider three cases: either or .
Case 1: . Suppose . Let be the largest index such that . since . Choose . Then let be such that , and otherwise. Then by definition of , and . Further, so that . However, since . Therefore, , but , contradicting our choice of . Therefore, .
Case 2: . This case is very similar to the previous case. Suppose . Let be the largest index such that . since otherwise , which is not possible. Choose . Set such that , . Then, again we have and so that , but . Therefore, we cannot have and so .
Case 3: . Suppose . Then by the same the argument as for Case 1, there is some such that for any , we can construct with and . Therefore, .
Similarly, if , then by the same argument as for Case 2, there is some such that for any , we again construct with and . Therefore, . ∎
This result suggests an explicit algorithm for choosing . Using the Proposition we can pick such that there is a with first coordinate . If has first coordinate , then if , then . Therefore, we can use a greedy algorithm to choose each in increasing order of and obtain a point in time. This procedure is formalized in Algorithm 9.
Unfortunately, does not satisfy the hypotheses of Theorem 4 and so we need to do a little more work to compute a subgradient.
Let be the output of Algorithm 9 on input . Then if , . Let be the smallest index such that , where is defined in Algorithm 9. There exists a subgradient such that
We start with a few reductions. First, we show that by a small perturbation argument we can assume . Next, we show that it suffices to prove that is linear on a small ball near . Then we go about proving the Proposition for that ball, which is the meat of the argument.
Before we start the perturbation argument, we need a couple observations about . First, observe that for all .
Next, we show that either have , or . If , then by inspection of the Algorithm 9, we must have and or . If , then we have . This implies , which contradicts our choice of as the smallest index with . Therefore, we must have . Therefore, we must have , or .
Now, we show that we may assume . Let . If , set . Otherwise, set . By inspecting Algorithm 9, we observe that the output on is unchanged from the output on , and is still the smallest index such that .
We claim that it suffices to prove for all rather than . To see this, observe that by 1-Lipschitzness, , so that if , then for any ,
By taking , we see that must be a subgradient of at if for all . This implies that if we prove the Proposition for any , which has , we have proved the proposition for .
Following this perturbation argument, for the rest of the proof we consider only the case .
Therefore, is a subgradient of at .
Next, we turn to identifying the particular ball we will work with. Let
Clearly, is on the boundary of . Now, we proceed to show that is linear on the interior of , which will prove the Proposition by the above discussion.
Let be an element of . We will compute by computing the output of running Algorithm 9 on . We will also refer to the internally generated variables as to distinguish between the s generated when computing versus when computing . The overall strategy is to show that all of the conditional branches in Algorithm 9 will evaluate to the same branch on as on .
Specifically we show the following claim by induction:
First we do the base case. Observe that . Then we consider three cases, either , , or . These cases correspond to , , or .
Case 1 (): Since , we have . Therefore, by inspecting the condition blocks in Algorithm 9, and .
Case 2 (): Since , we have . Therefore, . Since , so that . This implies and
Case 3 (): In this last case, observe that so that . This implies and .
The values for can also be checked via the casework. First, suppose . Then we must have (because we assume by our perturbation argument). Therefore, and the base case is true.
When , then we consider the cases and . The case does not occur because . When , then by the above casework we must have and . Therefore,
where we have used to conclude .
When , we have , and by the above casework we have and . Thus . This concludes the base case of the induction.
Now, we move on to the inductive step. Suppose the claim holds for all . To show the claim also holds for , we consider the three cases , and separately:
Case 1 (): We must consider two sub-cases, either , or . The case does not occur because .
Case 1a (): In this case, we have and . By definition, so that . Then by inspection of Algorithm 9, so that . By the induction assumption, this implies
Also, and also
Finally, since and , we have
Thus all parts of the claim continue to hold.
Case 1b (): In this case we show that . Observe that and . By definition again, , and also , so that . Finally, since ,
Therefore, so that and
where the last equality uses the induction assumption. Now, since for all , this implies . Further, and by the inductive assumption, so that as desired. Finally, since and , .
Case 2 (): First we show that , which implies , and then we prove the expression for . Since , we must have either either or .
If , then the claim is immediate by inspection of Algorithm 9. So suppose . By the inductive assumption, . Now, we observe that , which implies
Next, observe that to conclude
Therefore, , so that .
It remains to compute . By the induction assumption, we have
Observe that since for all . Now, since for , we have
Now, since , and , we have by definition so that
where in the last line we have used . Therefore, we have
Since by inductive hypothesis, we must have as desired. Further, observe that as observed in the beginning of the proof, for all as well so that we have . Finally, if , we have since so that . Therefore, we can conclude
Since , and this is the desired form for .
From the expression for we see that if is given by
then . Finally, observe that our perturbation has the property if to prove the Proposition. ∎
Appendix F Proof of Theorem 7
We re-state Theorem 7 below for reference: See 7
To prove the theorem, we are going to show for any ,
Observe that, by triangle inequality and the definition of dual norm, for all and , with equality when . Hence, we have
for all , where in the last inequality we used Proposition 1. Using this inequality with the regret guarantee of , we have
Note that the first term is exactly what we want, so we only have to upper bound the second one. This is readily done through Lemma 22 that immediately gives us the stated result. ∎
Under the hypotheses of Theorem 7, we have
where and .
where in the first inequality we have used the fact that the domain is bounded.
Now, we relate to :
So, putting together the last inequalities, we have
We now focus on the the term that is easily bounded:
where in the last inequality we used the well-known inequality .
where the third equality comes from bias-variance decomposition and the fourth one comes from (10). Hence, we have
Putting all together, we have the stated bound. ∎