第1章はじめに
1.5. The Road to Deep Learning1.5 深層学習への道
Much of this changed with the availability of massive amounts of data, thanks to the World Wide Web, the advent of companies serving hundreds of millions of users online, a dissemination of low-cost, high-quality sensors, inexpensive data storage (Kryder’s law), and cheap computation (Moore’s law). In particular, the landscape of computation in deep learning was revolutionized by advances in GPUs that were originally engineered for computer gaming. Suddenly algorithms and models that seemed computationally infeasible were within reach. This is best illustrated in
tab_intro_decade.英語のヒント
こうした状況の多くは、膨大な量のデータが手に入るようになって変わった。そのおかげは、World Wide Web、何億人もの利用者にオンラインでサービスを提供する企業の登場、安価で高品質なセンサーの普及、安価なデータ保存(クライダーの法則)、そして安価な計算(ムーアの法則)にある。特に、深層学習における計算の状況は、もともとコンピュータゲームのために設計されたGPUの進歩によって一変した。計算上実行できないと思われていたアルゴリズムやモデルが、突然、手の届くところに来た。このことは
tab_intro_decadeに最もよく表れている。:Dataset vs. computer memory and computational power
英語のヒント
:データセットとコンピュータのメモリおよび計算能力の比較
| Decade年代 | Datasetデータセット | Memoryメモリ | Floating point calculations per second1秒あたりの浮動小数点演算 |
|---|---|---|---|
| 1970 | 100 (Iris)100(アヤメ) | 1 KB1 KB | 100 KF (Intel 8080)100 KF(Intel 8080) |
| 1980 | 1 K (house prices in Boston)1 K(ボストンの住宅価格) | 100 KB100 KB | 1 MF (Intel 80186)1 MF(Intel 80186) |
| 1990 | 10 K (optical character recognition)10 K(光学文字認識) | 10 MB10 MB | 10 MF (Intel 80486)10 MF(Intel 80486) |
| 2000 | 10 M (web pages)10 M(Webページ) | 100 MB100 MB | 1 GF (Intel Core)1 GF(Intel Core) |
| 2010 | 10 G (advertising)10 G(広告) | 1 GB1 GB | 1 TF (NVIDIA C2050)1 TF(NVIDIA C2050) |
| 2020 | 1 T (social network)1 T(ソーシャルネットワーク) | 100 GB100 GB | 1 PF (NVIDIA DGX-2)1 PF(NVIDIA DGX-2) |
Note that random-access memory has not kept pace with the growth in data. At the same time, increases in computational power have outpaced the growth in datasets. This means that statistical models need to become more memory efficient, and so they are free to spend more computer cycles optimizing parameters, thanks to the increased compute budget. Consequently, the sweet spot in machine learning and statistics moved from (generalized) linear models and kernel methods to deep neural networks. This is also one of the reasons why many of the mainstays of deep learning, such as multilayer perceptrons (McCulloch and Pitts, 1943), convolutional neural networks (LeCun et al., 1998), long short-term memory (Hochreiter and Schmidhuber, 1997), and Q-Learning (Watkins and Dayan, 1992), were essentially “rediscovered” in the past decade, after lying comparatively dormant for considerable time.
英語のヒント
ランダムアクセスメモリは、データの増加に追いついていないことに注意してほしい。同時に、計算能力の増大は、データセットの増加を上回った。これは、統計モデルがメモリをより効率よく使う必要がある一方で、計算の予算が増えたおかげで、パラメータの最適化により多くの計算機サイクルを自由に費やせることを意味する。その結果、機械学習と統計学の最適な領域は、(一般化)線形モデルやカーネル法から、深いニューラルネットワークへと移った。これは、多層パーセプトロン(McCulloch and Pitts, 1943)、畳み込みニューラルネットワーク(LeCun et al., 1998)、長短期記憶(Hochreiter and Schmidhuber, 1997)、Q学習(Watkins and Dayan, 1992)といった深層学習の主力の多くが、かなりの期間比較的休眠していた後、ここ10年で事実上「再発見」された理由の一つでもある。
The recent progress in statistical models, applications, and algorithms has sometimes been likened to the Cambrian explosion: a moment of rapid progress in the evolution of species. Indeed, the state of the art is not just a mere consequence of available resources applied to decades-old algorithms. Note that the list of ideas below barely scratches the surface of what has helped researchers achieve tremendous progress over the past decade.
英語のヒント
統計モデル、応用、アルゴリズムの最近の進歩は、ときにカンブリア爆発、つまり生物種の進化における急速な進歩の時期になぞらえられてきた。実際、最先端の成果は、手に入る資源を何十年も前のアルゴリズムに当てはめただけの結果ではない。下に挙げる考え方の一覧は、研究者がここ10年でとてつもない進歩を遂げるのを助けたものの、ほんの表面をなでたにすぎないことに注意してほしい。
- Novel methods for capacity control, such as dropout (Srivastava et al., 2014), have helped to mitigate overfitting. Here, noise is injected (Bishop, 1995) throughout the neural network during training.
英語のヒント
ドロップアウト(Srivastava et al., 2014)のような、容量を制御する新しい手法が、過学習を和らげるのに役立った。ここでは、訓練のあいだ、ニューラルネットワーク全体にノイズが注入される(Bishop, 1995)。 - Attention mechanisms solved a second problem that had plagued statistics for over a century: how to increase the memory and complexity of a system without increasing the number of learnable parameters. Researchers found an elegant solution by using what can only be viewed as a learnable pointer structure (Bahdanau et al., 2014). Rather than having to remember an entire text sequence, e.g., for machine translation in a fixed-dimensional representation, all that needed to be stored was a pointer to the intermediate state of the translation process. This allowed for significantly increased accuracy for long sequences, since the model no longer needed to remember the entire sequence before commencing the generation of a new one.
英語のヒント
アテンション機構は、1世紀以上にわたって統計学を悩ませてきた第二の問題を解決した。学習可能なパラメータの数を増やさずに、システムの記憶と複雑さをどう増やすか、という問題である。研究者たちは、学習可能なポインタ構造としか見なしようのないものを使って、エレガントな解決策を見いだした(Bahdanau et al., 2014)。たとえば機械翻訳のために文章の系列全体を固定次元の表現で記憶しなければならない代わりに、保存する必要があったのは翻訳過程の中間状態へのポインタだけだった。これにより、長い系列での精度が大幅に向上した。モデルが、新しい系列の生成を始める前に系列全体を記憶しておく必要がもはやなくなったからである。 - Built solely on attention mechanisms, the Transformer architecture (Vaswani et al., 2017) has demonstrated superior scaling behavior: it performs better with an increase in dataset size, model size, and amount of training compute (Kaplan et al., 2020). This architecture has demonstrated compelling success in a wide range of areas, such as natural language processing (Brown et al., 2020, Devlin et al., 2018), computer vision (Dosovitskiy et al., 2021, Liu et al., 2021), speech recognition (Gulati et al., 2020), reinforcement learning (Chen et al., 2021), and graph neural networks (Dwivedi and Bresson, 2020). For example, a single Transformer pretrained on modalities as diverse as text, images, joint torques, and button presses can play Atari, caption images, chat, and control a robot (Reed et al., 2022).
英語のヒント
アテンション機構だけで構築されたTransformerアーキテクチャ(Vaswani et al., 2017)は、優れたスケーリングの振る舞いを示した。データセットの大きさ、モデルの大きさ、訓練の計算量が増えるほど、性能が上がるのである(Kaplan et al., 2020)。このアーキテクチャは、自然言語処理(Brown et al., 2020、Devlin et al., 2018)、コンピュータビジョン(Dosovitskiy et al., 2021、Liu et al., 2021)、音声認識(Gulati et al., 2020)、強化学習(Chen et al., 2021)、グラフニューラルネットワーク(Dwivedi and Bresson, 2020)など、幅広い分野で目覚ましい成功を示してきた。たとえば、文章、画像、関節トルク、ボタン操作といった多様なモダリティで事前学習した一つのTransformerが、アタリのゲームをし、画像に説明文を付け、チャットをし、ロボットを制御できる(Reed et al., 2022)。 - Modeling probabilities of text sequences, language models can predict text given other text. Scaling up the data, model, and compute has unlocked a growing number of capabilities of language models to perform desired tasks via human-like text generation based on input text (Anil et al., 2023, Brown et al., 2020, Chowdhery et al., 2022, Hoffmann et al., 2022, OpenAI, 2023, Rae et al., 2021, Touvron et al., 2023a, Touvron et al., 2023b). For instance, aligning language models with human intent (Ouyang et al., 2022), OpenAI’s ChatGPT allows users to interact with it in a conversational way to solve problems, such as code debugging and creative writing.
英語のヒント
文章の系列の確率をモデル化することで、言語モデルは、ほかの文章が与えられたときに文章を予測できる。データ、モデル、計算の規模を拡大したことで、入力の文章にもとづいて人間のような文章を生成し、望む課題をこなす言語モデルの能力が次々と引き出されてきた(Anil et al., 2023、Brown et al., 2020、Chowdhery et al., 2022、Hoffmann et al., 2022、OpenAI, 2023、Rae et al., 2021、Touvron et al., 2023a、Touvron et al., 2023b)。たとえば、言語モデルを人間の意図に沿わせることで(Ouyang et al., 2022)、OpenAIのChatGPTでは、利用者が会話のようにやり取りしながら、コードのデバッグや創作文の執筆といった問題を解くことができる。 - Multi-stage designs, e.g., via the memory networks (Sukhbaatar et al., 2015) and the neural programmer-interpreter (Reed and De Freitas, 2015) permitted statistical modelers to describe iterative approaches to reasoning. These tools allow for an internal state of the deep neural network to be modified repeatedly, thus carrying out subsequent steps in a chain of reasoning, just as a processor can modify memory for a computation.
英語のヒント
多段階の設計、たとえばメモリネットワーク(Sukhbaatar et al., 2015)やニューラルプログラマ・インタプリタ(Reed and De Freitas, 2015)によって、統計モデルの作り手は、推論への反復的な手法を記述できるようになった。これらの道具を使うと、深いニューラルネットワークの内部状態を繰り返し変更し、推論の連鎖の次の段階を実行していくことができる。ちょうどプロセッサが計算のためにメモリを変更できるのと同じである。 - A key development in deep generative modeling was the invention of generative adversarial networks (Goodfellow et al., 2014). Traditionally, statistical methods for density estimation and generative models focused on finding proper probability distributions and (often approximate) algorithms for sampling from them. As a result, these algorithms were largely limited by the lack of flexibility inherent in the statistical models. The crucial innovation in generative adversarial networks was to replace the sampler by an arbitrary algorithm with differentiable parameters. These are then adjusted in such a way that the discriminator (effectively a two-sample test) cannot distinguish fake from real data. Through the ability to use arbitrary algorithms to generate data, density estimation was opened up to a wide variety of techniques. Examples of galloping zebras (Zhu et al., 2017) and of fake celebrity faces (Karras et al., 2017) are each testimony to this progress. Even amateur doodlers can produce photorealistic images just based on sketches describing the layout of a scene (Park et al., 2019).
英語のヒント
深層生成モデリングにおける重要な発展は、敵対的生成ネットワークの発明だった(Goodfellow et al., 2014)。伝統的に、密度推定や生成モデルのための統計的手法は、適切な確率分布と、そこからサンプリングするための(しばしば近似的な)アルゴリズムを見つけることに焦点を当てていた。その結果、これらのアルゴリズムは、統計モデルに本来備わっている柔軟性の欠如によって大きく制限されていた。敵対的生成ネットワークの決定的な革新は、サンプラーを、微分可能なパラメータをもつ任意のアルゴリズムで置き換えたことである。そしてこのパラメータを、識別器(実質的には二標本検定)が偽物と本物のデータを見分けられなくなるように調整する。データを生成するのに任意のアルゴリズムを使えるようになったことで、密度推定は多種多様な技術に開かれた。疾走するシマウマの例(Zhu et al., 2017)や、偽の有名人の顔の例(Karras et al., 2017)は、どちらもこの進歩の証である。素人の落書き好きでさえ、場面の配置を描いたスケッチだけから、写真のように本物らしい画像を作り出せる(Park et al., 2019)。 - Furthermore, while the diffusion process gradually adds random noise to data samples, diffusion models (Ho et al., 2020, Sohl-Dickstein et al., 2015) learn the denoising process to gradually construct data samples from random noise, reversing the diffusion process. They have started to replace generative adversarial networks in more recent deep generative models, such as in DALL-E 2 (Ramesh et al., 2022) and Imagen (Saharia et al., 2022) for creative art and image generation based on text descriptions.
英語のヒント
さらに、拡散過程がデータのサンプルに少しずつ無作為なノイズを加えるのに対して、拡散モデル(Ho et al., 2020、Sohl-Dickstein et al., 2015)はノイズ除去の過程を学習し、拡散過程を逆にたどって、無作為なノイズから少しずつデータのサンプルを組み立てる。拡散モデルは、文章の説明にもとづく創作的なアートや画像生成のためのDALL-E 2(Ramesh et al., 2022)やImagen(Saharia et al., 2022)のように、より最近の深層生成モデルで敵対的生成ネットワークに取って代わり始めている。 - In many cases, a single GPU is insufficient for processing the large amounts of data available for training. Over the past decade the ability to build parallel and distributed training algorithms has improved significantly. One of the key challenges in designing scalable algorithms is that the workhorse of deep learning optimization, stochastic gradient descent, relies on relatively small minibatches of data to be processed. At the same time, small batches limit the efficiency of GPUs. Hence, training on 1,024 GPUs with a minibatch size of, say, 32 images per batch amounts to an aggregate minibatch of about 32,000 images. Work, first by Li (2017) and subsequently by You et al. (2017) and Jia et al. (2018) pushed the size up to 64,000 observations, reducing training time for the ResNet-50 model on the ImageNet dataset to less than 7 minutes. By comparison, training times were initially of the order of days.
英語のヒント
多くの場合、訓練に使える大量のデータを処理するには、GPU一枚では足りない。ここ10年で、並列・分散の訓練アルゴリズムを作る能力は大きく向上した。スケーラブルなアルゴリズムを設計するうえでの鍵となる課題の一つは、深層学習の最適化の主力である確率的勾配降下法が、比較的小さなデータのミニバッチを処理することに頼っている点である。同時に、小さなバッチはGPUの効率を制限する。したがって、たとえばバッチあたり32枚の画像というミニバッチの大きさで1,024枚のGPUを使って訓練すると、全体のミニバッチはおよそ32,000枚の画像になる。まずLi (2017)が、続いてYou et al. (2017)とJia et al. (2018)が、この大きさを64,000個の観測まで押し上げ、ImageNetデータセットでのResNet-50モデルの訓練時間を7分未満にまで短縮した。比べると、当初の訓練時間は数日の単位だった。 - The ability to parallelize computation has also contributed to progress in reinforcement learning. This has led to significant progress in computers achieving superhuman performance on tasks like Go, Atari games, Starcraft, and in physics simulations (e.g., using MuJoCo) where environment simulators are available. See, e.g., Silver et al. (2016) for a description of such achievements in AlphaGo. In a nutshell, reinforcement learning works best if plenty of (state, action, reward) tuples are available. Simulation provides such an avenue.
英語のヒント
計算を並列化する能力は、強化学習の進歩にも貢献した。これにより、囲碁、アタリのゲーム、スタークラフトのような課題や、環境のシミュレータが使える物理シミュレーション(たとえばMuJoCoを使うもの)で、コンピュータが超人的な性能を達成するという大きな進歩がもたらされた。AlphaGoにおけるこうした成果の説明は、たとえばSilver et al. (2016)を見てほしい。一言で言えば、強化学習は、(状態、行動、報酬)の組がたくさん手に入るときに最もうまく働く。シミュレーションはそのための道を提供する。 - Deep learning frameworks have played a crucial role in disseminating ideas. The first generation of open-source frameworks for neural network modeling consisted of Caffe, Torch, and Theano. Many seminal papers were written using these tools. These have now been superseded by TensorFlow (often used via its high-level API Keras), CNTK, Caffe 2, and Apache MXNet. The third generation of frameworks consists of so-called imperative tools for deep learning, a trend that was arguably ignited by Chainer, which used a syntax similar to Python NumPy to describe models. This idea was adopted by both PyTorch, the Gluon API of MXNet, and JAX.
英語のヒント
深層学習フレームワークは、考え方を広めるうえで決定的な役割を果たしてきた。ニューラルネットワークのモデル化のための第一世代のオープンソースフレームワークは、Caffe、Torch、Theanoだった。多くの重要な論文がこれらの道具を使って書かれた。これらは今では、TensorFlow(しばしばその高水準API Kerasを通じて使われる)、CNTK、Caffe 2、Apache MXNetに取って代わられている。第三世代のフレームワークは、深層学習のためのいわゆる命令型の道具からなる。この流れは、おそらく、モデルを記述するのにPython NumPyに似た構文を使ったChainerが火をつけたものである。この考え方は、PyTorch、MXNetのGluon API、JAXのいずれにも採り入れられた。
The division of labor between system researchers building better tools and statistical modelers building better neural networks has greatly simplified things. For instance, training a linear logistic regression model used to be a nontrivial homework problem, worthy to give to new machine learning Ph.D. students at Carnegie Mellon University in 2014. By now, this task can be accomplished with under 10 lines of code, putting it firmly within the reach of any programmer.
英語のヒント
よりよい道具を作るシステム研究者と、よりよいニューラルネットワークを作る統計モデルの作り手との分業が、物事を大いに単純にした。たとえば、線形のロジスティック回帰モデルを訓練することは、かつては簡単ではない宿題で、2014年にカーネギーメロン大学の機械学習の新しい博士課程の学生に出すのにふさわしいものだった。今では、この課題は10行足らずのコードで達成でき、どんなプログラマーにも確実に手の届くものになっている。