第5章多層パーセプトロン
5.5.1. Revisiting Overfitting and Regularization5.5.1 過学習と正則化を見直す
According to the “no free lunch” theorem of Wolpert and Macready (1995), any learning algorithm generalizes better on data with certain distributions, and worse with other distributions. Thus, given a finite training set, a model relies on certain assumptions: to achieve human-level performance it may be useful to identify inductive biases that reflect how humans think about the world. Such inductive biases show preferences for solutions with certain properties. For example, a deep MLP has an inductive bias towards building up a complicated function by the composition of simpler functions.
英語のヒント
Wolpert and Macready (1995)の「ノーフリーランチ」定理によれば、どんな学習アルゴリズムも、ある分布をもつデータではよりよく汎化し、別の分布ではより悪く汎化する。したがって、有限の訓練集合が与えられたとき、モデルはある仮定に頼ることになる。人間並みの性能を達成するには、人間が世界をどう考えるかを反映した帰納バイアスを見きわめることが役立つかもしれない。そうした帰納バイアスは、ある性質をもつ解を好む傾向を示す。たとえば、深いMLPは、より単純な関数を合成して複雑な関数を組み上げる方向への帰納バイアスをもつ。
With machine learning models encoding inductive biases, our approach to training them typically consists of two phases: (i) fit the training data; and (ii) estimate the generalization error (the true error on the underlying population) by evaluating the model on holdout data. The difference between our fit on the training data and our fit on the test data is called the generalization gap and when this is large, we say that our models overfit to the training data. In extreme cases of overfitting, we might exactly fit the training data, even when the test error remains significant. And in the classical view, the interpretation is that our models are too complex, requiring that we either shrink the number of features, the number of nonzero parameters learned, or the size of the parameters as quantified. Recall the plot of model complexity compared with loss (Fig. 3.6.1) from Section 3.6.
英語のヒント
機械学習のモデルが帰納バイアスを内に含んでいるとき、それを訓練する手順はふつう二つの段階からなる。(i)訓練データに当てはめる。(ii)ホールドアウトデータでモデルを評価して、汎化誤差(背後にある母集団での真の誤差)を推定する。訓練データへの当てはまりとテストデータへの当てはまりの差は汎化ギャップと呼ばれ、これが大きいとき、モデルは訓練データに過学習していると言う。過学習の極端な場合には、テスト誤差が大きいままでも、訓練データにぴったり当てはまることがある。そして古典的な見方では、その解釈は、モデルが複雑すぎるということである。そのため、特徴量の数、学習される0でないパラメータの数、あるいは数値で表したパラメータの大きさのどれかを減らす必要がある。3.6節の、モデルの複雑さと損失を比べたプロット(図3.6.1)を思い出してほしい。
However deep learning complicates this picture in counterintuitive ways. First, for classification problems, our models are typically expressive enough to perfectly fit every training example, even in datasets consisting of millions (Zhang et al., 2021). In the classical picture, we might think that this setting lies on the far right extreme of the model complexity axis, and that any improvements in generalization error must come by way of regularization, either by reducing the complexity of the model class, or by applying a penalty, severely constraining the set of values that our parameters might take. But that is where things start to get weird.
英語のヒント
しかし、深層学習はこの図式を直観に反するやり方で複雑にする。第一に、分類問題では、モデルはふつう、何百万もの事例からなるデータセットでさえ、すべての訓練事例に完璧に当てはまるだけの表現力をもっている(Zhang et al., 2021)。古典的な図式では、この設定はモデルの複雑さの軸の右の極端な端にあり、汎化誤差の改善はどれも正則化によってもたらされなければならない、と考えるかもしれない。つまり、モデルのクラスの複雑さを減らすか、罰則を当てはめて、パラメータがとりうる値の集合を厳しく制約するかである。しかし、そこから事情が奇妙になり始める。
Strangely, for many deep learning tasks (e.g., image recognition and text classification) we are typically choosing among model architectures, all of which can achieve arbitrarily low training loss (and zero training error). Because all models under consideration achieve zero training error, the only avenue for further gains is to reduce overfitting. Even stranger, it is often the case that despite fitting the training data perfectly, we can actually reduce the generalization error further by making the model even more expressive, e.g., adding layers, nodes, or training for a larger number of epochs. Stranger yet, the pattern relating the generalization gap to the complexity of the model (as captured, for example, in the depth or width of the networks) can be non-monotonic, with greater complexity hurting at first but subsequently helping in a so-called “double-descent” pattern (Nakkiran et al., 2021). Thus the deep learning practitioner possesses a bag of tricks, some of which seemingly restrict the model in some fashion and others that seemingly make it even more expressive, and all of which, in some sense, are applied to mitigate overfitting.
英語のヒント
奇妙なことに、多くの深層学習の課題(たとえば画像認識やテキスト分類)では、ふつう、どれもが訓練損失を任意に小さく(そして訓練誤差を0に)できるモデルの構造のなかから選んでいる。検討中のすべてのモデルが訓練誤差0を達成するので、さらに改善する唯一の道は、過学習を減らすことである。さらに奇妙なことに、訓練データに完璧に当てはまっているにもかかわらず、モデルの表現力をさらに高める、たとえば層やノードを加えたり、より多くのエポック数で訓練したりすることで、実際に汎化誤差をさらに減らせることが多い。もっと奇妙なことに、汎化ギャップとモデルの複雑さ(たとえば、ネットワークの深さや幅でとらえられるもの)を結びつけるパターンは単調でないことがある。いわゆる「二重降下」のパターンで、複雑さが増すと最初は害になるが、その後は役に立つのである(Nakkiran et al., 2021)。したがって、深層学習の実践者はいくつもの技を抱えている。そのいくつかは見たところ何らかの形でモデルを制限し、ほかのものは見たところモデルの表現力をさらに高めるが、どれもある意味では過学習を和らげるために使われる。
Complicating things even further, while the guarantees provided by classical learning theory can be conservative even for classical models, they appear powerless to explain why it is that deep neural networks generalize in the first place. Because deep neural networks are capable of fitting arbitrary labels even for large datasets, and despite the use of familiar methods such as regularization, traditional complexity-based generalization bounds, e.g., those based on the VC dimension or Rademacher complexity of a hypothesis class cannot explain why neural networks generalize.
英語のヒント
事情をさらに複雑にしているのは、古典的な学習理論が与える保証は古典的なモデルについてさえ保守的になりうるが、そもそも深いニューラルネットワークがなぜ汎化するのかを説明するには無力に見えることである。深いニューラルネットワークは、大きなデータセットについてさえ任意のラベルに当てはまることができるので、正則化のようなおなじみの手法を使っていても、伝統的な複雑さにもとづく汎化の界、たとえば仮説クラスのVC次元やRademacher複雑度にもとづくものは、ニューラルネットワークがなぜ汎化するのかを説明できない。