論文解説
PaLM: Scaling Language Modeling with Pathways
PaLM:Pathwaysを用いた言語モデリングの拡張
- 課題 モデル規模を大きくすると、few-shotでの言語理解と生成の性能がどう改善するかを、PaLMで確認します。
- 手法 540Bパラメータのデンスなdecoder-only Transformerを、Pathwaysシステムで6144個のTPU v4チップにまたがって学習します。
- 結果 PaLM 540Bは、英語NLPの29個のタスクのうち28個で、few-shotの最高結果を報告しています。GSM8Kでは、chain-of-thoughtと計算機を組み合わせて58%を得ました。

Figure 16 : Few-shot learning performance on 5 different tasks across 3 models sizes (8B, 62B, 540B). Most tasks improve monotonically as the number of few-shot examples is increased. Certain tasks like Trivia QA break this trend. Performance on the few-shot tasks scales well with model sizes, with the 540B model achieving the best performance across all tasks.
出典 · CC BY 4.0 · 元のPDFの34ページ目から図の部分を抽出しています。モデル規模はfew-shot性能をどこまで引き上げるか
大規模なTransformer言語モデルは、多くの自然言語タスクで高い性能を示してきました。しかし、BERTやT5のような穴埋め型のモデルは、タスクごとに多くの学習例でファインチューニングする必要があり、モデルパラメータの一部をタスクに合わせて更新しなければなりません。そのため、モデルの構造と配備の過程が複雑になります。
GPT-3は、タスクの説明と少数の例だけを入力として与えるfew-shot予測が可能であることを示しました。本論文は、この流れの中で規模がfew-shot学習に与える影響を、より詳しく確かめようとしています。そのために、540Bパラメータのデンスに活性化される自己回帰型TransformerであるPaLMを、780Bトークンで学習しました。
デンスなデコーダ構造と2つのPodによるデータ並列学習
PaLMは標準のTransformerをdecoder-only方式で使いますが、いくつかの構造を変えています。MLPの中間活性化にはSwiGLUを使い、各ブロックではattentionとMLPを並列に計算するparallel layersを採用しています。著者らは、parallel layersが大規模では約15%速い学習をもたらすと述べています。さらに、8B規模では品質がわずかに下がったものの、62B規模では品質低下がなかったことを根拠に、540B規模でも品質に対して中立だと外挿しています。

Table 1 : Model architecture details. We list the number of layers, dmodel, the number of attention heads and attention head size. The feed-forward size dff is always 4×dmodel and attention head size is always 256.
出典 · CC BY 4.0 · 元のPDFの6ページ目から図の部分を抽出しています。また、multi-query attentionは、keyとvalueの射影をヘッド間で共有し、自己回帰デコーディング時のコストを減らします。学習システムにはPathwaysを使います。1つのPythonクライアントが2つのTPU v4 Podにバッチを半分ずつ送り、各Podは自分の半分で勾配を計算したあと、リモートのPodと勾配を交換します。この過程により、パイプライン並列を使わずに6144個のTPU v4チップを使います。

Figure 2 : The Pathways system (Barham et al., 2022) scales training across two TPU v4 pods using two-way data parallelism at the pod level.
出典 · CC BY 4.0 · 元のPDFの8ページ目から図の部分を抽出しています。学習効率を測る指標MFU
既存研究は主に、ハードウェアのFLOPs利用率であるHFUを使ってきました。著者らは、再計算(rematerialization)がメモリと演算を交換するため、HFUは実装やコンパイラの選択によって変わると指摘しています。そこで、理論上の最大スループットに対する観測スループットの比率であるmodel FLOPs utilization(MFU)を提案します。この分母には順伝播と逆伝播に必要な演算だけが含まれ、再計算は含まれません。
PaLM 540BのMFUは46.2%と報告されており、同じ計算で測定したHFUは57.8%です。同じ表では、GPT-3が21.3%、Gopherが32.5%、Megatron-Turing NLG 530Bが30.2%として示されています。ただし、これらの数値は各論文の学習スループットから計算されたものです。そのため、ハードウェアや測定時点が同じ統制実験ではありません。

