記事作成日:2023年11月7日


AI

新聞記事でAIに関する重要な英語の論文が紹介されていました。 その論文は経済研究へのAIの活用(特にLLMという言語モデル)に関する内容ですが、実際のビジネスでも活用できる内容と 考え、その翻訳をしてみました。 30ページほどの論文ですが、重要な部分だけを選択して英語と日本語訳の対比という形式で数回に分けて紹介します。

今回は全11回中の9回目です。

第1回 1 Introduction:はじめに
第2回 2 What Are LLMs?:LLMとは何か?
第3回 3 Applications:応用
第4回 3.1 Ideation:アイデア出し
第5回 3.2 Writing:執筆
第6回 3.3 Background Research:背景調査
第7回 3.4 Coding:コーディング
第8回 3.5 Data Analysis:データ分析
第9回 3.6 Mathematical Derivations:数学的導出
第10回 3.7 Summary:まとめ
第11回 4 Outlook and Concluding Thoughts:展望と考察

※数式をテキストで表現するのが難しく画像を使用している部分があります。また、日本語と英語の文法や語順の違いから、少々分かりずらい部分があります。ご了承ください。

3.6 Mathematical Derivations

The ability of LLMs to perform mathematical derivations is emerging but still limited at this point. Noorbakhsh et al. (2021) show that LLMs can be ne-tuned for mathe matical tasks. Frieder et al. (2023) develop a dataset of graduate-level mathematical questions and conclude that ChatGPT’s mathematical abilities are signi cantly below those of an average mathematics graduate student - perhaps providing some solace for the short term. However, current LLMs are trained mostly on text and only the occasional math paper. I would not be surprised if the new dataset created by Frieder et al. (2023) will be useful for making future LLMs signi cantly better at math. This is an area in which further progress would be very valuable.

3.6 数学的導出

LLMによる数学的導出の能力はまだ発展途上ではありますが、Noorbakhsh et al.(2021)が数学のタスクのためにチューニングされることが可能ということを示しています。Frieder et al.(2023)は大学院レベルの数学の質問からなるデータセットを開発し、それをベンチマークとして用いて、ChatGPTの数学能力が通常の大学院の学生の能力をはるかに下回ることを示しました。これは短期間の慰めを一部の人に与えるのでしょう。しかし現在、LLMはほとんどはテキストで訓練されていて、その中にまれに数学の論文が含まれるくらいです。Frieder et al.(2023)などが作った新しいデータセットでチューニングを継続すれば、近い将来にLLMは数学の能力が急速に上昇しても全く驚きません。この領域での技術の発展はかなり貴重なものとなるでしょう。

3.6.1 Setting up models

The following prompt illustrates how LLMs can be useful for setting up models. It describes a consumer with consumption utility that is iso-elastic in one good and linear in the other good, written in LaTeX, and assigns variables for the prices, akin to what one may write on an undergraduate micro problem set. Based on this prompt, the LLM knows to continue with the consumer’s optimization problem. The left column displays the generated text, and the right column shows the typset version compiled by LaTeX.

It can be seen that the LLM correctly fills in a suitable budget constraint and sets up the associated maximization problem. In the Lagrangian, the system includes the budget constraint with an unusual sign. It derives two of the three first-order conditions correctly - as if the sign on the budget constraint in the Lagrangian had just been a typo - but stumbles on the derivative of the iso-elastic utility function. The remainder of the derivations is largely gibberish.

Although it takes up time to read the generated text and spot the mistake, the LLM automatically writing out the maximization problem and Lagrangian and solving parts of the maximization problem within seconds still helps to save valuable researcher time.

3.6.1 モデルの設定

次のプロンプトの例は、LLMを用いてモデルの設定を行うことを示しています。これは、一方では等弾性で、もう一方では線形である消費効用を持つ消費者をLaTeXで記述し、価格に変数を割り当てています。これは学部レベルのミクロな問題に書く内容と似ています。このプロンプトに基づいて、LLMは消費者の最適化問題を続行すべきであることを認識しています。左の列には生成されたテキストが表示され、右の列にはLaTeXによってコンパイルされたタイプセットのバージョンが表示されます。

上記の結果から、LLMが適切な予算制約を入力し最適化問題を正しく設定できていることがわかります。ラグランジュでは、あまり見たことのない変な符号で予算制約を記述しています。3つの1次条件のうち 2つを正確に導出しています (ラグランジアンの予算制約の記号が単にタイプミスだったようだ)が、等弾性効用関数の導関数でつまずいてしまいます。導出過程の残りの部分はほとんど意味不明になっています。

