53
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

「Chain of Thought Prompting」っお結局どんな手法なの

53
Posted at

はじめに

この蚘事は、AMBL株匏䌚瀟 Advent Calendar 2022の9日目の蚘事になりたす。是非、他の蚘事も読んで芋お䞋さい〜:santa_tone2:

2022幎11月末に話題になった「chatGPT」に぀いおの蚘事を、カレンダヌの8日目に蚘茉したしたが、その䞭で特に蚈算問題なんかの思考過皋の出力に筆者は感動おおりたす:joy:
こういった思考の過皋も生成できるように孊習する手法ずしお、「Chain of Thought Prompting」が有名です。chatGPTのロゞックにも組み蟌たれおいたす・
この蚘事では、2022幎1月に発衚された「Chain of Thought Promptin」ずいう孊習手法に぀いおたずめおいたす。

忙しい方向けの3行芁玄

  • 䜕らかしらの問いに察する答えを出す際の 「思考過皋」 を孊習させるこずができたよ
  • 特に、「数孊の文章問題を解く」ようなタスクの際に品質の向䞊が確認できたよ
  • ただ、ある皋床の倧芏暡蚀語モデル60Bくらいのパラメヌタ数でないず、Chain of Thoughtの効果はあたり実感できなさそう

image.png

本線

この蚘事では、論文の流れに沿っお個人的に重芁だず思った郚分のみ抜粋しおたずめおいきたす。
たずめ方ずしおは、

  • 先行研究の課題、問題提起
  • 提案手法の抂芁
  • 実隓結果 (ここ今執筆䞭です)
  • たずめ、今埌の展望

の順に論文の内容をたずめおいこうず思いたす。理解しきれなかった郚分に関しおは、論文の本文抜粋だけし぀぀、内容の説明は随時远蚘しおいきたす。
基本的には、自分の理解のメモ曞き、ずいう認識なので読みやすさはあたり考慮しおおりたせん。

先行研究の課題

この研究においお解決したい課題は、実際の論文内で以䞋のように蚘茉されおいたす。

Scaling up the size of language models has been shown to confer a range of benefits, such as improved performance and sample efficiency (Kaplan et al., 2020; Brown et al., 2020, inter alia).
However, scaling up model size alone has not proved sufficient for achieving high performance on challenging tasks such as arithmetic, commonsense, and symbolic reasoning (Raeet al., 2021).

蚀語モデルのサむズずその性胜には比䟋関係があるこずが有名です。モデルのパラメヌタ数を増やし、サむズを倧きくするこずでモデルの衚珟胜力が向䞊する、ずいうこずは Kaplanら、Brownらの研究で明らかになっおいたす。
しかし、蚈算問題や垞識問題など、単語の意味理解ずは別に「掚論」ずいう思考過皋が必芁なタスクを解くためには、モデルサむズを倧きくするだけでは䞍十分である、ずいうこずがRaeetらの論文で述べられおいたす。

なので、この論文では、「珟状の蚀語モデルでは蚈算問題のような 思考過皋 を孊習させるこずができおいない」ずいう課題に取り組んでいたす。

提案手法の抂芁

たず初めに、この論文の目暙は「䞎えられた問いに察する最終的な答えの思考過皋」も蚀語モデルが生成できるようにするこずです。以䞋、論文抜粋。

The goal of this paper is to endow language models with the ability to generate a similar chain of thought—a coherent series of intermediate reasoning steps that lead to the final answer for a problem.

この「思考」を具䜓的に説明するず䞋蚘のようになりたす。

Question:

ゞェヌンはお花12個持っおいたした。母芪に2぀あげたあず、父芪にも3぀あげたした。珟圚ゞェヌンはお花をいく぀持っおいるでしょう??

AnswerChain of Thought:

ゞェヌンがお母さんに花を2぀あげた埌、圌女は10個持っおいたす。それからお父さんに3぀あげた埌、圌女は7個持っおいるでしょう。だから答えは7です。

この 「ゞェヌンがお母さんに花を2぀あげた埌、圌女は10個持っおいたす。それからお父さんに3぀あげた埌、圌女は7個持っおいるでしょう。」に盞圓する郚分が Chain of Thought = 思考過皋です。

このように、孊習デヌタのAnswer偎のテキストに䞊蚘のような思考過皋の情報を加わえるこずで、思考過皋も䞀緒に孊習させたしょう、ずいう手法ですね。

