著者: Aditya Ramesh Mikhail Pavlov Gabriel Goh Scott Gray Chelsea Voss Alec Radford Mark Chen Ilya Sutskever 著者: アディティア・ラメシュ ミハイル・パブロフ Gabriel Goh スコット・グレー チェルシー・ヴォス アレック・ラドフォード マーク・チェン イリヤ・サッツェヴァー Zero-Shot Text-to-Image Generation(ゼロショット) 1.導入 現代の機械学習のテキストから画像へのアプローチ - synthesis began with the work of (※) )は、その図を示したものである。 (※) )生成モデルは、画像のタイトルに条件を拡張すると、新しい視覚的なシーンを生成することもできます。 (※) ) 後で示したのは、生成反対的ネットワークを使用して( で、 ), 繰り返し変数自動エンコーダーではなく、画像の信頼性を向上させました。 (※) )は、このシステムが認識可能な属性を持つオブジェクトを生成するだけでなく、 一般化されたカテゴリーに モンゴル et al. 2015 グレッグ et al. 2015 リード et al. 2016年B Goodfellow et al. 2014 リード et al. 2016年B ゼロショット 平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成30年度の平成 で、 ; ; ) 注意と補助損失の統合( で、 )を除き、単にテキスト以外の情報源を活用する。 で、 ; ; で、 ; ; で、 ( ) ジョンズ et al. 2017 2018 ジョンとアル 2018 リード エル 2016A リー et al. 2019 Koh et al. 2021 別々に、 (※) )は、コンテム・ポアリ・メソッドに比べてサンプル品質が大幅に改善された条件付き画像生成のためのエネルギーベースのフレームワークを提案します。彼らのアプローチは、プレトレーニングされた差別モデルを組み込むことができ、MS-COCOでプレトレーニングされたサインアップモデルに適用された場合にテキスト対画像生成を実行できることを示しています。 (※) )はまた、プレトレーニングされたクロスモダル仮面言語モデルへの入力を最適化する方法を提案します。 (※) ) サンプルは依然として、オブジェクトの歪曲、非論理的なオブジェクトの配置、またはフロントとバックグラウンドの要素の不自然な混合などの深刻なアーティファクトに苦しむ可能性があります。 ニコニコ et al. 2017 CHO エル 2020 モンゴル et al. 2015 トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > ( で、 )は、テキストなどのいくつかの分野で印象的な結果を達成しました( で、 画像( で、 )とオーディオ( で、 ( ) ワシントン et al. 2017 ラドフォード et al 2019 チャンとアル。 2020 ハリウッド et al. 2020 ちなみに、データベースのデータベースは、MS-COCOやCUB-200( で、 ) データセットのサイズとモデルサイズは、現在のアプローチの制限要因なのか? この研究では、インターネットから収集された250万枚の画像テキストカップルに12億パラメーターの自動回帰変換器をトレーニングすることで、自然言語を通じて制御可能な、柔軟で高い信頼性を有する画像の生成モデルが得られることを示しています。 こんにちは、アル。 2010 得られたシステムは、人気のMS-COCOデータセットで高品質な画像生成を達成します。 トップ > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング > トレーニング ( で、 )ではなく、単一の大規模な生成モデルの能力として現れる。 ゼロショット イスラエル et al 2017 2.方法 私たちの目標は、テキストと画像のトークンを単一のデータストリームとして自動的にモデリングするトランスフォーマーを訓練することです(Vaswani et al., 2017) しかし、画像トークンとしてピクセルを直接使用すると、高解像度の画像のためのメモリの過剰な量が必要になります。 我々はこれらの問題に対応し、同様の2段階のトレーニング手順を使用して(Oord et al., 2017; Razavi et al., 2019): それぞれの 256×256 RGB 画像を 32×32 グリッドの画像トークンに圧縮するために、差異的な変数自動エンコーダー(dVAE)1 をトレーニングし、その各要素は 8192 の可能な値を仮定することができます。 • Stage 1. 32 × 32 = 1024 画像トークンと 256 個の BPE 暗号化されたテキストトークンを結合し、テキストおよび画像トークンの共同配布をモデル化する自動回帰変換器をトレーニングします。 • Stage 2. 全体的な手順は、証拠下限(ELB)を最大化するように見ることができます(Kingma & Welling, 2013; Rezende et al., 2014) 画像 x, captions y, and the tokens z for the encoded RGB image. We model this distribution using the factorization pθ,ψ(x, y, z) = pθ(x Átha y, z)pψ(y, z), which yields the lower bound どこ: qφ は RGB イメージ x 2 を与えられた dVAE エンコーダーによって生成された 32 × 32 画像トークンの分布を表します。 • pθ は、画像トークンが与えられた dVAE デコードによって生成された RGB 画像の分布を表します。 pψ は、トランスフォーマーによってモデル化されたテキストおよび画像トークンの共同分布を表します。 バンドはβ = 1 だけを保持していることに注意してください、実践では、より大きな値を使用するのが役に立ちます(Higgins et al., 2016)。 第1段階:Visual Codebookを学ぶ トレーニングの最初の段階で、我々は φ と θ に関して ELB を最大化し、これは単に画像で dVAE をトレーニングすることに匹敵する。 我々は K = 8192 コードブックのベクターの上に均一なカテゴリ分布に初期の pψ を設定し、qφ は、エンコーダーによる 32×32 グリッド出力の同じ空間位置で 8192 ロジットによってパラメーテリズムされたカテゴリ分布である。 ELB は今、最適化しにくい: qψ は分離的な分布であり、それを最大化するために再メテリズムグリデントを使用することはできません。 Oord et al. (2017); Razavi et al. (2019) は、直径推計 代わりに、我々はgumbel-softmaxのリラクゼーション(Jang et al., 2016; Maddison et al., 2016)を使用し、qφの上の予想を q τ φの上の1と置き換え、リラクゼーションは温度 τ → 0として緊張する。 The relaxed ELB is maximized using Adam (Kingma & Ba, 2014) with exponentially weighed iterate averaging. Appendix A.2 gives a complete description of the hyperparameters, but we found the following to be especially important for stable training. リラックスしたELBは、アダム(Kingma & Ba, 2014)を使用して強化されています。 • リラックス温度とステップサイズのための特定のアンネリングスケジュール. We found that annealing τ to 1/16 was sufficient to close the gap between the relaxed validation ELB and the true validation ELB with qφ intsead of q τ φ. • エンコーダーの終わりとデコーダーの始まりに 1 × 1 コンボルションを使用することにより、リラックスの周囲のコンボルションの受容フィールドサイズを減らすことが、本物の ELB によりよく一般化したことを発見しました。 • エンコーダーおよびデコードのリブロックから出力するアクティベーションを小さな常数で倍増して、初期化時に安定したトレーニングを確保する。 また、KLの重量をβ = 6.6 に増やすことは、コードブックのより良い使用を促進し、最終的にトレーニングの終わりに小さな再構築エラーにつながることを発見しました。 第2段階:前者を学ぶ 第2段階では、我々は そして , and learn the prior distribution over the text and image tokens by maximizing the ELB with respect to ここで、 トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > ( で、 ( ) φ θ ψ pps 子供 et al. 2019 テキスト画像のカップルを考慮すると、私たちはBPEコード( で、 ) 最大 256 トークンを使用する下げられたタイトル 辞書サイズは 16**384 で、32 x 32 = 1024 トークンを用いて画像を暗号化し、辞書サイズは 8192 です。画像トークンは、gumbel ノイズを加えることなく、dVAE 暗号化ロジットから argmax サンプルを用いて得られます。 サンディエル et al. 2015 5 トランスフォーマーは、デコードのみのモデルで、それぞれのImm-ageトークンは、64の自己注意層のいずれかにあるすべてのテキストトークンに対応することができます。 注目マスクの部分は、テキストへの注目に対応し、標準的な因果マスクであり、画像への注目の部分は、行、列、または突発的な注目マスクを使用します。 B1 7 テキストタイトルの長さを256トークンに制限しますが、最後のテキストトークンと画像のスタートトークンの間の「パッディング」ポジションをどうするかは完全に明確ではありません。 選択肢の一つは、これらのトークンのログインを自己注意操作で −∞ に設定することです。代わりに、256のテキストポジションごとに別々に特別なパッドディングトークンを学ぶことを選択します。 このトークンは、テキストトークンがない場合にのみ使用されます。 Conceptual Captions (Sharma et al., 2018) に関する初期実験では、これはより高い検証損失を引き起こしたが、配布外のトークンのパフォーマンスが向上したことを発見しました。 We normalize the cross-entropy losses for the text and image tokens by the total number of each kind in a batch of data. Since we are primarily interested in image modeling, we multiply the cross-entropy loss for the text by 1/ / ,000 画像を検証し、コンバーゲンスで過剰装備の兆候は見つかりませんでした。 8 and the cross-entropy loss for the image by 7 画像のためのクロスエントロピー損失 8. The objective is optimized using Adam with exponentially weighed iterate averaging; Appendix B.2 describes the training procedure in more detail. We reserved about 606 B2 3.データ収集 私たちの初期の実験は、MS-COCOの拡張として開発された3.3百万のテキスト画像のカップルのデータセットであるConceptual Captionsで、最大12億パラメータまでのモデルで行われました( , ( ) リン et al. 2014 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 で、 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 で、 ) MS-COCO は後者から作成されたため、私たちのトレーニング データには、MS-COCO 検証画像のほんの一部が含まれています(しかし、いずれも含まれていません)。 データ収集プロセスに関する詳細は、附属書に記載します。 . 太陽とアル 2017 Thomee et al. 2016 3 C 2.4. Mixed-Precision Training GPU メモリを節約し、スループットを増やすために、ほとんどのパラメーター、アダムの瞬間、およびアクティベーションは16ビット精度で保存されます。我々はまた、アクティベーションチェックポイントを使用し、リブロックの間のアクティベーションを再計算します。 We believe the root cause of this instability to be underflow in the 16-bit gradients. この不安定性の根本的な原因は、16ビットグレディエントにおける過流であると信じています。 大規模な生成モデルをトレーニングする際に不具合を避けるために開発したガイドラインを紹介しています. Here, we describe one of these guidelines: per-resblock gradient scaling. D 以前の仕事と同じように( で、 ), we found that the norms of the activation gradients from the resblocks decrease monotonously as we move from the earlier resblocks to the later ones. resblocksの活性化グレディエントの基準は、私たちが以前の resblocksから後者に移動するにつれて単調に増加することを発見しました。 モデルが深くなり広がるにつれて、後の res- ブロックのアクティベーショングレディエントの真のエクスペンタは、16 ビット形式の最小エクスペンタの下に落ちる可能性があります。 我々は、 un-derflow を排除することで、安定したトレーニングを可能にしたことを発見した。 Liu et al. 2020 8 underflow Standard loss scaling ( で、 )は、最小および最大のアクティベーショングレディエント(絶対値)によって広がる範囲が16ビットフォーマットのエクスペンター範囲に適合した場合にエンドフローを避けることができます。NVIDIA V100 GPUでは、このエクスペンター範囲は5ビットで指定されています。 ミッキー et al. 2017 Our fix, which is shown in Figure トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > ( で、 )は、専門のGPUカーネルの必要がないという利点で、我々は、 ( )は、4ビット精度でコンボレーションネットワークを訓練するための同様の手順を独立して開発した。 4 コスト et al. 2017 太陽とアル 2020 5.分散型最適化 私たちの12億パラメーターモデルは、16ビット精度で保存するときに約24GBのメモリを消費しますが、これは16GBのNVIDIA V100GPUのメモリを上回ります。 で、 (図で示すように) , parameter sharding は、コンピュータ密集した操作と重複することによって、機械内通信の遅延をほぼ完全に隠すことを可能にします。 ラブバンダリ et al. 2019 5 トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > で、 ( ) 鳥さん et al. 2019 当社の実装では、マシンの各 GPU は、隣接する GPU に依存して、パラメータ シャード グラディエントの低ランキング因子を計算します。 低ランク因子が計算されると、各マシンは低ランク因子から得られた未圧縮グレディエントの平均(8 GPU)と、低ランク因子から得られた脱圧グレディエントの間の残留値にエラーバッファを設定します。 9 PowerSGD は、圧縮されていないパラメータグレディエントのための大きな通信操作を、低ランク因子の 2 つのより小さい通信操作に置き換えます。 圧縮ランク r と変換器活性化サイズ d モデルの場合、圧縮率は 1 − 5r/(8dモデル) で示されます(附属書 E.1 を参照)。 表 1 は、モデルサイズに関係なく、約 85% の圧縮率を達成できることを示しています。 附属書 , we describe various details that were necessary to get PowerSGD to perform well at scale. これらは以下を含む: E2 • バックプロパガンダの際のエラーバッファーにグレディエントを蓄積することによってメモリを節約し、別々のバッファーを結合することよりも。 • エラーバッファーをゼロにするケースを最小限に抑える(例えば、無限の値が混合精度のバックプロパガンダに遭遇した場合、またはチェックポイントからトレーニングを再開した場合)。 • Gram-Schmidt の代わりに Householder オートゴナリゼーションを使用して数値の安定性を改善し、入力にアイデンティティマトリックスの小さな複数を追加する。 • エラーバッファ、その低ランク要因、およびそれらに関連するすべてのコミュニケーション操作のためのカスタマイズされた16ビット浮動ポイントフォーマットを使用してエンドフローを回避する。 また、温かいスタートの手順も見つけました。 マトリックスが描かれた (※) )は不要である:我々は修正することによって同等の結果を得ることができた。 トレーニングの開始時にランダムなガウシアのマトリックスに移行し、決して更新しない。 Q 鳥さん et al. 2019 Q 10 6.サンプル世代 似たもの (※) トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > トップ > ( で、 ) タイトルとカンディ・デートの画像を与えると、対照モデルは、画像がタイトルにどれほどよく一致するかに基づいてスコアを割り当てます。 サンプルの数を増やす効果を示す わたしたちが選ぶトップ この方法は、一種の言語ガイドの検索( , ), and is also similar to the auxiliary text-image matching loss proposed by (※) 別に指定されていない限り、質的および定量的な結果の両方に使用されるすべてのサンプルは、温度の低下なしで得られる(すなわち、使用する)。 = 1) (except for Figure ) と Reranking を使用する 「512」 Razavi et al. 2019 ラドフォード et al 2021 6 N k アンドレア et al. 2017 ジョンとアル 2018 t 2 N 3. Experiments 3.1. Quantitative Results 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 平成30年度 , ), DM- GAN ( で、 ), and DF-GAN ( , )の最後は、最高のスタートスコアを報告します( で、 )とFréchet スタート距離 ( で、 ) on MS-COCO. Figure qualitatively compares sam- ples from our model to those from prior work. Xu et al. 2018 Zhu et al. 2019 Tao et al. 2020 サリーマン エル 2016 Heusel et al. 2017 3 We also conduct a human evaluation similar to the one used in ( ) to compare our approach to DF-GAN, the results of which are shown in Figure . Given a caption, the sample from our model receives the majority vote for better matching the caption 93% of the time. It also receives the majority vote for being more realistic 90% of the time. Koh et al. 2021 7 Figure (a) shows that our model also obtains an FID score on MS-COCO within 2 points of the best prior approach, despite having never been trained on the captions. Our training data incorporates a filtered subset of YFCC100M, and we found that it includes about 21% of the images in the MS-COCO validation set from a de-duplication procedure described in the next section. To isolate this effect, we compute the FID statistics for the validation set both with these images (solid lines) and without them (dashed lines), finding no significant change in the results. 9 Training the transformer on the tokens from the dVAE en- coder allows us to allocate its modeling capacity to the low-frequency information that makes images visually rec- ognizable to us. However, it also disadvantages the model, since the heavy compression renders it unable to produce high-frequency details. To test the effect of this on the quantitative evaluations, we compute the FID and IS in Fig- ure (a) after applying a Gaussian filter with varying radius to both the validation images and samples from the models. Our approach achieves the best FID by a margin of about 6 points with a slight blur of radius 1. The gap between our approach and others tends to widen as the blur radius is increased. We also obtain the highest IS when the blur radius is greater than or equal to two. 9 Our model fares significantly worse on the CUB dataset, for which there is a nearly 40-point gap in FID between our model and the leading prior approach (Figure (b)). We found an 12% overlap rate for this dataset, and again ob- served no significant difference in the results after removing these images. We speculate that our zero-shot approach is less likely to compare favorably on specialized distributions such as CUB. We believe that fine-tuning is a promising direction for improvement, and leave this investigation to future work. Samples from our model for captions in this dataset are shown in Figure . 9 8 Finally, Figure (c) shows clear improvements in FID and IS for MS-COCO as the sample size used for reranking with the contrastive model is increased. This trend continues up to a sample size of 32, after which we observe diminishing returns 9 3.2. Data Overlap Analysis 私たちは、Deduplicationの手順を用いた。 ( ) to determine which images to remove. For each validation image, we find the closest image in the training data using a contrastive model specifically trained for this task. We then sort the images in descending order by closeness to their nearest matches in the training data. After inspecting the results by hand, we determine the images to remove by manually selecting a conservative threshold designed to minimize the false negative rate. Radford et al. 2021 3.3. Qualitative Findings 私たちは、私たちのモデルは、当初予想していなかった方法で一般化する能力を持っていることを発見しました。 ), モデルは、体のための調和器を持ったタピールを描くように見える,またはキーボードやベースがタピールのトランクまたは足の形になっている調和器. This suggests that it has developed a rudimentary ability to compose unusual concepts at high levels of abstraction. 2a Our model also appears to be capable of combinatorial gen- eralization, such as when rendering text (Figure ) or when probed on sentences like “an illustration of a baby hedgehog in a christmas sweater walking a dog” (Figure ). Prompts like the latter require the model to perform variable bind- ing ( , ; ; , ) – it is the hedge- hog that is in the christmas sweater, not the dog. We note, however, that the model performs inconsistently on the task, sometimes drawing both animals with christmas sweaters, or drawing a hedgehog walking a smaller hedgehog. 2b 2c Smolensky 1990 Greff et al. 2020 To a limited degree of reliability, we also find our model to be capable of zero-shot image-to-image translation controllable by natural language (Figure 2d). When the model is given the caption “the exact same cat on the top as a sketch at the bottom” and the top 15 × 32 part of the image token grid for a photo of a cat, it is able to draw a sketch of a similar looking cat on the bottom. This works with several other kinds of transformations, in- cluding image operations (e.g., changing the color of the image, converting it to grayscale, or flipping it upside-down) and style transfer (e.g., drawing the cat on a greeting card, a postage stamp, or a cell phone case). Some transformations, such as those that involve only changing the color of the animal, suggest that the model is capable of performing a rudimentary kind of object segmentation. We provide addi- tional examples of zero-shot image-to-image translation in Section . G 4. Conclusion We investigate a simple approach for text-to-image generation based on an autoregressive transformer, when it is executed at scale. We find that scale can lead to improved generalization, both in terms of zero-shot performance relative to previous domain-specific approaches, and in terms of the range of capabilities that emerge from a single generative model. Our findings suggest that improving generalization as a function of scale may be a useful driver for progress on this task. 認定 この作品のコードリリースをレビューしてくださったMatthew Knight、Rewon Child、John Schul-man、Heewoo Jun、Prafulla Dhariwalがこの論文の有用な早期フィードバックに感謝します。 (※) ) that we used to rerank the samples from our model. Radford et al. 2019 References Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., et al. Tensorflow: A system for large-scale machine learning. In ♪♪♪ 」 12位 USENIX オペレーティングシステムの設計に関するシンポジウム { } 265~283、2016年 and implementation ( OSDI 16) Andreas, J., Klein, D., and Levine, S. Learning with latent language. , 2017. arXiv preprint arXiv:1711.00482 Bengio, Y., Léonard, N., and Courville, A. Estimating or propagating gradients through stochastic neurons for con- ditional computation. , 2013. arXiv プレプリント arXiv:1308.3432 Bowman, S. R., Vilnis, L., Vinyals, O., Dai, A. M., Joze- fowicz, R., and Bengio, S. 連続空間から文を生成する。 , 2015. arXiv プレプリント arXiv:1511.06349 Chen, M., Radford, A., Child, R., Wu, J., Jun, H., Luan, D., and Sutskever, I. Generative pretraining from pixels. In , pp. 1691–1703. PMLR, 2020. International Conference on Machine Learning Child, R., Gray, S., Radford, A., and Sutskever, I. Gen- erating long sequences with sparse transformers. , 2019. arXiv preprint arXiv:1904.10509 Cho, J., Lu, J., Schwenk, D., Hajishirzi, H., and Kemb- havi, A. X-lxmert: Paint, caption and answer ques- tions with multi-modal transformers. , 2020. arXiv preprint arXiv:2009.11278 Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: 大規模な階層イメージデータベース。 , pp. 248–255. Ieee, 2009. 2009 IEEE conference on computer vision and pattern recognition Dhariwal, P., Jun, H., Payne, C., Kim, J. W., Radford, A., and Sutskever, I. Jukebox: A generative model for music. , 2020. arXiv プレプリント arXiv:2005.00341 Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Ben- gio, Y. 生成対立ネットワーク。 2014年。 arXiv preprint arXiv:1406.2661 Greff, K., van Steenkiste, S., and Schmidhuber, J. 人工神経ネットワークにおける結合の問題について。 , 2020. arXiv プレプリント arXiv:2012.05208 Gregor, K., Danihelka, I., Graves, A., Rezende, D., and Wierstra, D. Draw: A recurrent neural network for im- age generation. In , pp. 1462–1471. PMLR, 2015. International Conference on Machine Learning He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. In , pp. 630–645. Springer, 2016. European conference on computer vision Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two-time-scale update rule converge to a local nash equilibrium. ハイゼル, M. ラムサウア, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two-time-scale update rule converge to a local nash equilibrium. 2017年。 arXiv preprint arXiv:1706.08500 Higgins, I., Matthey, L., Pal, A., Burgess, C., Glorot, X., Botvinick, M., Mohamed, S., and Lerchner, A. beta- vae: Learning basic visual concepts with a constrained variational framework. 2016. Isola, P., Zhu, J.-Y., Zhou, T., and Efros, A. A. Image-to- image translation with conditional adversarial networks. In , pp. 1125–1134, 2017. Proceedings of the IEEE conference on computer vi- sion and pattern recognition Jang, E., Gu, S., and Poole, B. Categorical repa- rameterization with gumbel-softmax. , 2016. arXiv preprint arXiv:1611.01144 Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. , 2014. arXiv preprint arXiv:1412.6980 Kingma, D. P. and Welling, M. Auto-coding variational bayes シングル , 2013. arXiv preprint arXiv:1312.6114 Koh, J. Y., Baldridge, J., Lee, H., and Yang, Y. Text-to- image generation grounded by fine-grained user attention. トップページ 237~246、2021年 Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision Köster, U., Webb, T. J., Wang, X., Nassar, M., Bansal, A. K., Constable, W. H., Elibol, O. H., Gray, S., Hall, S., Hornof, L., et al. Flexpoint: An adaptive numerical format for efficient training of deep neural networks. , 2017. arXiv preprint arXiv:1711.02213 LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient- based learning applied to document recognition. , 86(11):2278~2324, 1998年。 Proceed- ings of the IEEE Li, W., Zhang, P., Zhang, L., Huang, Q., He, X., Lyu, S., and Gao, J. Object-driven text-to-image synthesis via adversarial training. In , コンピュータビジョンとパターン認識に関するIEEE/CVF会議 pp. 12174–12182, 2019. Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ra- manan, D., Dollár, P., and Zitnick, C. L. Microsoft coco: Common objects in context. In , pp. 740–755. Springer, 2014. European conference on computer vision Liu, L., Liu, X., Gao, J., Chen, W., and Han, J. トレーニングトランスフォーマーの困難を理解する。 , 2020. arXiv preprint arXiv:2004.08249 Loshchilov, I. and Hutter, F. Decoupled weight decay regu- larization. Loshchilov, I. and Hutter, F. Decoupled weight decay regu- larization. Loshchilov, I. and Hutter, F. Decoupled weight decay. , 2017. arXiv preprint arXiv:1711.05101 Maddison, C. J., Mnih, A., and Teh, Y. W. The concrete distribution: A continuous relaxation of discrete random variables. マディソン, C. J., Mnih, A., and Teh, Y. W. The concrete distribution: A continuous relaxation of discrete random variables. , 2016. arXiv preprint arXiv:1611.00712 Mansimov, E., Parisotto, E., Ba, J. L., and Salakhutdinov, R. Generating images from captions with attention. , 2015. arXiv プレプリント arXiv:1511.02793 Micikevicius, P., Narang, S., Alben, J., Diamos, G., Elsen, E., Garcia, D., Ginsburg, B., Houston, M., Kuchaiev, O., Venkatesh, G., et al. Mixed precision training. , 2017. arXiv preprint arXiv:1710.03740 Nguyen, A., Clune, J., Bengio, Y., Dosovitskiy, A., and Yosinski, J. Plug & play generative networks: Condi- tional iterative generation of images in latent space. In , pp. 4467–4477, 2017. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Oord, A. v. d., Vinyals, O., and Kavukcuoglu, K. Neu- ral discrete representation learning. , 2017. arXiv preprint arXiv:1711.00937 Provilkov, I., Emelianenko, D., and Voita, E. Bpe-dropout: Simple and effective subword regularization シンプルで効果的なサブワード規則化 , 2019. arXiv preprint arXiv:1910.13267 Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. 言語モデルは、監督されていないマルチタスク学習者です。 Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., Krueger, G., and Sutskever, I. Learning transferable visual models from natural language supervision. 2021. Rajbhandari, S., Rasley, J., Ruwase, O., and He, Y. Zero: Memory optimization towards training a trillion parameter models. ラズリー、J、Ruwase、O.およびHe、Y.ゼロ:パラメーターモデルをトレーニングするためのメモリ最適化。 , 2019. arXiv preprint arXiv:1910.02054 Razavi, A., Oord, A. v. d., and Vinyals, O. Generating diverse high-fidelity images with vq-vae-2. , 2019. arXiv プレプリント arXiv:1906.00446 Reed, S., Akata, Z., Mohan, S., Tenka, S., Schiele, B., and Lee, H. Learning what and where to draw. , 2016a. arXiv プレプリント arXiv:1610.02454 Reed, S., Akata, Z., Yan, X., Logeswaran, L., Schiele, B., and Lee, H. Generative adversarial text to image synthesis. In , pp. 1060–1069. PMLR, 2016b. International Conference on Machine Learning Rezende, D. J., Mohamed, S., and Wierstra, D. Stochastic backpropagation and approximate inference in deep gen- erative models. In , pp. 1278–1286. PMLR, 2014. International conference on machine learning Salimans, T., Goodfellow, I., Zaremba, W., Cheung, V., Radford, A., and Chen, X. Improved techniques for training gans. 2016年。 arXiv プレプリント arXiv:1606.03498 Salimans, T., Karpathy, A., Chen, X., and Kingma, D. P. Pixelcnn++: Improving the pixelcnn with discretized lo- gistic mixture likelihood and other modifications. 2017年。 arXiv preprint arXiv:1701.05517 Sennrich, R., Haddow, B., and Birch, A. Neural machine translation of rare words with subword units. 2015年。 arXiv preprint arXiv:1508.07909 Sharma, P., Ding, N., Goodman, S., and Soricut, R. Con- ceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In 平成25年5月25日(日) Proceedings of the 56th Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers) Smolensky, P. Tensor product variable binding and the representation of symbolic structures in connectionist systems. , 46(1-2):159–216, 1990. Artificial intelligence Sun, C., Shrivastava, A., Singh, S., and Gupta, A. Revisiting unreasonable effectiveness of data in deep learning era. In , pp. 843–852, 2017. Proceedings of the IEEE international conference on computer vision Sun, X., Wang, N., Chen, C.-Y., Ni, J., Agrawal, A., Cui, X., Venkataramani, S., El Maghraoui, K., Srinivasan, V. V., and Gopalakrishnan, K. 超低精度の深い神経ネットワークの4ビットトレーニング。 , 33, 2020. Advances in Neural Information Processing Systems Tao, M., Tang, H., Wu, S., Sebe, N., Wu, F., and Jing, X.-Y. Df-gan: Deep fusion generative adversarial networks for text-to-image synthesis. , 2020. arXiv preprint arXiv:2008.05865 Thomee, B., Shamma, D. A., Friedland, G., Elizalde, B., Ni, K., Poland, D., Borth, D., and Li, L.-J. Yfcc100m: The new data in multimedia research. , 59(2):64–73, 2016. Communications of the ACM Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. 注意はあなたが必要とするすべてです。 , 2017. arXiv preprint arXiv:1706.03762 Vogels, T., Karimireddy, S. P., and Jaggi, M. Powersgd: Practical low-rank gradient compression for distributed optimization. , 2019. arXiv preprint arXiv:1905.13727 Welinder, P., Branson, S., Mita, T., Wah, C., Schroff, F., Belongie, S., and Perona, P. Caltech-ucsd birds 200. 2010 Xu, T., Zhang, P., Huang, Q., Zhang, H., Gan, Z., Huang, X., and He, X. Attngan: Fine-grained text to image gener- action with attentive generative adversarial networks. トップページ , pp. 1316–1324, 2018. Proceedings of the IEEE conference on computer vision and pattern recognition Zhang, H., Xu, T., Li, H., Zhang, S., Wang, X., Huang, X., and Metaxas, D. N. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial net- works. In , pp. 5907–5915, 2017. Proceedings of the IEEE international confer- ence on computer vision Zhang, H., Xu, T., Li, H., Zhang, S., Wang, X., Huang, X., and Metaxas, D. N. Stackgan++: Realistic image synthe- sis with stacked generative adversarial networks. , 41(8):1947–1962, 2018. IEEE transactions on pattern analysis and machine intelligence Zhu, M., Pan, P., Chen, W., and Yang, Y. Dm-gan: テキスト対画像合成のためのディナミックメモリ生成対立ネットワーク , Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition 5802~5810、2019年 A. Discrete VAE の詳細 1.建築 The dVAE encoder and decoder are convolutional (LeCun et al., 1998) ResNets (He et al., 2016) with bottleneck-style resblocks. The models primarily use 3 × 3 convolutions, with 1 × 1 convolutions along skip connections in which the number of feature maps changes between the input and output of a resblock. The first convolution of the encoder is 7 × 7, and the last convolution of the encoder (which produces the 32 × 32 × 8192 output used as the logits for the categorical distributions for the image tokens) is 1 × 1. Both the first and last convolutions of the decoder are 1 × 1. The encoder uses max-pooling (which we found to yield better ELB than average-pooling) to downsample the feature maps, and the decoder uses nearest-neighbor upsampling. The precise details for the architectures are given in the files dvae/encoder.py and dvae/decoder.py of the code release. A2 トレーニング The dVAE is trained on the same dataset as the transformer, using the data augmentation code given in Listing トレーニング中にいくつかの量が分解され、すべてコシンスケジュールを使用します。 1 1.KLの重さ 最初の 5000 件のアップデートで 0 から 6.6 に増加しました。 (※) ) use a similar schedule based on the sigmoid function. β Bowman et al. 2015 2. The relaxation temperature τ is annealed from 1 to 1/16 over the first 150,000 updates. Using a linear annealing schedule for this typically led to divergence. Step size is annealed from 1 · 10−4 to 1.25 · 10−6 over 1,200,000 updates. Step size is annealed from 1 · 10−4 to 1.25 · 10−6 over 1,200,000 updates. リラックス温度とステップサイズの分解スケジュールは、安定性と最適化の成功のために特に重要です。 AdamW (Loshchilov & Hutter, 2017) を使用してパラメータを更新します β1 = 0.9, β2 = 0.999, = 10−8 ,および重量崩壊の倍増者 10−4 . 我々は割引器によるスペースグリッド出力の 32 × 32 位置の間の共通分布を用いるパラメータの割引率 0.999 を使用します。 ELB での再構築用語は、画像ピクセルの 256 × 256 × 3 値の共通分布であり、KL 用語は、エンコーダーによるスペースグリッド出力の 32 × 32 位置の共通分布です。 我々は、全体の損失を 256 × 256 × 3 に分割し、KL 用語の重量が β/192 になるように、β は KL A.3. The Logit-Laplace Distribution The 1 及び 2 reconstruction objectives are commonly used when training VAEs. These objectives correspond to using Laplace and Gaussian distributions for ln ( | ) in Equation このモデリング選択には奇妙な不一致がある:ピクセル値は限られた範囲内にあるが、これらの分布は両方ともリアルライン全体によってサポートされている。 l l PTT x y, z 1 We present a variant of the Laplace distribution that is also supported by a bounded interval. This resolves the discrepancy between the range of the pixel values being modeled and the support of the distribution used to model them. We consider the pdf of the random variable obtained by applying the sigmoid function to a Laplace-distributed random variable. This pdf is defined on (0*,* 1) and is given by we call it the We use the logarithm of the RHS of Equation. 方程式のRHSのロガリズム as the reconstruction term for the training objective of the dVAE. logit-Laplace distribution. 2 The decoder of the dVAE produces six feature maps representing the sufficient statistics of the logit-Laplace distribution for the RGB channels of the image being reconstructed. The first three feature maps represent the RGBチャンネルのパラメータで、最後の3つは ln を表します。 dVAE エンコーダーに画像を送信する前に、その値を変換します。 ☆☆☆☆☆☆☆☆☆☆☆☆ 1位 ), which is given by µ b ϕ で、 ϵ This restricts the range of the pixel values to be modeled by the dVAE decoder to (*ϵ,* 1 *ϵ*), which avoids numerical problems arising from the *x*(1 *x*) in Equation [2](#_bookmark82). We use *ϵ* = 0*.*1. To reconstruct an image for manual inspection or computing metrics, we ignore ln *b* and compute *x*ˆ = *ϕ*−1(sigmoid(*µ*)), where *µ* is given by the first three feature maps output by the dVAE decoder.[11](#_bookmark84) B. Details for Transformer B.1. Architecture Our model is a decoder-only sparse transformer of the same kind described in ( ), with broadcasted row and column embeddings for the part of the context for the image tokens. A complete description of the embedding scheme used in our model is shown in Figure 私たちは64の注意層を使用し、それぞれ62の注意頭を用いて、1頭当たりの状態サイズは64です。 Child et al. 2019 10 モデルでは、我々が図11で示す3種類の稀少な注意マスクを使用します。 Convolutional 注意マスク(図11(d))は、最後の自己注意層にのみ使用されます。そうでないと、自己注意層のインデックスi(i ∈ [1, 63])を考慮すると、我々はコラムの注意マスク(図11(c))を使用します。 i − 2 mod 4 = 0、および順番の注意が異なります。例えば、最初の4つの自己注意層はそれぞれ「列、列、行、行」を使用します。 Convolutional 注意マスクを除き、最終的な自己注意層で使用された場合、我々は行の上でのパフォーマンスの小さな増加と密度の注意マスクを提供することを発見しました。 ( ( ) Child et al. 2019 B.2. Training When training the transformer, we apply data augmentation to the images before encoding them using the dVAE encoder. We use slightly different augmentations from the ones used to train the dVAE; the code used for this is given in Listing . 私たちはまた、トレーニング用コードをBPEでコードするときに10%のBPEの落とし穴を適用します。 モデルはper-resblock scalingを使用してトレーニングされます(セクションを参照してください。 ) and gradient compression (see Section) を参照 ) 合計圧縮ランキング 896 (それぞれの GPU がパラメーターシェアに対して 112 の圧縮ランキングを使用するように) , this results in a compression rate of about 86%, which we analyze in Section . 2 2.4 2.5 1 E.1 AdamW を使用してパラメータを更新する *β*1 = 0*.*9、 *β*2 = 0*.*96, *ε* = 10−8、および重量崩壊の倍増子 4*.*5 10−2 私たちは、アダム アップデートを適用する前に、4 の値段を使用して、ノーマルに基づいて圧縮されたグラディエントをクリップします。グラディエントクリップは、トレーニングの開始時に温暖化段階でのみ起動します。メモリを保存するために、ほとんどのアダムの瞬間(詳細についてはセクション [D](#_bookmark89)を参照)は、パラメータまたは瞬間を更新するために使用される前に、16 ビットの形式で保存されます。最後に、パラメータまたは瞬 We trained the model using 1024, 16 GB NVIDIA V100 GPUs and a total batch size of 1024, for a total of 430*,*000 updates. At the start of training, we use a linear schedule to ramp up the step size to 4*.*5 10−4 over 5000 updates, and halved the step size each time the training loss appeared to plateau. We did this a total of five times, ending training with a final step size that was 32 times smaller than the initial one. We reserved about 606*,*000 images for validation, and did not observe overfitting at any point during training. C.データ収集の詳細 In order to train the 12-billion parameter transformer, we created a dataset of a similar scale to JFT-300M by collecting 250 million text-image pairs from the internet. As described in Section , this dataset incorporates Conceptual Captions, the text-image pairs from Wikipedia, and a filtered subset of YFCC100M. We use a subset of the text, image, and joint text and image filters described in Wikipedia. ( ) to construct this dataset. These filters include discarding instances whose captions are too short, are classified as non-English by the Python package cld3, or that consist primarily of boilerplate phrases such as “photographed on <date>”, where <date> matches various formats for dates that we found in the data. We also discard instances whose images have aspect ratios not in [1*/ ,* 2]. If we were to use to very tall or wide images, then the square crops used during training would likely exclude objects mentioned in the caption. 2.3 シャルマ et al. 2018 2 D. Guidelines for Mixed-Precision Training このプロジェクトの最も挑戦的な部分は、10億パラメータを超える16ビット精度でモデルをトレーニングすることでした。 12 1. 当社のモデルでは、128のグレディントスケールを使用し、それぞれのリブロックのための1つです。 213, where is the number of data-parallel replicas (i.e., the number of GPUs). In our setup, each grad scale is multiplied by 21*/*1000 at every parameter update Use per-resblock gradient scaling (Figure ) instead of standard loss scaling. 4 M M 4 whe√n __t__here are no nonfinite values for any parameter gradient in that resblock. Otherwise, we divide the grad scale また、125のアップデートウィンドウ内で同じグレードスケールの連続分割を禁止します。すべてのグレードスケールは、アップデート後、範囲 \[*M* 27*, M* 224\] に固定されます。 2. In particular, store all gains, biases, embeddings, and unembeddings in 32-bit precision, with 32-bit gradients (including for remote communication) and 32-bit Adam moments. We disable gradient compression for these parameters (though PowerSGD would not make sense for 1D parameters like gains and biases). The logits for the text and image tokens are computed and stored in 32-bit precision. We found that storing the embeddings in 16-bit precision sometimes caused divergence early in optimization, and using 16-bit logits resulted in a small shift in the training curve, so we switched to use 32-bit precision out of an abundance of caution. Only use 16-bit precision where it is really necessary for performance. 3. For data-parallel training, we need to divide the gradients by the total number of data-parallel workers . One way to do this is to divide the loss by the per-machine batch size, and then divide the parameter gradients by before summing them over the machines (using all-reduce). To save time and space, the gradients are usually computed and stored in 16-bit precision. When 大きい場合は、この分割は、グレディントが合計される前にインドフローを引き起こす可能性があります。反対に、もし私たちが最初にグレディントを合計し、その後それらを分割しようとすると、私たちはすべての減少でオーバーフローに遭遇することができます。 Avoid underflow when dividing the gradient. M M M この問題に対する我々の解決策は、すべてを減らす前に部門内の情報の損失を最小限に抑えることを目指し、過剰流出の危険を伴わない。 マシンのバッテリーサイズではなく、グレディントスケールを数倍にします。 次に、すべてを減らす操作の前に、我々は、下流と過流の両方を避けるために手で調節された常数で下流を分割します。これは、パラメーターグレディエントのスカラルコンポーネントの絶対値のエクスペンタ(すなわち、ベース2ロガリズム)のヒストグラム(base-2ロガリズム)を検査することによって行われました。 グレディエントスカリングが16ビット形式のエクスペンタ範囲の右端に近づいているため、我々は、同じ常数が16ビットグレディエントのモデルのすべてのパラメーターでうまく機能したことを発見しました。PowerSGDを使用すると、我々は16ビットグレディエント そして マトリックス M M P Q E. 分散型最適化の詳細 パワースポット( で、 ) すべてのパラメータに関してグレディエントを圧縮するため、embeddings、unembeddings、gains、 and biases を除く。 , we derive an expression for the reduction in the amount of data communicated as a function of the compression rank and model size. セクション , we present a detailed overview of our adaptation of PowerSGD, and the modifications we had to make in order to fix performance regressions, some of which only manifest at billion-parameter scale. パフォーマンスの回帰を修正するために私たちが行なわなければならない修正の詳細な概要を紹介します。 鳥さん et al. 2019 E1 E2 E.1. Bandwidth Analysis Gradient compression uses the factorization G ≈ P Qt , where P and Q both have rank r. Instead of using a single all-reduce to transmit G, we use two, smaller all-reduces to transmit both P and Qt in succession. Hence, the compression ratio is the sum of the sizes of the P and Q matrices divided by the sum of the sizes of the G matrices. We shard along axis 1 for all parameters except for the second MLP matrix. The derivation of the compression ratio in our setup is given in Table 2. We note that the choice of shard axis changes the compression ratio for the MLP matrices. Finally, this analysis excludes the embeddings, unembeddings, gains, and biases, for which we do not use compression. The total fraction of the bandwidth used by these parameters becomes smaller as the model size is increased. 2.実施の詳細 We describe the steps in our implementation of PowerSGD in detail, since these details were crucial in getting it to work efficiently and reliably at billion-parameter scale. 1. Our training setup uses a combination of parameter sharding and gradient compression, as described in Section Backpropagation では、アクティベーションを再計算し、現在の resblock に基づくグラディエントを計算する際に、すべての集計を使用して前回の resblock のパラメータをプレフェッチします。それぞれの GPU が完全なパラメータマトリックスに基づいてグラディエントを計算した後、GPU のパラメータシェアに対応するグラディエントのスライスの平均を計算し、メモリを保存するために直ちに完全なグラディエントを捨てます。 2.5 2. レッドスキャッターの結果に無限の値が存在しない場合(バックスキャッターまたはレッドスキャッターの過流によって引き起こされる可能性がある)、結果をリブロックのグレディントスケールに分割し、エラーバッファ(すなわち、エラー修正に使用されるバッファ)に追加します。そうでなければ、私たちは何もしないし、バックスキャッティングに進みます。 グレディントの単一の無限の値は、全体の更新が省略されることを意味します。 エラーバッファは、アダム平均に使用される同一の 1-6-9 フォーマットを使用します。 ; the larger exponent range ensures that this division does not result in underflow. Adding the gradients directly to the error buffers avoids redundantly allocating another set of buffers of size equal to the parameter shard gradients. B2 3. resblock の reduc-scatter オペレーションが完了すると、resblock を計算するためのオペレーションをスケジュールします。 ミスバッファーのマトリックスとその マトリックス、その値はトレーニングの開始時に固定されている(セクションを参照)。 ). Both the そして matrices are stored in 1-6-9 format and have their values scaled by predetermined constants, as discussed in Section . P Q 2.5 P Q D 4. 各 GPU が計算した場合 resblockのパラメーターの分割のマトリックスは、それらは平均で 他のすべてのマシンで同じオーディナルを持つGPUのマトリックスで、単一のグループ化されたすべての削減操作を使用します。このすべての削減は、カスタムカーネルを使用して1-6-9フォーマットで行われます。グループ化は、より良い帯域幅の利用につながります、それはより小さい個々のパラメータのために多くのすべての削減呼び出しをスケジュールするのを避けるため、それぞれいくつかのオーバーヘッドを持っています。我々は、すべての削減の結果の無限を最大値に1-6-9フォーマット(わずかに16より小さい)に絞り込んで、シグナルを保持します。 そして matrices, this clamping happens very rarely. P P P Q 5. × Once the all-reduce operation for the resblock 用のマトリックスが完成したとき、我々は結果のマトリックスの列を正方形化する。我々は Gram-Schmidt の代わりにカスタマイズされた Householder 正方形化カーネルを使用し、後者は数的に不安定であることが判明した。 × to レベルが低下しないようにするためには、 10−6 ここで、 × 同じサイズの正方形のマトリックスです。 添付されたマトリックス: It contains the アイデンティティ・マトリックスとゼロが他の場所にある オートゴナリズム matrices are stored in 1-6-9 format, but without scaling. P ϵIm r P ϵ Im r P R R P 6. Once the resblockのマトリックスが正方形化され、我々は新しい数値を計算するための操作をスケジュールする。 P Q matrices from the error buffers and the matrices. P 7. Once the new resblock のマトリックスが計算され、我々 は他のグループ化された all-reduce をスケジュールし、我々 が resblock にしたものと同様に matrix. As in step (4), we clamp all infinities in the results of the all-reduce to the maximum value of the 1-6-9 format, retaining the sign. The error buffers for the resblock have now been decomposed into low-rank factors. レズブロックのエラーバッファーは現在低ランクの要因に分解されています。 and . Q P P Qt 8. 圧縮されていないすべてのパラメータのグレディエントは、単一の 32 ビット精度 all-reduce にグループ化されます。 これらのパラメータとそのグレディエントに対して、なぜ32ビットの精度を使用しているのかを説明します。 D 9. マシンのすべての GPU が、モデルの各 resblock の手順 (7) および (8) を完了すると、 そして すべてのマシンで同じパラメーターのシェールのマトリックスは同一である。それから、我々は2つの量の合計であるグローバルグレディエント基準を計算する: (a) フロベニウス基準の平方の合計 マシン上のすべてのパラメータのシェアのマトリックス、および(b)圧縮を使用しないパラメータのシェアのグラディントの平方基準の合計、マシン上のすべてのそのようなパラメータのシェアを引き継ぎます。 ( ) P Q Q B2 10. グローバル ノーマルを計算する際に、我々 はまた、 reduc-scatter 後にどのパラメータ シャード グレディエントが無限値を含んでいるかについてのステップ (2) からの情報を同期します。 または 無限の値が含まれています. We cannot rely on the values of the and matrices to determine (b), since we clamp infinities as described in step (4). If we find that the gradient with respect to any parameter shard on the machine contains nonfinite values, then we set the global norm to infinity. P Q P Q 11. Once all of the all-reduces have finished and the global norm has been computed, we can apply the parameter updates. Like backpropagation, the parameter updates proceed resblock-by-resblock. The first step is to compute the decompressed gradients by forming the product 特定のリブロック内のすべてのパラメータのために。過剰な流れを避けるために、これらの製品は32ビット精度で計算されます。私たちは、デコンプレックスされたグレディエントとステップで計算されたグローバルノーマルを使用して、パラメータにアダムの更新を適用することができます(9)。グローバルノーマルが無限である場合、パラメータとアダムの瞬間への更新は省略されます。我々は、デコンプレックスされたグレディエントは、スケールのスケールで分けなければならないことに留意します。 マトリックス(The Matrix) matrix is stored without scaling after orthogonalization). PQT Q P 12. 二つ目のステップは、エラーバッファへの更新です. まず、ステップ (10) の結果を使用して、エラーバッファを確認します。 そして 特定のパラメータのシェアのマトリックスには限られた値のみが含まれます。もしそうであるならば、我々は、デコンプレッサを機械の合計数に分け、エラーバッファの現在値から引き下げます。これにより、エラーバッファは、レッドスキャッターを使用して機械上のGPUに平均された「ローカル」バッファと「リモート」デコンプレッサのバッファ(すなわち「エラー」)の違いに設定されます。 または エラーバッファが無限値を含む場合、ステップ2で計算されたエラーバッファが無限値のみを含んでいるかどうかをチェックします。それがあれば、その値を保存し、何もしない場合、それをゼロに設定します。この退屈な論理の目的は、エラーバッファをゼロに設定することです。 P Q P Q 13. 圧縮されていないパラメーターフラッグは、別々に更新されます。 我々はまた、次の重要な最適化に注意する。 1. 上記のステップでは、コンピューティングとコミュニケーションの間の重複のためのいくつかの機会があります. For example, while we are running step (2) for resblock , we can proceed to steps (3)–(8) for all resblocks. すべての resblocks に対して 重複の機会を活用することは、良いパフォーマンスを達成するために必要です。 i J > i 例えば、私たちは前回のリブロックのパラメータを前回のリブロックのリブロック作業が完了したときにのみ前回のリブロックします。そうでないと、完全なパラメータを保持することによってメモリがなくなる可能性があります。 3. 移行が重要な場所には、実装の 2 つの場所があります: (a) MLP マトリックスの shard 軸の選択と (b) gradient の低ランク因子化を計算するか、それともその移行を計算するか。 . 後者は orthogonalization のコストに影響を及ぼします. Suppose that the gradient G is m × n and its low-rank factors P and Qt are m × r and r × n, respectively, with r m, n. orthogonalization をより安くするために, we transpose G appropriately so that m <= n. E1 最初に、NCCLのすべての集合および削減分散原始が0軸に沿って破裂するという制限のように思えるかもしれません。私たちは(a)および(b)の通信操作の前におよび後にいくつかのマトリックスを転送する必要がありますが、これはメモリ外のエラーを避けるために追加の時間を必要とし、潜在的に特別なケアを必要とします。実際には、私たちは実際にはこれを行う必要はありませんでした。これは、私たちが転送されたフォーマットにいくつかのパラメータを保存し、前進拡散、バックプロパガンダ、および上記のステップ(1)~(13)で使用されるマトリックス複合コアのTranspose_aおよびTranspose_bパラメータを活用したためです。これは、私たちが(a)およ 4. 上記のステップ(12)では、過度に頻繁にエラーバッファをゼロに設定することがパフォーマンスの後退を引き起こす可能性があることに注目しました。我々は、これをチェックポイントからトレーニングを再開する際には、これがより頻繁に起こるため、機械が定期的に失敗する可能性があります。 幸いなことに、これは不要であるため、エラー修正はエラーバッファの合計にのみ依存します。 この属性は、PowerSGD によって使用される操作の線形性と順序に由来します。 したがって、すべての GPU で取られたエラーバッファの合計を同じオーディナルで保存するだけで十分です。 チェックポイントから再起動すると、エラーバッファをマシンの合計数で分割し、それらを放送することができます。 F. Details for Human Evaluation Experiments タイトルとサンプル画像は、アマゾンのMechanical Turkに提出した実験ごとに1000の画像比較タスクを作成するために使用されます。各タスクは5人の異なる従業員によって回答されました。従業員は2つの画像を比較し、それらについて2つの質問を回答するように求められました:(1)どの画像が最も現実的で、そして(2)どの画像が共有タイトルに最も適合しているか。 一人の従業員の回答は、他の従業員との異議の高い割合と迅速な回答速度(多くの提出時間は4秒未満)と組み合わせたため、不合格となりました。 13 G. Zero-Shot Image-to-Image 翻訳 図形 セクションで議論したゼロショット画像から画像への翻訳のさらなる例を示します。 我々はこの能力が現れることを予想しなかったし、それを奨励するためにトレーニング手順に変更はしなかった。 14 3.3 この論文は、CC by 4.0 Deed (Attribution 4.0 International) ライセンスの下で archiv で利用できます。 この論文は、CC by 4.0 Deed (Attribution 4.0 International) ライセンスの下で archiv で利用できます。