生成されたテキストを読んで間違いを見つけるには時間がかかるものの、LLMは最大化問題とラグランジアンを自動的に書き出し、最大化問題の一部を数秒以内に解決するため、そういう意味で研究者の貴重な時間を節約できるかもしれません。

3.6.2 Deriving equations

As the previous example demonstrates, current LLMs have already some limited capa bility in deriving equations. In fact, continuting on the example above, I corrected the mistake in the first-order condition and asked the system to generate the remainder.

The system proceeded to correctly deriving the solution of the maximization problem, i.e., the optimal levels of x and y as a function of the exogenous parameters.

However, the mathematical abilities of the system are still quite limited: after obtaining the correct solution, I corrected the sign mistake in the Lagrangian and attempted to regenerate the remainder of the derivations, but the system produced gibberish. I attempted several other derivations and found the ratio of mistakes too high for the system to be useful in this application.

3.6.2 方程式の導出

1つ前の例が示すように、現在のLLMはすでに数式の導出に限界があります。実際上の例に続いて、私は一次条件で発生した間違いを修正し、そしてその上で残りの生成をAIシステムに指示してみました。

このように、システムは、最大化問題の解(パラメータの関数としてのxとyの最適レベル)を正しく導出できるようになりました。

ただし、システムの数学的能力にはまだかなり制約が存在します。正しい解を得た後、私の方でラグランジュ関数の符号の間違いを修正し、残りの導出を再生成することを試そうとしましたが、システムは意味不明な結果を生成してしまいました。他にもいくつかの導出を試みましたが、システムが間違いを起こす割合があまりにも高く、現時点で実用的からはほぼ遠いといえるでしょう。

3.6.3 Explaining models

Current LLMs also have some limited ability to explain simple models. The following is an example of where the system explains the math underlying the famous bat-and the-ball problem:

Solve the bat-and-the-ball problem and state all your intermediate steps:

The bat-and-the-ball problem is a classic problem in mathematics. It states that a bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost?

Intermediate Steps:

  1. Let x represent the cost of the ball.
  2. Since the bat costs $1.00 more than the ball, the cost of the bat is x + 1.
  3. Since the total cost of the bat and the ball is $1.10, the equation is x + (x + 1) = 1.10.
  4. Simplifying the equation, 2x + 1 = 1.10.
  5. Subtracting 1 from both sides of the equation, 2x = 0.10.
  6. Dividing both sides of the equation by 2, x = 0.05.
  7. Therefore, the ball costs $0.05.

Interestingly, when I tried variations of the prompt, for example by just stating Solve the bat-and-the-ball problem:the system frequently committed the classic human fallacy in the bat-and-the-ball problem, i.e., it suggested incorrectly that the ball cost $.10. This is related to an interesting phenomenon:LLMs frequently generate more reliable content when asked to show their intermediate steps, called chain-of-thought prompting akin to students who are less error-prone when they are asked to explain the intermediate steps behind the solutions that they report (Wei et al., 2022b).

3.6.3 モデルの説明

簡単なモデルの説明を行う能力は現在のLLMにはあります。以下にあるのは、有名な「バットとボール」の問題を解説している例です。

「バットとボール」の問題を解いて、かつ中間ステップを全て述べてください。

「バットとボール」の問題は古典的な数学の問題です。バットとボールの価格は合計1.10ドル、かつバットの値段はボールより1.00ドル高いという設定の時に、ボールの値段はいくらですか?

中間ステップ:

  1. ボールの値段をxとします。
  2. バットの値段はボールの値段より1.00ドル高いので、バットの値段はx+1となります。
  3. バットとボールの合計値段は1.10ドルなので、方程式はx+(x+1)=1.10となります。
  4. 方程式を単純化すると、2x+1=1.10となります。
  5. 方程式の両辺から1を引くと、2x=0.10となります。
  6. 方程式の両辺を2で割ると、x=0.05となります。
  7. 以上により、ボールの値段は0.05ドルになります。

興味深いことに、色々とプロンプトのバリエーションを試行錯誤している際に、例えば、単に「バットとボールの問題を解決してください」としか命令しない場合、上記の問題に対してシステムは人間がよく犯すような間違いを出力します。つまり、ボールの値段が0.10ドルと誤回答します。これは別の興味深い現象に深く関連します。

LLMに「思考連鎖プロンプト(Chain-of-Thought prompting)」と呼ばれる中間ステップを示すよう求められた場合、zero-shotプロンプトよりも信頼性の高いコンテンツを生成する傾向にあります。これは、中間ステップの説明を求められた学生が答案に間違いを起こしにくくなる現象と類似しています(Wei et al., 2022b)。

参照



    この記事をシェア👉🏻



カテゴリー
タグ