4/14(日) 足・靴・木型研究会「第2回研究集会」を開催します☆彡

30-1. 文章生成言語モデルGPT-3に東工大×医科歯科大の新名称を提案してもらった

やること

2022年10月14日、東京工業大学と東京医科歯科大学は統合し1大学となることで合意したことを発表しました。

国立大学法人東京工業大学と国立大学法人東京医科歯科大学の統合に向けた基本合意書を締結
左から、東京工業大学の益一哉学長、東京医科歯科大学の田中雄二郎学長 国立大学法人 東京医科歯科大学(学長:田中雄二郎)と国立大学法人 東京工業大学(学長:益一哉)は、両法人並びに両法人がそれぞれ設置する東京医科歯科大学と東京工業大学を統合し、1法人1大学とすることについて合意に達し、本日、10月14日に基本合意書を...

それにともない、2022年12月8日まで新大学の名称案を募集しています。

【受付終了】新大学の名称案をご提案ください
提案受付は2022年12月8日に受付を終了いたしました。国立大学法人東京工業大学と国立大学法人東京医科歯科大学は、両法人並びに両法人がそれぞれ設置する東京工業大学と東京医科歯科大学を統合し、1法人1大学とすることについて合意に達し、10月14日に基本合意書を締結しました。大学統合に伴う新大学の名称は、「国立大学法人東京...

ちなみに、名称案の著作権譲渡は良いとして、「提案者の公表・表彰等は行いません」と明記されているため応募する意味なく自己満足の範疇です。cf. 東京都がコンテストを装って50万円で動画14本を外注しようとしている

東工大ですから、テクノロジーの力で新名称を決めた方がいいですよね。今回はOpenAIが発表した高性能な自然言語モデル「GPT-3」に新大学の名称案を提案してもらいました。

GPT-3とは

GPT-3は2020年にOpenAIが発表した大規模自然言語モデルです。人間と見分けがつかないほどの文章を生成できることで話題になりました。

実行環境

WinPython3.6をおすすめしています。

WinPython - Browse /WinPython_3.6/3.6.7.0 at SourceForge.net
Portable Scientific Python 2/3 32/64bit Distribution for Windows

Google Colaboratoryが利用可能です。

Google Colaboratory

API-keyの入手

ちなみに有料サービスです。3ヶ月間のお試し($18まで)は無料とのこと。

Start for free – Start experimenting with $18 in free credit that can be used during your first 3 months.

https://openai.com/api/pricing/

まずはOpenAIのアカウントを作成してログインします。

Product
Our API platform offers our latest models and guides for safety best practices.

「View API keys」をクリック

新規APIキーを発行。なお、APIキーは再閲覧できないため紛失した場合は再発行になります。

基本のコード

あらかじめ「openai」のパッケージをpipします。Google Colabの場合は先頭に「!」を付けてください。

pip install openai

こちらが最小コードです。

import openai

#APIキー
openai.api_key = '自分のAPI-key'

#文章
prompt = 'What is the letter between A and C?'

#計算
res = openai.Completion.create(engine='text-davinci-003',
                               prompt=prompt,
                               max_tokens=30,
                               temperature=0.9)

#結果
print(res['choices'][0]['text'])
B

「AとCの間の文字は何か?」に対して「B」と答えてくれました。

パラメータについて

egineは4種類から選べます。

text-davinci-003:最も有能なGPT-3モデル
text-curie-001:非常に有能ながらDavinciよりも高速・低コスト
text-babbage-001:簡単なタスク向け、非常に高速・低コスト
text-ada-001:非常に単純なタスク向け、GPT-3シリーズの中で最速・低コスト

temperatureはサンプリング温度です(デフォルトは1)。値が大きいほどモデルがより多くのリスクを負うことを意味します。より創造的なアプリケーションでは0.9、明確な答えがあるアプリケーションでは0(argmaxサンプリング)を試してください。

max_tokensは出力単語数の制限です。

他の引数が気になる方はこちらを参照してください。

Just a moment...

新名称を提案してもらうための質問文

東工大ニュース記事と「法人統合及び大学統合に関する基本合意書」を参照して次の質問文にしました。

東京工業大学と東京医科歯科大学は、1つの大学として統合することで合意しました。統合の目的は、両大学のこれまでの伝統と先進性を活かしながら、統合によってこれまでどの大学も為しえなかった新しい大学のあり方を創出することである。新大学の名称は、その趣旨に沿ったものであることが望ましい。新大学の名称の候補を3つ出力してください。

Tokyo Institute of Technology and Tokyo Medical and Dental University have reached an agreement on the merger to form one university. The purpose of the integration is to create a new type of university, which no other university has been able to achieve so far, while utilizing the tradition and innovation of the two universities. The name of the new university should be in line with the purpose. Please output three candidates for the name of the new university.

結果

egineとtemperatureを変えながら聞いてみました。単語制限は多めの100語で。

#文章
prompt = 'Tokyo Institute of Technology and Tokyo Medical and Dental University have reached an agreement on the merger to form one university. The purpose of the integration is to create a new type of university, which no other university has been able to achieve so far, while utilizing the tradition and innovation of the two universities. The name of the new university should be in line with the purpose. Please output three candidates for the name of the new university.'