Table 3 : Model FLOPs utilization of PaLM and prior large models. PaLM achieves a notably high MFU because of several optimizations across the model, compiler, and parallelism strategy. The corresponding hardware FLOPs utilization of PaLM is 57.8%. Details of the calculation are in Appendix B.
出典 · CC BY 4.0 · 元のPDFの9ページ目から図の部分を抽出しています。780Bトークンのコーパスの構成
PaLMの事前学習コーパスは、ウェブページ、書籍、ウィキペディア、ニュース、ソースコード、ソーシャルメディアの会話を混ぜて作った780Bトークンです。3つのモデルはすべて同じデータを1エポックだけ学習します。また、どの下位コーパスからもデータが繰り返されないように、混合比率を決めました。
比率は、ソーシャルメディアの会話(多言語)が50%、フィルタリング済みのウェブページ(多言語)が27%、書籍(英語)が13%、GitHubのコードが5%、ウィキペディア(多言語)が4%、ニュース(英語)が1%です。非英語データは全体の約22%です。コードは、copyleftライセンスなど使用が許可されないものを除き、24個のプログラミング言語のファイルを使いました。

Table 2 : Proportion of data from each source in the training dataset. The multilingual corpus contains text from over 100 languages, with the distribution given in Appendix Table 29.
出典 · CC BY 4.0 · 元のPDFの7ページ目から図の部分を抽出しています。英語NLP 29タスクでのfew-shot結果
著者らは、GLaMとGPT-3が使った29個の英語ベンチマークでPaLM 540Bを評価しました。比較対象は、各タスクで以前の大規模言語モデルが報告した単一チェックポイントの最高結果です。ファインチューニングやマルチタスク適応したモデルは、この表には入れていません。

Table 4 : Results obtained by the PaLM 540B model across 29 NLP benchmarks. For the few-shot results, the number of shots for each task are mentioned in parenthesis. The splits for each task are the same ones used in Du et al. (2021) and Brown et al. (2020). Superscripts denote results from past work: aGLaM 62B/64E (Du et al., 2021), bGPT-3 175B (Brown et al., 2020), cMegatron-Turing NLG 530B (Smith et al., 2022), dGopher (Rae et al., 2021), eLaMDA (Thoppilan et al., 2022) (results reported from Wei et al. (2022a), fChinchilla (Hoffmann et al., 2022)). † The work of Rae et al. (2021) and Hoffmann et al. (2022) achieve much higher scores on RACE-m/h, but the authors of those papers note their scores cannot be compared to GPT-3 and other large LMs because of a difference in task setup. We follow the GPT-3 style task setup for RACE-m/h, and compare to the prior results using the same setup.
出典 · CC BY 4.0 · 元のPDFの12ページ目から図の部分を抽出しています。1-shot設定では、PaLM 540Bは29個中24個のタスクで既存の最高結果を上回りました。few-shot設定では、29個中28個のタスクで上回りました。同程度の規模のMegatron-Turing NLG 530Bと比べても、すべてのベンチマークで上回りました。著者らは、この差がモデルの大きさだけでなく、事前学習データ、学習戦略、観測トークン数にも由来すると解釈しています。

Table 5 : Average (Avg) Natural Language Generation (NLG) and Natural Language Understanding (NLU) results across 29 benchmarks using 1-shot evaluation. NLG benchmarks include eight tasks – TriviaQA, NQS, WebQS, SQuADv2, LAMBADA, DROP, QuAC and CoQA – while the remaining are NLU benchmarks. Results for GPT-3 and GLaM are from Du et al. (2021).
出典 · CC BY 4.0 · 元のPDFの13ページ目から図の部分を抽出しています。BIG-benchにおける人間平均との比較
BIG-benchは、大規模言語モデルのために作られた150個以上の難しいタスクの集合です。人間の性能は、作業者がタスクの説明と例を見て答えた結果で、平均的な人間の性能と最高の人間の性能に分けられます。58個の共通タスクでは、PaLM 540B 5-shotが44個のタスクで既存SOTAを上回り、全体の集計では人間の平均性能を上回りました。

Figure 3 : BIG-bench evaluation of PaLM. (left) Evaluation of PaLM, GPT-3, Gopher, and Chinchilla. Previous models have only evaluated on a subset of tasks, so this graph shows aggregate results on the 58 tasks which all three models have evaluated on. (right) Evaluation of PaLM on a larger set of 150 BIG-bench tasks. For each task, the results of its preferred metric are used. The results are normalized by setting the maximum score to 100 and the random chance score to 0 for multiple-choice tasks, so that they are negative valued if the model performs worse than random chance. The normalized results are averaged over all tasks.
出典 · CC BY 4.0 · 元のPDFの15ページ目から図の部分を抽出しています。
Figure 4 : Distribution of score difference in “normalized preferred metric” between PaLM 540B 5-shot and the prior SOTA across a common subset of 58 BIG-bench text tasks. Positive numbers (blue) indicate that PaLM 540B achieves higher than the prior SOTA, while negative numbers (orange) indicate that the prior SOTA is higher than that of PaLM 540B. Prior SOTA includes GPT-3 175B 1-shot (Brown et al., 2020), Gopher 5-shot (Rae et al., 2021) and Chinchilla 5-shot (Hoffmann et al., 2022). Names of individual tasks are not shown here for visual clarity.
出典 · CC BY 4.0 · 元のPDFの15ページ目から図の部分を抽出しています。モデル規模による性能は、おおむね対数線形に現れました。ただし、150個のタスクのうち約25%のタスクでは、62Bから540Bに移ったときに性能が急に上がりました。著者らはこれを、規模が一定の規模を超えたときに現れる不連続な改善と解釈しています。一方で、人間の平均のほうがまだ高いタスクも全体の35%あったため、この結果をすべてのBIG-benchタスクで人間を上回ったという意味だと解釈することはできません。

