T5:Text-To-Text Transfer Transformerと転移学習の探索(3/3)

入門/解説

1.T5:Text-To-Text Transfer Transformerと転移学習の探索(3/3)まとめ

・T5はクローズドブック質問回答タスクで驚くほど優れており、人間がかなわない程の性能を見せる
・またGPT-2のように人間が読んでも非常に自然に見える文章を生成する能力にも優れている
・特にピーナッツバターへの愛は冷静に読めば絶対まずそうなレシピなのに凄そうに見える迫力を持つ

2.ピーナッツバターサンドイッチへの愛を語るAI

以下、ai.googleblog.comより「Exploring Transfer Learning with T5: the Text-To-Text Transfer Transformer」の意訳です。アイキャッチ画像のクレジットはPhoto by Aleksey Boev on Unsplash

T5はクローズドブック質問回答タスク、すなわち回答時に外部の知識を参照できない質問回答問題で驚くほど優れた性能を見せます。110億のパラメーターを持つ完全なモデルは、TriviaQA、WebQuestions、Natural Questionsでそれぞれ50.1%、37.4%、34.5%で正確な回答をテキストとして生成します。

これらの結果を確かめるため、T5開発チームはトリビアクイズでモデルと真っ向から勝負し、その結果・・・負けました!下部のリンク「What does T5 know?」からT5に挑戦してみてください。

空欄入力タスク
GPT-2のような大規模な言語モデルは、「継続タスク(continuation task)」すなわち、人間が入力した文章の後に続く文章を予測するように訓練されているため、人間が読んでも非常に自然に見える文章を生成する能力に優れています。これを使ってTalk To TransformerやテキストベースのゲームAI Dungeonなど、数多くのクリエイティブなアプリケーションが生み出されました。

T5が使用した事前トレーニングの目標は、モデルに文章内の空欄にした単語を予測させる「空欄入力タスク(fill-in-the-blank task)」で、より密接に連携します。「空欄入力タスク」は「継続タスク」の一般化と見なす事ができます。空欄はテキストの最後に位置する可能性もあるためです。

この目標を利用するために、文章内の空欄の数が可変である下流タスクを新規に作成しました。このタスクでは、モデルは空欄部分を指定した数の単語で置き換えるように求められます。例えば、モデルに「I like to eat peanut butter and _4_ sandwiches.(私はピーナッツバターと _4_ サンドイッチを食べたい)」という入力を与えた場合に、空白を約4語で埋めるようにトレーニングします。

C4を使用してこのタスクでT5を微調整した結果、出力文章が非常に自然な文章であることがわかりました。不足しているテキストに対して要求されたサイズに基づいてモデルが予測を調整していくのを確認する事は特に楽しいです。例えば、「I love peanut butter and _N_ sandwiches(ピーナッツバターと_N_サンドイッチが大好き)」という入力では、出力は次のようになりました。

N=1
I love peanut butter and jelly sandwiches.
(私はピーナッツバターとゼリージャムサンドイッチが大好きです)

N=2
I love peanut butter and jelly on my sandwiches.
(私はピーナッツバターとゼリージャムを乗せたサンドイッチが大好きです)

N=4
I love peanut butter and jelly, which is what makes good sandwiches.
(私はピーナッツバターとゼリージャムが大好きです。これは素敵なサンドイッチになります)

N=8
I love peanut butter and jelly, Yum! You can’t beat peanut butter and jelly sandwiches.
(私はピーナッツバターとゼリージャムが大好きです、美味い!ピーナッツバターとゼリージャムのサンドイッチを打ち負かす事はできません)

N=16
I love peanut butter and bread. Thanks!! This looks delicious. I love all types of peanut butter, but especially peanut butter/jam sandwiches.
(私はピーナッツバターとパンが大好きです。ありがとう!!これは美味しそうです。私はあらゆる種類のピーナッツバターが大好きですが、特にピーナッツバターとジャムのサンドイッチが大好きです)

N=32
I love peanut butter and banana sandwiches and the Peanut Butter Chocolate Chip Cookie Bites are now very easy to prepare. The best part is that the PB&J Cookie Bites are the perfect size for kid lunch boxes and everyone will enjoy them. Kids love these sandwiches.
(私はピーナッツバターとバナナのサンドイッチが大好きで、一口サイズのピーナッツバターチョコレートチップクッキーの準備がとても簡単になりました。一番気に入っている部分は、PB&J Cookie Bitesが子供のランチボックスに最適なサイズであり、誰もが楽しめることです。子供たちはこれらのサンドイッチが大好きです)

N=64
I love peanut butter and jelly! It’s like an incredible childhood love now that I’m in my 30s. I’m obsessed with peanut butter and jelly sandwiches. I have made this recipe many times with great success. I’m guessing you could probably find that it’s from a 1950s cookbook. I haven’t seen it listed in a current one but it is in a 1930 version (they seem to have retired it). Hope you enjoy it 😉 I hope you’ll post what you do with your sandwiches.
(ピーナッツバターとゼリージャムが大好き!私は30代になった今、それは信じられないほどの子供時代の愛情のようです。私はピーナッツバターとゼリージャムのサンドイッチに夢中です。 私はこのレシピを何度も作り、大成功を収めました。おそらくそれが1950年代の料理本からのものであることがわかると思います。私はそれが現在のレシピに掲載されているのを見たことがありませんが、それは1930年の版です。(彼らはその掲載を廃止したようです)。あなたが楽しんでくれる事を望みます;) 私はあなたがあなたのサンドイッチで何をしたかを投稿してくれる事を望んでいます。

