Using More Data to Speed-up Training Time
Shai Shalev-Shwartz, Ohad Shamir, Eran Tromer
Introduction
Machine learning are now prevalent in a large range of scientific, engineering and every-day tasks, ranging from analysis of genomic data, through vehicle and aircraft control to locating information on the web and providing users with personalized recommendations. Meanwhile, our world has become increasingly “digitized” and the amount of data available for training is dramatically increasing. By now, we have a rather clear understanding of how more data can be used to improve the accuracy of learning algorithms. In this paper we study how more data can be beneficiary for constructing more efficient learning algorithms.
Roughly speaking, one way to show how more data can reduce the training runtime is as follows. Consider learning by finding a hypothesis in the hypothesis class that minimizes the training
error. In many situations, this search problem is computationally hard. One can circumvent the hardness by replacing the original hypothesis class with a different (larger) hypothesis class, such that the search problem in the larger class is computationally easier (e.g., the search problem in the new hypothesis class reduces to a convex optimization problem). On the flip side, from the statistical point of view, the estimation error in the new hypothesis class might be larger than the estimation error in the original class, and thus, with a small number of examples, learning the larger class might lead to overfitting even though the same amount of examples suffices for the original hypothesis class. However, having more training examples keeps the overfitting in check. In particular, if the number of extra examples we need for learning the new class is only polynomially larger than the original number of examples, we end up with an efficient algorithm for the original problem. If, however, we don’t have those extra examples, our only option is to learn the original hypothesis class, which may be computationally harder.
The goal of this paper is to present a formal model for studying the runtime of learning algorithms as a function of the available number of examples. After defining the formal model, we present a binary classification learning problem for which we can provably (based on standard cryptographic assumption) demonstrate an inverse dependence of the runtime on the number of examples. While there have been previous constructions which demonstrated a similar phenomenon, assuming the existence of a “perfect” hypothesis, we show this in the much more natural agnostic model of learning. A possible criticism is that our learning problem is still rather synthetic. We continue with presenting several learning problems, which arise in natural settings, that have more efficient algorithms by relying on the availability of more training data. Some of these examples are based on the intuition of Figure 1, but some are also based on other ideas and techniques. However, for all these problems, the analysis is based on upper bounds without having matching lower bounds. This raises several interesting open problems.
were the first to jointly study the computational and sample complexity, and to show that a tradeoff between runtime and sample size exists. In particular, they distinguish between the information theoretic sample complexity of a class and its computational sample complexity, the latter being the number of examples needed for learning the class in polynomial time. They presented a learning problem which is not efficiently learnable from a small training set, and is efficient learnable from a polynomially larger training set. showed that for a concept class composed of -decision-lists over , which can be learned inefficiently using examples, no algorithm can learn it efficiently using examples, and there is an efficient algorithm using examples. The construction was also extended to decision-lists, . with larger gaps.
In contrast to , which focused on learning under the realizable case (namely, that the labels are generated by some hypothesis in the class), we mostly focus on the more natural agnostic setting, where any distribution over the example domain is possible, and there may be no hypothesis in our class that never errs. This is not just a formality - in both , the construction crucially relies on the fact that the labels are provided by some hypothesis in the class. In terms of techniques, we rely on the cryptographic assumption that one-way permutations exist, which is the same assumption as in and similar to the assumption in . We note that cryptographic assumptions are common in proving lower bounds for efficient learnability, and in some sense they are even necessary . However, our construction is very different. For example, in both , revealing information on the identity of the “correct” hypothesis is split among many different examples. Therefore, efficient learning is possible after sufficiently many examples are collected, which then allows us to return the “correct” hypothesis. In our agnostic setting, there is no “correct” hypothesis, so this kind of approach cannot work. Instead, our efficient learning procedure computes and returns an improper predictor, which is not in the hypothesis class at all.
A potential weaknesses of our example, as well as the example given in , is that our hypothesis class does not consist of “natural” hypotheses. The class employed in is more natural, but it is also a very carefully constructed subset of decision lists. The goal of the second part of the paper is to demonstrate gaps (though based on upper bounds) for natural learning problems.
Another contribution of our model is that it captures the exact tradeoff between sample and computational complexity rather then only distinguishing between polynomial and non-polynomial time, which may not be refined enough. Bottou and Bousquet initiated a study on learning in the data laden domain – a scenario in which data is plentiful and computation time is the main bottleneck. This is the case in many real life applications nowadays. Shalev-Shwartz and Srebro continued this line of research and showed how for the problem of training Support Vector Machines, a joint statistical-computational analysis reveals how the runtime of stochastic-gradient-descent can potentially decrease with the number of training examples. However, this is only demonstrated via upper bounds. More importantly, the advantage of having more examples only improves running time by constant factors. In this paper, we will be interested in larger factors of improvement, which scale with the problem size.
Formal Model Description
A learning algorithm, , receives a training set of examples, , which are assumed to be sampled i.i.d. from an unknown distribution over the problem domain . Using the training data, together with any prior knowledge or assumptions about the distribution , the learner forms a prediction rule. The predictor is a random variable and we denote it by . The goal of the learner is to find a prediction rule with low generalization error (a.k.a. risk), defined as the expected loss:
where when no satisfies the above constraint we set . Thus, measures the required runtime to learn the class with an excess error of given a budget of training examples. Studying this function can show us how more data can be used to decrease the required runtime of the learning algorithm. The minimum value of for which is the information-theoretic sample complexity. This corresponds to the case in which we ignore computation time. The other extreme case is the value of . This corresponds to the data laden domain, namely data is plentiful and computation time is the only bottleneck.
To illustrate how more data can reduce runtime, consider the problem of learning the class of -term disjunctive normal form (DNF) formulas in the realizable case. A -DNF is a Boolean mapping, , that can be written as , where for each , is a conjunction of an arbitrary number of literals, e.g. .
It is important to emphasize that the analysis above is not satisfactory for two reasons. First, we do not know if it is not possible to improperly learn -DNFs in polynomial time using examples. All we know is that the ERM approach is not efficient. Second, we do not know if the information theoretic sample complexity of learning conjunctions over is . Maybe the specific structure of the range of yields a lower sample complexity.
But, if we do believe that the above analysis indeed reflects reality, we obtain two points on the curve . Still, we do not know how the rest of the curve looks like. This is illustrated below.
Formal derivation of gaps
In this section, we formally show a learning problem which exhibits an inverse dependence of the runtime on the number of examples. As discussed in the Subsection 1.1, it is distinguished from previous work in being applicable to the natural agnostic setting, where we do not assume that a perfect hypothesis exist. Since this assumption was crucial in all previous works, the construction we use is rather different.
To present the result, we will need the concept of a one-way permutation. Intuitively, a one-way permutation over is a permutation which is computationally hard to invert. More formally, let denote the uniform distribution over , and let denote the set of all finite bit strings. Then we have the following definition:
A one-way permutation is a function which for any , maps to itself; there exists an algorithm for computing , whose runtime is polynomial in the length of ; and for any (possibly randomized) polynomial-time algorithm and any polynomial over , for sufficiently large .
It is widely conjectured that such one-way permutations exist. One concrete candidate is the RSA permutation function, which treats as a number in , and returns , where is a product of two “random” primes of length such that does not divide . However, since the existence of such a one-way permutation would imply , there is no formal proof that such functions exist (see for this and related results).
There exists an agnostic binary classification learning problem over and with the following properties:
It is inefficiently learnable with sample size , and running time .
Assuming one-way permutations exist, there exist no polynomial-time algorithm based on a sample of size .
It is efficiently learnable with a sample of size . Specifically, the training time is , resulting in an improper predictor whose runtime is .
The theorem implies that in the reasonable regime where , we really get an inverse dependence of the runtime on the training size. The theorem is illustrated below:
The hypothesis class consists of randomized functions, parameterized by , and defined as follows, where is the uniform distribution on :
Inefficient Distribution-Free Learning Possible with O(1/ϵ)O(1/\epsilon) Samples
Ignoring computational constraints, we can use the following simple learning algorithm: given a training sample , find the most common value among , compute (inefficiently, say by exhaustive search), and return the hypothesis .
To see why this works, we will need the following lemma, which shows that if has a low error rate, then is likely to appear frequently in the examples (the proof appears in Appendix A).
Efficient Distribution-Free Learning Possible with O(n/ϵ2)O(n/\epsilon^{2}) Samples
We will need the following lemma, whose proof appears in Appendix A:
Let be some distribution over , and suppose we sample vectors from that distribution. Then the probability that a freshly drawn vector is not spanned by is at most .
We use a similar algorithm to the one discussed earlier for inefficient learning. However, instead of finding the most common , computing and returning , which cannot be done efficiently, we build a predictor which is at most worse than , and doesn’t require us to find explicitly.
To do so, let be the subset of examples for which . By definition of , we know that for any such example, . In other words, this gives us a set of values , for which we know . As a consequence, for any in the linear subspace spanned by , we can efficiently compute . Let denote this subspace. Then our improper predictor works as follows, given some instance :
If and , output (note that this is the same output as , by definition).
If , output a random bit (note that this is the same output as , by definition of ).
If and , output a bit uniformly at random.
Note that checking whether can always be done in at most time, via Gaussian elimination.
Now, we claim that the probability of the third case happening is at most . If this is indeed true, then our improper predictor is only worse (in terms of generalization error) from , which based on the argument in the previous section, is already -close to optimal.
So let us consider the possibility that and . If , we are done, so let us suppose that . This means that is unlikely to be much smaller than . More precisely, by the multiplicative Chernoff bound, . Also, conditioned on some fixed , Lemma 2 assures us that . Overall, we get the following (the probabilities are over the draw of the training set and an additional example ):
By taking examples, we can ensure this to be at most order .
Gaps for natural learning problems
In this section we collect examples of natural learning problems in which we conjecture there is an inverse dependence of the training time on the sample size. Some of these examples already appeared explicitly in previous literature, but most are new, unpublished, or did not appear in such an explicit form. We base our inverse dependence conjecture on the current best known upper bounds. Of course, an immediate open question is to show matching lower bounds. However, our main goal here is to demonstrate general techniques of how to reduce the training runtime by requiring more examples.
Consider the set , and let and . That is, each example is a pair and the label indicates whether is more preferable to .
On the other hand, in the following we show that with it is possible to learn preferences in time . The idea is to define the hypothesis class of all Boolean functions over , namely, . Clearly, . In addition, and therefore the sample complexity of learning using the ERM rule is . Last, it is easy to verify that solving the ERM problem can be easily done in time . So, overall, we obtain the following:
2 Agnostic Learning of Kernel-based Halfspaces
We now consider the popular class of kernel-based linear predictors. In kernel predictors, the instances are mapped to a high-dimensional feature space , and a linear predictor is learned in that space. Rather than working with explicitly, one performs the learning implicitly using a kernel function which efficiently computes inner products .
Using standard Rademacher complexity analysis (e.g. ), it is easy to see that the information theoretic sample complexity of learning is . However, from the computational complexity point of view, the ERM problem amounts to solving a non-convex optimization problem (with respect to ). Adapting a technique due to it is possible to show that an -accurate solution to the ERM problem cam be calculated in time . The idea is to observe that the solution can be identified if someone reveals us a subset of non-noisy examples. Therefore we can perform an exhaustive search over all subsets of the examples in the training set and identify the best solution.
3 Additional Examples
In Appendix B we list additional examples of inverse dependence of runtime on sample size. These examples deal with other learning settings like online learning and unsupervised learning. These examples are interesting since they show other techniques to obtain faster algorithms using a larger sample. For example, we demonstrate how to use exploration for injecting structure into the problem, which leads better runtime. The price of the exploration is the need of a larger sample. For the unsupervised setting, we recall an existing example which shows polynomial gap for learning the support of a certain sparse vector.
Discussion
In this paper, we formalized and discussed the phenomena of an inverse dependence between the running time and the sample size. While this phenomena has also been discussed in some earlier works, it was under a restrictive realizability assumption, that a perfect hypothesis exists, and the techniques mostly involved finding this hypothesis. In contrast, we frame our discussion in the more modern approach of agnostic and improper learning.
In the first half of our paper, we provided a novel construction which shows such a tradeoff, based on a cryptographic assumption. While the construction indeed has an inverse dependence phenomenon, it is not based on a natural learning problem. In the second half of the paper, we provided more natural learning problems, which seem to have this phenomenon. Some of these problems were based on the intuition described in the introduction, but some were based on other techniques. However, the apparent inverse dependence in these problems is based on the assumption that the currently available upper bounds have matching lower bounds, which is not known to be true. Thus, we cannot formally prove that they indeed become computationally easier with the sample size.
Thus, a major open question is finding natural learning problems, whose required running time has provable inverse dependence with the sample size. We believe the examples we outlined hint at the existence of such problems, and provide clues as to the necessary techniques. Other problems are finding additional examples where this inverse dependence seems to hold, as well as finding additional techniques for making this inverse dependence happen. The ability to leverage large amounts of data to obtain more efficient algorithms would surely be a great asset to any machine learning application.
References
Appendix A Technical Results
Using the definition of and , we have
A.2 Proof of Lemma 2
Let denote the probability that after drawing , i.i.d., an independently drawn is not spanned by . Also, let be a Bernoulli random variable with parameter . Whenever , the dimensionality of the subspace spanned by the vectors we drew so far increases by . Since we are in an -dimensional space, we must have with probability . In particular, we have
Also, for any , by the assumption that the vectors are drawn i.i.d., we have
Combining the two inequalities, it follows that , so as required.
Appendix B Additional Examples
This example is based on . It deals with another variant of the multi-armed bandit problem. It shows how to use exploration for injecting structure into the problem, which leads to a decrease in the required runtime. The price of the exploration is a larger regret, which corresponds to the need of a larger number of online rounds for achieving the same target error.
The second algorithm is the Banditron of . The Banditron uses exploration for reducing the learning problem into the problem of learning multiclass classifier in the full information case, which can be performed efficiently using the Perceptron algorithm. In particular, in some of the rounds the Banditron guesses a random label, attempting to “fish” the relevant information. This exploration yields a higher regret bound of .
We can therefore draw the following table, which shows a tradeoff between running time and number of rounds required to obtain regret . Note that we will usually want to be much smaller than .
B.2 Sparse Principal Component Recovery
This example is taken from . This time, it is in the context of unsupervised statistical learning.
provide two algorithms to deal with this problem. The first method is a simple diagonal thresholding scheme, which takes the empirical covariance matrix , and returns the indices for which the diagonal entries of are largest. It is proven that if (for some constant ), then the probability of not perfectly identifying the support of is at most , which goes to with and . Thus, we can view the sample complexity of this algorithm as . In terms of running time, given a sample of size , the method requires computing the diagonal of and sorting it, for a total runtime of .
The second algorithm is a more sophisticated semidefinite programming (SDP) scheme, which can be solved exactly in time . Moreover, the sample complexity for perfect recovery is shown to be asymptotically . Summarizing, we have the following clear sample-time complexity tradeoff. Note that here, the gaps are only polynomial.