for engine in ['text-davinci-003', 'text-curie-001', 'text-babbage-001', 'text-ada-001']:
    for temperature in [0.9, 0.5, 0.1]:
        print('----- engine:{}, temperature:{}'.format(engine, temperature))
        #計算
        res = openai.Completion.create(engine=engine,
                                       prompt=prompt,
                                       max_tokens=100,
                                       temperature=temperature,
                                       )
        #結果
        print(res['choices'][0]['text'])
----- engine:text-davinci-003, temperature:0.9
1. Tokyo Institute of Medical and Technical Innovation 
2. Tokyo Institute of Advanced Education and Technology 
3. Tokyo International Academy of Science and Technology

----- engine:text-davinci-003, temperature:0.5
1. Tokyo Institute of Medical and Dental Technology 
2. Tokyo Advanced University of Technology and Medicine 
3. Tokyo International University of Health and Technology

----- engine:text-davinci-003, temperature:0.1
1. Tokyo Institute of Medical and Dental Technology
2. Tokyo Advanced Institute of Technology and Medicine
3. Tokyo Institute of Innovative Medicine and Technology

----- engine:text-curie-001, temperature:0.9
Tokyo Institute of Technology and Tokyo Medical and Dental University have reached an agreement on the merger to form one university. The purpose of the integration is to create a new type of university, which no other university has been able to achieve so far, while utilizing the tradition and innovation of the two universities. The name of the new university should be in line with the purpose. Please input three candidates for the name of the new university.
1. Tokyo Institute of Technology and Tokyo Medical

----- engine:text-curie-001, temperature:0.5
Tokyo Institute of Technology 
Tokyo Medical and Dental University 
Tokyo University of the Arts

----- engine:text-curie-001, temperature:0.1
Tokyo Institute of Technology
Tokyo Medical and Dental University
Tokyo University of the Arts

----- engine:text-babbage-001, temperature:0.9
Tokyo Medical and Dental University-Tokyo University of Pharmaceutical Sciences
Tokyo University of Nursing and Health Sciences-Tokyo University of Dental Medicine
Tokyo University of Pharmaceutical Sciences-Tokyo University of Pharmacy

----- engine:text-babbage-001, temperature:0.5
Tokyo Medical and Dental University
Tokyo Institute of Technology

----- engine:text-babbage-001, temperature:0.1
Tokyo Medical and Dental University
Tokyo Institute of Technology

----- engine:text-ada-001, temperature:0.9
1. Seikoku University
2. Nagoya University of Science and Technology
3. Tokai University of Technology

----- engine:text-ada-001, temperature:0.5
Tokyo Medical and Dental University
Tokyo Institute of Technology

----- engine:text-ada-001, temperature:0.1
Tokyo Medical and Dental University
Tokyo Institute of Technology

考察

4つエンジンの中でtext-davinci-003が一番優秀で、「3つあげてください」という指示を忠実に守ってくれています。text-curie-001も優秀ですが長文を返したり既存の大学名をあげたりしました。text-babbage-001とtext-ada-001は速度は早いですが、既存の大学名や意味不明な回答が目立ちました。

以下、気をつけて日本語訳してみました。できるだけTechnologyは工業、Medicalは医科、Technology and Medicineは医工(東工大が医工連携というワードを使っているため)、Advanced Universityは大学院大学に寄せ気味で訳しています。

----- engine:text-davinci-003, temperature:0.9
1. 東京医工革新大学(Institute形式)
2. 東京高等教育工業大学(Institute形式)
3. 東京国際科学技術学院

----- engine:text-davinci-003, temperature:0.5
1. 東京医科歯科工業大学(Institute形式)
2. 東京医工大学院大学
3. 東京国際健康工業大学 

----- engine:text-davinci-003, temperature:0.1
1. (すぐ上の1と同じ)
2. 東京医工大学院大学(Institute形式)
3. 東京先進医工大学(Institute形式)

----- engine:text-curie-001, temperature:0.9
(長い文章で単語数超過)

----- engine:text-curie-001, temperature:0.5
東京工業大学(既存)
東京医科歯科大学(既存)
東京藝術大学(既存)

----- engine:text-curie-001, temperature:0.1
(すぐ上と同じ3つ)

----- engine:text-babbage-001, temperature:0.9
東京医科歯科大学-東京薬科大学
東京看護保健大学-東京歯科大学
東京薬科大学-東京薬科大学

----- engine:text-babbage-001, temperature:0.5
東京医科歯科大学(既存)
東京工業大学(既存)

----- engine:text-babbage-001, temperature:0.1
(すぐ上と同じ2つ)

----- engine:text-ada-001, temperature:0.9
1. セイコク大学
2. 名古屋科学技術大学
3. 東海工業大学

----- engine:text-ada-001, temperature:0.5
東京医科歯科大学(既存)
東京工業大学(既存)

----- engine:text-ada-001, temperature:0.1
(すぐ上と同じ2つ)

これらの候補から適当な名称案をスクリーニングすると、

東京医工革新大学(Tokyo Institute of Medical and Technical Innovation)
東京医科歯科工業大学(Tokyo Institute of Medical and Dental Technology)
東京先進医工大学(Tokyo Institute of Innovative Medicine and Technology)

このあたりがまともでしょうか。筆者個人としてはUniversity of~のパターンで「東京先進医工大学(University of Innovative Medicine and Technology)」なんかいいなと思っています。だいたいイノベーションが好きでしょうみんな。ネット上では大本命「東京医科歯科工業大学」、大穴で「さくら大学」「みずほ大学」などとネタにされています。

おまけ

おまけで東京医科歯科工業大学ガチャを置いておきますね。

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