Algorithmic stability and hypothesis complexity
Tongliang Liu, Gábor Lugosi, Gergely Neu, Dacheng Tao
Introduction
The notion of algorithmic stability has been an important tool in deriving theoretical guarantees of the generalization abilities of learning algorithms. Various notions of stability have been introduced and have been exploited to derive generalization bounds. For some examples, Mukherjee et al. 2006 proved that a statistical form of leave-one-out stability is a sufficient and necessary condition for the generalization and learnability of empirical risk minimization learning algorithms; Shalev-Shwartz et al. 2010 defined a weaker notion, the so-called “on-average-replace-one-example stability”, and showed that this condition is both sufficient and necessary for the generalization and learnability of a general learning setting.
In this paper we study learning algorithms that select a hypothesis (i.e., a function used for prediction) from a certain fixed class of functions belonging to a separable Banach space. We introduce a notion of argument stability which measures the impact of changing a single training example on the hypothesis selected by the learning algorithm. This notion of stability is stronger than uniform algorithmic stability of Bousquet & Elisseeff 2002 that is only concerned about the change in the loss but not the hypothesis itself. However, as we will show, the new notion is still quite natural and holds for a variety of learning algorithms. On the other hand, it allows one to exploit martingale inequalities (Boucheron et al. 2013) in the Banach space of the hypotheses. Indeed, the performance bounds we derive for stable algorithms depend on characteristics related to the martingale type of the Banach space.
Generalization bounds typically depend on the complexity of a class of hypotheses that can be chosen by the learning algorithm. Exploiting the local estimates of the complexity of the predefined hypothesis class is a promising way to obtain sharp bounds. Building on martingale inequalities in the Banach space of the hypotheses, we define a subset of the predefined hypothesis class, whose elements will (or will have a high probability to) be output by a learning algorithm, as the algorithmic hypothesis class, and study the complexity of the algorithmic hypothesis class of argument-stable learning algorithms. We show that, if the hypotheses belong to a Hilbert space, the upper bound of the Rademacher complexity of the algorithmic hypothesis class will converge at a fast rate of order , where is the sample size.
The rest of the paper is organized as follows. Section 2 introduces the mathematical framework and the proposed notion of algorithmic stability. Section 3 presents the main results of this study, namely the generalization bounds in terms of argument stability. Section 4 specializes the results to some learning algorithms, including empirical risk minimization and stochastic gradient descent. Section 5 concludes the paper.
Algorithmic Stability and Hypothesis Class
We consider the classical statistical learning problem, where the value of a real random variable is to be predicted based on the observation of an another random variable . Let be a training sample of i.i.d. pairs of random variables drawn from a fixed distribution on a set , where is the so-called feature space. A learning algorithm is a mapping from to a hypothesis class that we assume to be a subset of a separable Banach space . We focus on linear prediction problems, that is, when is a linear functional of . We write . In other words, we assume that the feature space is the algebraic dual of the Banach space . We denote the norm in by . The output of the learning algorithm is a hypothesis used for predicting the value for .
An important special case is when is a Hilbert space. In that case we may assume that and that is the inner product in .
For the output of a learning algorithm , the generalization error is defined as
The notion of algorithmic stability was proposed to measure the changes of outputs of a learning algorithm when the input is changed. Various ways have been introduced to measure algorithmic stability. Here we recall the notion of uniform stability defined by Bousquet & Elisseeff 2002 for comparison purposes. This notion of stability relies on the altered sample , the sample with the -th example being replaced by an independent copy of .
We propose the following, similar, notion that “acts” on the hypotheses directly, as opposed to the losses.
A learning algorithm is -uniformly argument stable if for all ,
holds for all and .
Additionally assuming that is bounded by some with probability one, it is easy to see that an -uniformly argument stable learning algorithm is uniformly stable with , since
However, the reverse implication need not necessarily hold and hence uniform argument stability is a stronger notion.
The relationship between argument stability and generalization performance hinges on a property of the Banach space that is closely related to the martingale type of the space—see Pisier 2011 for a comprehensive account. For concreteness we assume that the Banach space is -smooth (or of martingale type 2) for some . This means that for all ,
Note that Hilbert spaces are -smooth. The property we need is described in the following result of (Pinelis 1994):
Let be a martingale difference sequence taking values in a separable -smooth Banach space . Then for any ,
where is a constant satisfying that (and is the essential supremum of the random variable ).
Our arguments extend, in a straightforward manner, to more general Banach spaces whenever exponential tail inequalities for bounded martingale sequences similar to Proposition 1 are available. We stay with the assumption of -smoothness for convenience and because it applies to the perhaps most important special case when is a Hilbert space. We refer to Rakhlin & Sridharan 2015 for more information of martingale inequalities of this kind.
Let the Banach space be -smooth. If a learning algorithm is -uniformly argument stable, then, for any ,
for . ∎
Algorithmic Rademacher Complexity and Generalization Bound
For a sample size and confidence parameter , let and define the algorithmic hypothesis class of a stable learning algorithm by
Note that, by Lemma 1, with probability at least .
We bound the generalization error (1) in terms of the Rademacher complexity (Bartlett & Mendelson 2003) of the algorithmic hypothesis class. The Rademacher complexity of a hypothesis class on the feature space is defined as
where are i.i.d. Rademacher variables that are uniformly distributed in .
The next theorem shows how the Rademacher complexity of the algorithmic hypothesis class can be bounded. The bound depends on the type of the feature space . Recall that the Banach space is of type if there exists a constant such that for all ,
In the important special case when is a Hilbert space, the space is of type with constant .
Assume that is a -smooth Banach space and that its dual is of type . Suppose that the marginal distribution of the is such that with probability one, for some . If a learning algorithm is -uniformly argument stable, then the Rademacher complexity of the algorithmic hypothesis class on the feature space satisfies
In particular, when is a Hilbert space, the bound simplifies to
The theorem above may be easily used to bound the performance of an -uniformly argument stable learning algorithm. For simplicity, we state the result for Hilbert spaces only. The extension to -smooth Banach spaces with a type- dual is straightforward.
Note first that, by Lemma 1, with probability at least ,
On the other hand, by the boundedness of the loss function, and the bounded differences inequality, with probability at least ,
Note that the order of magnitude of of many stable algorithms is of order . For the notion of uniform stability, such bounds appear in Lugosi & Pawlak 1994; Bousquet & Elisseeff 2002; Wibisono et al. 2009; Hardt et al. 2015; Liu et al. 2017. As we will show in the examples below, many of these learning algorithms even have uniform argument stability of order . In such cases the bound of Corollary 1 is essentially equivalent of the earlier results cited above. The bound is dominated by the term present by using the bounded differences inequality. Fluctuations of the order of are often inevitable, especially when is not typically small. When small risk is reasonable to expect, one may use more advanced concentration inequalities with second-moment information, at the price of replacing the generalization error by the so-called “deformed” generalization error where . The next theorem derives such a bound, relying on techniques developed by Bartlett et al. 2005. This result improves essentially on earlier stability-based bounds.
The proof of Theorem 2 relies on techniques developed by Bartlett et al. 2005. In particular, we make use of the following result.
(Bartlett et al. 2005, Theorem 2.1). Let be a class of functions that map into . Assume that there is some such that for every , . Then, with probability at least , we have
To prove the theorem, we also need to introduce the following auxiliary lemma.
For any and , if then every satisfies
First, we introduce an inequality to build the connection between algorithmic stability and hypothesis complexity. According to Lemma 1, for any and , with probability at least , we have
which means that there exists an such that holds. According to Lemma 2, for any , with probability at least , we have
By elementary properties of the Rademacher complexity (see, e.g., Bartlett & Mendelson 2003), implies . Then, with probability at least , we have
The proof of Theorem 2 is complete by combining the above inequality with inequality (2), the Talagrand Contraction Lemma, and Theorem 1. ∎
In the next section, we specialize the above results to some learning algorithms by proving their uniform argument stability.
Applications
Various learning algorithms have been proved to possess some kind of stability. We refer the reader to (Devroye & Wagner 1979; Lugosi & Pawlak 1994; Bousquet & Elisseeff 2002; Zhang 2003; Wibisono et al. 2009; Hardt et al. 2015; Liu et al. 2017) for such examples, including stochastic gradient descent methods, empirical risk minimization, and non-parametric learning algorithms such as -nearest neighbor rules and kernel regression.
Regularized empirical risk minimization has been known to be uniformly stable (Bousquet & Elisseeff 2002). Here we consider regularized empirical risk minimization (RERM) algorithms of the following form. The empirical risk (or the objective function) of RERM is formulated as
By exploiting their results, we show that stable RERM algorithms have strong generalization properties.
Assume that is a separable Hilbert space. Suppose that the marginal distribution of the is such that with probability one, for some and that the loss function is convex in , bounded by and -Lipschitz. Suppose that for some constants and , the penalty function satisfies
Then, for any , and , if is the output of RERM, with probability at least , we have
Specifically, when , (3) holds with and .
The proof of Theorem 3 relies on the following result implied by Wibisono et al. 2009.
Assume the conditions of Theorem 3. Then the RERM learning algorithm is -uniformly stable with
and is -uniformly argument stable with
Specifically, when and , the condition 3 on the penalty function holds with and , where and is the index for the dimensionality.
Theorem 3 follows by combining Theorem 2 and Proposition 3. ∎
2 Stochastic Gradient Descent
Stochastic gradient descent (SGD) is one of the most widely used optimization methods in machine learning. Hardt et al. 2015 showed that parametric models trained by SGD methods are uniformly stable. Their results apply to both convex and non-convex learning problems and provide insights for why SGD performs well in practice, in particular, for deep learning algorithms.
where denotes the derivative of with respect to and .
While the above result only applies to -Lipschitz loss functions as defined in Definition 3, it does explain some generalization properties of layer-wise training of neural networks by stochastic gradient descent. In this once-common training scheme (see, e.g., Bengio et al. 2007), one freezes the parameters of the network before/after a certain layer and performs SGD for this single layer. It is easy to see that, as long as the activation function and the loss function (connected with the network) are Lipschitz-continuous in their inputs, the overall loss can easily satisfy the continuous conditions of Theorem 4. This implies that the parameters in each layer may generalize well in a certain sense if SGD is employed with an early stop.
The proof of Theorem 4 follows immediately from Theorem 2, combined with the following result implied by Hardt et al. 2015 (which is a collection of the results of Theorems 3.8, 3.9, and 3.12 therein).
Conclusion
Our study leaves some open problems and allows several possible extensions. First, the algorithmic hypothesis class defined in this study depends mainly on the property of learning algorithms but little on the data distribution. It would be interesting to investigate a way to define an algorithmic hypothesis class by considering both the algorithmic property and the data distribution. Second, it would be interesting to explore if there are some algorithmic properties other than stability that could result in a small algorithmic hypothesis class.
Acknowledgments
Liu and Tao were partially supported by Australian Research Council Projects FT-130101457, DP-140102164, LP-150100671. Lugosi was partially supported by the Spanish Ministry of Economy and Competitiveness, Grant MTM2015-67304-P, and FEDER, EU. Neu was partially supported by the UPFellows Fellowship (Marie Curie COFUND program 600387).