この孊習方法の利点ずしお、以䞋の぀の点が論文内で挙げられおいたす。

  1. モデルが段階的な掚論を必芁ずする問題に察しお、途䞭の掚論を远加で孊習するこずができる

  2. 掚論ステップを分割するこずで、答えを間違えた際にどの掚論で間違えたのかが分かるようになる

  3. Chain of Thoughtによっお、数孊の文章問題、垞識問題などの人間が蚀語を介しお解くこずができるあらゆるタスクに 少なくずも原理的には 適甚できる可胜性がある

  4. Chain of Thoughtは、倧芏暡蚀語モデルGPT-3やPaLMなどにおいお、少量のプロンプトに思考過皋を远蚘するだけでも、効果が確認できる。

  1. First, chain of thought, in principle, allows models to decompose multi-step problems into intermediate steps, which means that additional computation can be allocated to problems that require more reasoning steps.
  2. Second, a chain of thought provides an interpretable window into the behavior of the model, suggesting how it might have arrived at a particular answer and providing opportunities to debug where the reasoning path went wrong (although fully characterizing a model’s computations that support an answer remains an open question).
  3. Third, chain-of-thought reasoning can be used for tasks such as math word problems, commonsense reasoning, and symbolic manipulation, and is potentially applicable (at least in principle) to any task that humans can solve via language.
  4. Finally, chain-of-thought reasoning can be readily elicited in sufficiently large off-the-shelf language models simply by including examples of chain of thought sequences into the exemplars of few-shot prompting.

実隓は䞋蚘の3パタヌンに分けお、Chain of Thought Promptingを導入した結果の差を確認しおいる。

  • 算術的掚論
  • 垞識的掚論
  • 蚘号的掚論← ここがむマむチ理解できずたずめ切れおいない

実隓結果

1. 算術的掚論

image.png

image.png

远蚘したす...

2. 垞識的掚論

远蚘したす...

3. 蚘号的掚論

远蚘したす...

たずめ

In all experiments, chain-of-thought reasoning is elicited simply by prompting an off-the-shelf language model.

実隓の結果、党おの怜蚌結果においおChain of Thought Promptingによる粟床の向䞊を確認できおいたす。普通にすごいですよね。しかし、論文内では、䞋蚘の点がただ課題ずしお残っおいるず述べおいたす。

As for limitations, we first qualify that although chain of thought emulates the thought processes of human reasoners, this does not answer whether the neural network is actually “reasoning,” which we leave as an open question.

限界ずしおは、たず、chain of thoughtは人間の掚論者の思考過皋を゚ミュレヌトしおいるが、ニュヌラルネットワヌクが実際に「掚論」しおいるかどうかには答えおいないこずを挙げ、これは未解決問題ずしお残しおおく。

​Second, although the cost of manually augmenting exemplars with chains of thought is minimal in the few-shot setting, such annotation costs could be prohibitive for finetuning (though this could potentially be surmounted with synthetic data generation, or zero-shot generalization). ​

第二に、手䜜業で暡範的なデヌタを思考の鎖で補匷するコストは、数ショットの蚭定では最小であるが、そのようなアノテヌションコストは、埮調敎のために犁止されるかもしれないただし、これは合成デヌタ生成、たたはれロショット汎化によっお克服される可胜性がある。

Third, there is no guarantee of correct reasoning paths, which can lead to both correct and incorrect answers; improving factual generations of language models is an open direction for future work (Rashkin et al., 2021; Ye and Durrett, 2022; Wiegreffe et al., 2022, inter alia).

第䞉に、正しい掚論経路の保蚌はなく、正しい答えず間違った答えの䞡方を導くこずができる。蚀語モデルの事実䞊の䞖代を改善するこずは、将来の研究のためのオヌプンな方向であるRashkinら、2021YeずDurrett、2022Wiegreffeら、2022、特に。

Finally, the emergence of chain-of-thought reasoning only at large model scales makes it costly to serve in real-world applications; further research could explore how to induce reasoning in smaller models.

最埌に、倧きなモデルスケヌルでのみ思考連鎖掚論が出珟するため、実䞖界のアプリケヌションで提䟛するにはコストがかかるさらなる研究により、より小さなモデルで掚論を誘導する方法を探るこずができる。

論文のたずめ内容は以䞊になりたす。

終わりに

いかがでしたでしょうか
「Chain of Thought Prompting」の内容は、かなりシンプルでわかりやすい話だったかなず思いたす。
しかし、盎近の話題になる蚀語モデルのほずんどに採甚されおいるぐらいには、有名な手法になっおいたす。こういった知芋は、しっかりずメリット・デメリットは把握し぀぀、知芋をたずめおいきたいですね。

53
34
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
53
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?