N=512
I love peanut butter and banana sandwiches. Peanut butter and bananas were the original sandwich spread (also known as PB&J or Peanut Butter and Jelly), so they are probably my favorite. When I was a kid, I knew what peanut butter and bananas tasted like, but I didn’t really think of them as one flavor. I did recognize PB & J’s as just a sandwich spread, and not really two separate flavours. When I was in graduate school researching food allergies and intolerances, PB&B is one of the main themes that came up. PB&B was and still is the favorite sandwich spread on my school cafeteria tray, and it’s still on my personal board in the kitchen. I’ve seen PB&B on more than one occasion over the years. I can always find one of the other types of peanut butter spread at the school cafeteria and I find it’s the perfect spread for PB&B. You have several options for making your own peanut butter (I love this recipe from Cookie and Kate) or buying it at stores like Trader Joes, Publix, and Safeway. The flavor of PB&B varies, but I’ve found that white chocolate is my favorite to use. This simple sandwich is perfect for lunch or an afternoon snack. When you’re on the go, you can use a store bought product, but it just wouldn’t taste as good. These peanut butter n’ banana sandwich spreads (as well as other peanut butter spreads) are great for on the go eating, but they can also be refrigerated for a few hours and then served at your next party. Preheat oven to 350 degrees. Using a kitchen timer, or using a microwave, heat butter in a saucepan and melt over low heat. Add vanilla extract and milk and heat until nearly boiling. Add peanut butter, bananas, sugar, salt, and pepper, mixing well to combine all ingredients. Spread peanut butter mixture on both sides of your bread. Top with banana slices and a slice of cheese. Toast the bread until both sides are golden brown. Remove from toast and sprinkle a little more sugar and peanut butter on the top. Enjoy while the bread is warm. Store in an airtight container up to one day. Assemble peanut butter and banana sandwich spread by spreading the peanut butter mixture on each slice of bread. Add a banana slice on top and then a PB & J sandwich. Enjoy while the bread is still warm. P.S. You might also like these peanut butter and jelly sandwiches.
(ピーナッツバターとバナナのサンドイッチが大好きです。ピーナッツバターとバナナを良くサンドイッチに塗っていました。PB&JまたはPeanut Butter and Jellyとしても知られていますので、おそらくこれが私のお気に入りです。子供の頃、私はピーナッツバターとバナナがどんな味かを知っていましたが、私はそれらを一つの味にするとは本当に想像もしていませんでした。私はPB&Jを単なるサンドイッチに塗るものであり、実際には2つの異なる風味ではないと認識していました。

私が大学院で食物アレルギーと食物不耐性を研究していたとき、PB&Bは浮上した主要なテーマの1つです。PB&Bは、私の学校の食堂のトレイに置かれるお気に入りのサンドイッチであり、今でもキッチンで優先されます。私は長年にわたって何度もPB&Bを見てきました。私はいつも他のタイプのピーナッツバターが学校の食堂で流行するのを見ることがありますが、それがPB&Bにとって最適な流行だとわかります。

自分でピーナッツバターを作る(Cookie and Kateのレシピが大好き)か、 Trader JoesやPublix、またはSafewayなどの店で買う事もできます。PB&Bの風味は様々ですが、ホワイトチョコレートが私のお気に入りであることがわかりました。このシンプルなサンドイッチは、ランチや午後のおやつに最適です。外出中は、ストアで購入した製品を使用できますが、味はあまり良くありません。

これらのピーナッツバターアンドバナナサンドイッチペースト(および他のピーナッツバターペースト)は、外出先での食事に最適ですが、数時間冷やしてから次のパーティーで提供することもできます。

オーブンを350度に予熱します。キッチンタイマーを使用するか、電子レンジを使用して、鍋でバターを熱し、弱火で溶かします。 バニラエッセンスとミルクを加え、沸騰するまで加熱します。 ピーナッツバター、バナナ、砂糖、塩、コショウを加え、すべての材料を良く混ぜます。あなたのパンの両側にピーナッツバターをミックスしたを広げます。バナナのスライスとチーズのスライスを上部に。両面が黄金色になるまでパンをトーストします。 トーストから取り出し、上部にもう少し砂糖とピーナッツバターを振りかけます。 パンが暖かいうちにお楽しみください。

1日、密閉容器に保管してください。パンの各スライスにピーナッツバターをミックスした物を広げて、ピーナッツバターとバナナのサンドイッチを作成します。バナナのスライスを上部に追加してから、PB&Jサンドイッチを追加します。パンがまだ温かいうちにお楽しみください。

追伸。あなたもまた、これらのピーナッツバターとゼリージャムのサンドイッチが好きかもしれません。

結論
皆さんが今回の調査結果、コード、事前トレーニング済みモデルを使用して何を作り出すのかに、私たちは興奮しています。開始するにはColab Notebookをチェックし、Twitterで使用方法を共有してください。

謝辞
この作品は、Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu, Karishma Malkan, Noah Fiedel, 及び
Monica Dinculescu.が参加した共同作業です。

3.T5:Text-To-Text Transfer Transformerと転移学習の探索(3/3)関連リンク

1)ai.googleblog.com
Exploring Transfer Learning with T5: the Text-To-Text Transfer Transformer

2)arxiv.org
Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer

3)github.com
google-research/text-to-text-transfer-transformer

4)www.tensorflow.org
TensorFlow リソース Datasets Catalog c4

5)colab.research.google.com
t5-trivia

6)t5-trivia.glitch.me
What does T5 know?

コメント

タイトルとURLをコピーしました