Figure 5 : 5-shot evaluations on six individual tasks with interesting scaling characteristics. For each task, the “normalized preferred metric” is used, where 0% corresponds to random guessing for multiple choice tasks. (a) shows log-linear improvements with scale, (b) shows “discontinuous” improvements with scale, and (c) shows relatively flat improvements with scale.
出典 · CC BY 4.0 · 元のPDFの17ページ目から図の部分を抽出しています。
Figure 6 : Distribution of score difference in “normalized preferred metric” between PaLM 540B and the average human performance across all 150 BIG-bench text tasks. Positive numbers (blue) indicate that PaLM 540B achieves higher than the average human performance, while negative numbers (orange) indicate that the average human performance is higher than that of PaLM 540B. Names of individual tasks are not shown here for visual clarity.
出典 · CC BY 4.0 · 元のPDFの18ページ目から図の部分を抽出しています。chain-of-thoughtとモデル規模の組み合わせ
著者らは、算術推論と常識推論のタスクで8-shot chain-of-thoughtプロンプトを使いました。算術タスクでは、生成された計算を外部の計算機で補正する設定も合わせて評価しました。GSM8KでPaLM 540Bは、chain-of-thoughtと外部計算機を併用したとき58%の精度を得ました。同じ表では、chain-of-thoughtなしで540Bを使った場合は17%、chain-of-thoughtを使った62Bは33%です。

Figure 8 : Chain of thought prompting allows language models to better perform multi-step reasoning tasks such as math word problems.
出典 · CC BY 4.0 · 元のPDFの20ページ目から図の部分を抽出しています。
Table 10 : 8-shot evaluation of PaLM on GSM8K with chain-of-thought in comparison to prior SOTA.
出典 · CC BY 4.0 · 元のPDFの21ページ目から図の部分を抽出しています。この58%は、Cobbe et al.(2021)のファインチューニング、chain-of-thought、計算機、検証器を組み合わせた最高結果である55%を上回ります。7個の推論データセットのうち4個でSOTAを記録し、残りの3個ではSOTAに近い結果でした。計算機の使用が、どのデータセットでも5%ポイントを超えて性能を上げることはなかった点も報告されています。

Figure 10 : Via chain of thought prompting, PaLM achieves strong performance on a range of arithmetic and commonsense reasoning tasks. PaLM achieves new SOTA on GSM8K, MAWPS, SVAMP, and StrategyQA. Comparisons with prior SOTA are the following. GSM8K: Cobbe et al. (2021), MAWPS and ASDiv: Lan et al. (2021), SVAMP: Pi et al. (2022), AQuA: Piekos et al. (2021), CommonsenseQA: Talmor et al. (2019) leadersboard, StrategyQA: Geva et al. (2021).
出典 · CC BY 4.0 · 元のPDFの22ページ目から図の部分を抽出しています。PaLM-Coderによるコード生成と修正
PaLM-Coderは、PaLMモデルをPythonを中心としたコードデータで2段階の追加ファインチューニングした派生モデルです。ファインチューニングデータ全体は7.75Bトークンで、そのうち5.9BがPythonコードです。HumanEvalではPaLM-Coder 540Bがpass@100で88.4%、MBPPではpass@80で80.8%を記録しました。著者らは、サンプルのうちタスクを解けた割合を直接報告しており、Chen et al.(2021)の推定式は使わなかったと明記しています。

