プリンキピア

第16章自然言語処理:応用

16.6. Fine-Tuning BERT for Sequence-Level and Token-Level Applications16.6 系列単位とトークン単位の応用のためにBERTを微調整する

In the previous sections of this chapter, we have designed different models for natural language processing applications, such as based on RNNs, CNNs, attention, and MLPs. These models are helpful when there is space or time constraint, however, crafting a specific model for every natural language processing task is practically infeasible. In Section 15.8, we introduced a pretraining model, BERT, that requires minimal architecture changes for a wide range of natural language processing tasks. On the one hand, at the time of its proposal, BERT improved the state of the art on various natural language processing tasks. On the other hand, as noted in Section 15.10, the two versions of the original BERT model come with 110 million and 340 million parameters. Thus, when there are sufficient computational resources, we may consider fine-tuning BERT for downstream natural language processing applications.
英語のヒント
この章のこれまでの節では、RNN、CNN、注意、MLPにもとづくものなど、自然言語処理の応用のためのさまざまなモデルを設計してきた。これらのモデルは空間や時間に制約があるときに役立つが、自然言語処理のタスクごとに専用のモデルを作り込むのは、実際には無理である。15.8節では、幅広い自然言語処理のタスクに対して、アーキテクチャにわずかな変更しか必要としない事前学習モデル、BERTを紹介した。一方では、提案された当時、BERTはさまざまな自然言語処理のタスクで最先端を更新した。他方では、15.10節で述べたように、元のBERTモデルの二つの版には、1億1000万個と3億4000万個のパラメータがある。したがって、計算資源が十分にあるときは、下流の自然言語処理の応用のためにBERTを微調整することを考えてよい。
In the following, we generalize a subset of natural language processing applications as sequence-level and token-level. On the sequence level, we introduce how to transform the BERT representation of the text input to the output label in single text classification and text pair classification or regression. On the token level, we will briefly introduce new applications such as text tagging and question answering and shed light on how BERT can represent their inputs and get transformed into output labels. During fine-tuning, the “minimal architecture changes” required by BERT across different applications are the extra fully connected layers. During supervised learning of a downstream application, parameters of the extra layers are learned from scratch while all the parameters in the pretrained BERT model are fine-tuned.
英語のヒント
以下では、自然言語処理の応用の一部を、系列単位とトークン単位に一般化する。系列単位では、単一テキストの分類と、テキスト対の分類または回帰で、テキスト入力のBERT表現を出力ラベルにどう変換するかを紹介する。トークン単位では、テキストのタグづけや質問応答のような新しい応用を簡単に紹介し、BERTがそれらの入力をどう表し、それを出力ラベルにどう変換するかを明らかにする。微調整のあいだ、さまざまな応用にわたってBERTが必要とする「アーキテクチャのわずかな変更」とは、追加の全結合層のことである。下流の応用の教師あり学習のあいだ、追加の層のパラメータは一から学習され、事前学習したBERTモデルのパラメータはすべて微調整される。