Figure 11 : Examples from the PaLM-Coder 540B model. (top left) GSM8K-Python question converted from the OpenAI GSM8K math dataset. (bottom left) TransCoder example translating a simple function from C++ to Python. (right) Converted HumanEval example.
出典 · CC BY 4.0 · 元のPDFの23ページ目から図の部分を抽出しています。
Table 11 : Amount of code tokens processed during training by the language models of code that we consider. For the Davinci Codex model, the training dataset mix is unknown. For PaLM-Coder, the table shows the sum of pre-training and fine tuning data. Dashes indicate that no data of that type is included. Data for Codex 12B reported from Chen et al. (2021). Codex, PaLM, and PaLM-Coder may include a small amount of code web docs; see footnote.
出典 · CC BY 4.0 · 元のPDFの24ページ目から図の部分を抽出しています。
Table 12 : Results obtained by the PaLM 540B and PaLM-Coder 540B models across code synthesis and software engineering tasks. For the few-shot results, the number of shots for each task are mentioned in parenthesis. Superscripts denote results that are quoted from past work: a Chen et al. (2021); b Austin et al. (2021); c Lachaux et al. (2020); dYasunaga & Liang (2021). ∗Davinci Codex results are our own calculations obtained using the OpenAI Codex API and recommended settings for Codex as outlined in Chen et al. (2021).
出典 · CC BY 4.0 · 元のPDFの25ページ目から図の部分を抽出しています。規模による変化も確認されています。ファインチューニングしていない540Bモデルと比べると、HumanEvalのpass@100は12%ポイント、MBPPのpass@80は5%ポイント高くなりました。DeepFixのコード修正では、コンパイル成功率が82.1%で、先行研究の71.7%を上回りました。ただし、Davinci Codexの学習データ構成は公開されていないため、この比較はタスクの難しさを見積もる参考として解釈すべきです。

Figure 12 : Scaling results for HumanEval, MBPP, GSM8K-Python, TransCoder, and DeepFix datasets on PaLM and PaLM-Coder models scales 8B, 62B and 540B. For DeepFix we report scaling of the compile rate.
出典 · CC BY 4.0 · 元のPDFの25ページ目から図の部分を抽出しています。
Figure 13 : An example DeepFix problem with the original broken code on the left and the PaLM-Coder 540B model’s prediction on the right. The predicted code contains fixes for all of the compilation errors (undeclared variables), as well as other stylistic improvements (declaring variables together) and logic improvements (reading numbers into array a in a loop and not using index i outside the loop).
出典 · CC BY 4.0 · 元のPDFの26ページ目から図の部分を抽出しています。
Figure 14 : Another example DeepFix problem. The predicted code fixes the compilation error (missing braces for the if block, causing a scope error for variable t) and makes other improvements (declaring variables together and removing the line t = 0; which has no effect).
出典 · CC BY 4.0 · 元のPDFの26ページ目から図の部分を抽出しています。バイアス、有害性、記憶化の測定範囲
Winogenderで、PaLM 540Bは1-shotのmultiple choice設定で79.4%の正答率を示し、生成式の採点では69.7%でした。4-shotの生成式設定では84.7%でした。ただし、multiple choiceの採点は正解の相対確率だけを比較するため、絶対確率が低くても正解として扱われることがあります。そのため、精度を過大評価しうると著者らは説明しています。人間の基準値95.9%には依然として届いていません。

Figure 20 : Winogender overall accuracy on PaLM 62B and 540B, using different scoring methods. PaLM 540B achieves a new state-of-the-art performance in 1-shot and few-shot settings, even when using generative scoring methods.
出典 · CC BY 4.0 · 元のPDFの41ページ目から図の部分を抽出しています。有害性の分析では、連続テキストの有害性がプロンプトの有害性と高い相関を示しました。また、Islamやterroristなどがいっしょに現れる関連も観察されました。記憶化の分析では、学習例の正確な50トークンの続き書きの割合は、540Bで2.4%、8Bで1.6%でした。この分析は主に正確に繰り返されたテキストを扱うものです。公平性の分析は大部分が英語データと出力に限られており、多言語のバイアスは十分に測定されていないと著者らは明記しています。

Figure 18 : (a) Proportions of training examples memorized for the three model sizes. Held-out data is from the same distribution as training, but was not exactly seen in the training. (b) Log-log plot of memorization rate based on how many times the example was seen in the training. (c) Proportion examples memorized, broken down by corpus.
出典 · CC BY 4.0 · 元のPDFの35ページ目から図の部分を抽出しています。
Figure 22 : Distribution of toxicity probabilities of the continuation in the first sentence for various religious groups for PaLM 540B.
出典 · CC BY 4.0 · 元のPDFの43ページ目から図の部分を抽出しています。
Figure 23 : Toxicity probability of the continuation (TPC) as a function of Toxicity probability of the prompt (TPP). The human baseline represents the toxicity probability of the original sentence continuation. Model TPC is more consistent with the TPP than the human TPC, suggesting that the model is strongly influenced by the prompt-style and is likely to respond like-to-like. Note that the PaLM 62B and 540B models have very similar toxicity profiles.
出典 · CC BY 4.0 · 元のPDFの44ページ目から図の部分を抽出しています。
Table 20 : Probability of generating a comment that could be perceived as toxic (i.e. toxicity score > 0.5) at least once in 25 continuations for different model sizes. We compute the toxicity probability for “Toxic” and “Non-Toxic” prompts and report the results as such. We report the metric both in the first full-sentence completion and in the full 128 decoding steps similar to Rae et al. (2021). Note that the toxicity score assigned by the Perspective API tends to increase with the number of tokens generated, given that the results are not normalized to the text length.
出典 · CC BY 4.0 · 元のPDFの45ページ目から図の部分を抽出しています。論文情報
- 著者
- Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, Noah Fiedel
- 学会・ジャーナル
- arXiv · プレプリント
- 公開日
- 2022年4月5日
- 登録日
- 2026年10月20日
- 更新日
- 2022年10月5日
- バージョン
- v5
- arXiv
- 2204.02311
- カテゴリ
- cs.CL
- ライセンス
- CC BY 4.0
- 掲載内容
- 論文情報・解説・論文の図
この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。
アブストラクト
Large language models have been shown to achieve remarkable performance across a variety of natural language tasks using few-shot learning, which drastically reduces the number of task-specific training examples needed to adapt the model to a particular application. To further our understanding of the impact of scale on few-shot learning, we trained a 540-billion parameter, densely activated, Transformer language model, which we call Pathways Language Model PaLM. We trained PaLM on 6144 TPU v4 chips using Pathways, a new ML system which enables highly efficient training across multiple TPU Pods. We demonstrate continued benefits of scaling by achieving state-of-the-art few-shot learning results on hundreds of language understanding and generation benchmarks. On a number of these tasks, PaLM 540B achieves breakthrough performance, outperforming the finetuned state-of-the-art on a suite of multi-step reasoning tasks, and outperforming average human performance on the recently released BIG-bench benchmark. A significant number of BIG-bench tasks showed discontinuous improvements from model scale, meaning that performance steeply increased as we scaled to our largest model. PaLM also has strong capabilities in multilingual tasks and source code generation, which we demonstrate on a wide array of benchmarks. We additionally provide a comprehensive analysis on bias and toxicity, and study the extent of training data memorization with respect to model scale. Finally, we discuss the ethical considerations related to large language models and discuss potential mitigation strategies.
この論文を引用
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif et al. (2022). PaLM: Scaling Language Modeling with Pathways. arXiv:2204.02311v5. https://arxiv.org/abs/2204.02311v5
BibTeX
@misc{chowdhery2022palm,
title = {{PaLM: Scaling Language Modeling with Pathways}},
author = {Aakanksha Chowdhery and Sharan Narang and Jacob Devlin and Maarten Bosma and Gaurav Mishra and Adam Roberts and Paul Barham and Hyung Won Chung and Charles Sutton and Sebastian Gehrmann and Parker Schuh and Kensen Shi and Sasha Tsvyashchenko and Joshua Maynez and Abhishek Rao and Parker Barnes and Yi Tay and Noam Shazeer and Vinodkumar Prabhakaran and Emily Reif and Nan Du and Ben Hutchinson and Reiner Pope and James Bradbury and Jacob Austin and Michael Isard and Guy Gur-Ari and Pengcheng Yin and Toju Duke and Anselm Levskaya and Sanjay Ghemawat and Sunipa Dev and Henryk Michalewski and Xavier Garcia and Vedant Misra and Kevin Robinson and Liam Fedus and Denny Zhou and Daphne Ippolito and David Luan and Hyeontaek Lim and Barret Zoph and Alexander Spiridonov and Ryan Sepassi and David Dohan and Shivani Agrawal and Mark Omernick and Andrew M. Dai and Thanumalayan Sankaranarayana Pillai and Marie Pellat and Aitor Lewkowycz and Erica Moreira and Rewon Child and Oleksandr Polozov and Katherine Lee and Zongwei Zhou and Xuezhi Wang and Brennan Saeta and Mark Diaz and Orhan Firat and Michele Catasta and Jason Wei and Kathy Meier-Hellstern and Douglas Eck and Jeff Dean and Slav Petrov and Noah Fiedel},
year = {2022},
eprint = {2204.02311},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2204.02311v5}
}