見出し画像

【LLaMA 2: GPT-4に迫るモデル】英語解説を日本語で読む【2023年7月19日|@Matthew Berman】

LLaMA 2はオープンソースの大規模言語モデルであり、GPT-4の性能に近づけるための大きな進歩です。商業目的と研究目的の両方で使用可能であり、Microsoftとの提携も行われています。LLaMA 2は安全性にも重点を置いており、安全ガイドラインの違反率が低いことが報告されています。ただし、商業利用には条件があり、700万人以上のユーザーがいる場合はMetaの許可が必要です。LLaMA 2はコーディング能力が弱いとされており、GPT 4と比較しても劣るとされています。LLaMA 2の使用方法については、MetaのHugging Faceリポジトリからモデルとコードをダウンロードすることができます。
公開日:2023年7月19日
※動画を再生してから読むのがオススメです。


LLaMA 2 was just released this morning, and it represents a massive Leap Forward in open source large language models.

LLaMA 2は今朝リリースされたばかりで、オープンソースの大規模言語モデルにおける大きな飛躍を象徴している。

It brings open source models that much closer to GPT-4 Performance.

オープンソースのモデルをGPT-4の性能に大きく近づけます。

LLaMA 2 is completely open source for both research and Commercial purposes, well almost completely open source.

LLaMA 2は研究目的および商業目的の両方で完全にオープンソースです。ほぼ完全にオープンソースです。

I'll talk about that in a minute.

それについてはまた後で話そう。

I read over the entire 76-page white paper, I read all the news, and in today's video, I'm going to share all of the most interesting things that I learned.

私は76ページのホワイトペーパーを読みましたし、すべてのニュースも読みました。そして今日の動画では、学んだ中で最も興味深いことをすべて共有します。

At the end of the video, I'll show you how you can start using LLaMA 2 today.

ビデオの最後には、今日からLLaMA 2を使い始める方法をお見せします。

Let's go!

さあ、始めよう!

So, as I mentioned, LLaMA 2 was just released this morning, and according to meta AI, it is a suitable substitute for closed Source models, AKA ChatGPT.

今朝リリースされたばかりのLLaMA 2は、メタAIによると、クローズド・ソース・モデル、別名ChatGPTの代替になるとのことです。

Meta AI continues to contribute to the open source Community, which, to be honest, really continues to surprise me.

Meta AIは引き続きオープンソースコミュニティに貢献していますが、正直言って、それは私自身にとって本当に驚きです。

Look at this graph from the top tech companies in the world and their contributions to Hugging Faces open source community.

世界のトップテック企業とHugging Facesオープンソースコミュニティへの貢献のグラフを見てください。

This is especially true when considering the resources necessary to produce a model like this: the smartest people in the world, a ton of compute power, and expensive data sets, with some estimates putting the data sets alone at 25 million dollars.

このようなモデルを作成するのに必要なリソースを考えると、これは特に真実である。世界で最も賢い人々、1トンの計算能力、高価なデータセット、データセットだけで2500万ドルという試算もある。

The LLaMA 2 white paper is huge, and it spells out the entire recipe, including the model details, the training stages, the hardware, the data Pipeline, and The annotation process.

LLaMA 2のホワイトペーパーは膨大で、モデルの詳細、トレーニング段階、ハードウェア、データ・パイプライン、アノテーション・プロセスなど、すべてのレシピが綴られている。

So let's get some more specs out of the way.

それでは、もう少しスペックを説明しよう。

Now, it comes in two flavors and three sizes.

LLaMAには2つのフレーバーと3つのサイズがある。

They have the base LLaMA 2 model and another LLaMA 2 chat model specializing in dialogue.

ベースとなるLLaMA 2モデルと、対話に特化したLLaMA 2チャットモデルがある。

Both come in 7 billion, 13 billion, and 70 billion parameter sizes.

どちらも70億、130億、700億のパラメーターサイズがある。

They also created what many consider to be the sweet spot for large language model sizes, which is 34 billion parameters, but they didn't release it.

また、多くの人が大規模言語モデルのスイート・スポットと考える340億パラメータも作成したが、公表はしていない。

I'll talk more about that in a minute.

それについてはまた後で話そう。

LLaMA 2 was trained using a cluster of NVIDIA a100 gpus, and NVIDIA continues to benefit from the AI wave going on right now.

LLaMA 2は、NVIDIA a100GPUのクラスタを使ってトレーニングされた。NVIDIAは、現在進行中のAIの波から恩恵を受け続けている。

Meta trained LLaMA 2 on a 40 larger data set and doubled the context size from two thousand to four thousand tokens.

MetaはLLaMA 2を40以上のデータセットでトレーニングし、コンテキストのサイズを2,000から4,000トークンに倍増させた。

Now, although four thousand still isn't that big, subsequent fine-tuned models will likely greatly increase the size of the context window, as it has done with the LLaMA one model.

現在、4,000はまだそれほど大きくないが、LLaMA 1モデルでそうであったように、その後の微調整されたモデルは、コンテキストウィンドウのサイズを大幅に拡大する可能性が高い。

They also use the newer technique called grouped query attention to help improve inference scalability for the larger models.

また、より大きなモデルの推論スケーラビリティを向上させるために、グループ化されたクエリー・アテンションと呼ばれる新しい技術も使われる。

Last, something I find really interesting, they actually talk about carbon emissions as part of their white paper and announcement.

最後に、私が本当に興味深いと思うことだが、彼らはホワイトペーパーと発表の一部として、実際に二酸化炭素排出量について話している。

During the training process, these models take an enormous amount of compute power, and all that compute power is powered by electricity.

学習プロセスにおいて、これらのモデルは膨大な計算能力を必要とし、その計算能力はすべて電力で賄われている。

And of course, there's going to be carbon emissions from the production of that electricity.

もちろん、その電力の生産による炭素排出もあります。

So noting the efficiency and detriment to the environment, I see as a good thing.

だから、効率と環境への悪影響を考慮すれば、私は良いことだと思う。

Now, one thing that I was surprised by and found incredibly interesting is that meta partnered with Microsoft on this.

さて、私が驚いたこと、そして非常に興味深いと思ったことのひとつは、メタがこの件でマイクロソフトと提携したことだ。

And of course, Microsoft made an enormous investment in OpenAI, which is a completely closed Source large language model.

もちろん、マイクロソフトは完全にクローズド・ソースの大規模言語モデルであるOpenAIに莫大な投資をしている。

So why did they do that?

では、なぜそのようなことをしたのでしょうか?

Why is Microsoft partnering on an open-source model when it's clearly competitive with ChatGPT?

ChatGPTと明らかに競合しているのに、なぜマイクロソフトはオープンソースのモデルと提携したのでしょうか?

Well, let's look at the announcement.

さて、発表を見てみましょう。

They say, We offer developers choice in the types of models they build on, supporting open and Frontier models, and are thrilled to be meta's preferred partner as they release their new version of LLaMA 2 to commercial customers for the first time.

私たちは、開発者が構築するモデルの種類に選択肢を提供し、オープンとフロンティアのモデルをサポートします。そして、LLaMA 2の新バージョンを初めて商用顧客にリリースする際に、metaの優先的なパートナーとなることに興奮しています。

Now I want to point out a key word here, the word frontier.

ここで、フロンティアというキーワードを指摘しておきたい。

What they mean by that is the most Cutting Edge models, AKA GPT-4.

それは最先端のモデル、別名GPT-4を指しています。

So they're really making a clear distinction between open-source models and the better model GPT-4.

つまり、オープンソースモデルとGPT-4という優れたモデルを明確に区別しているのだ。

And so this is really a fine balance between Microsoft investing and contributing to open source, which because of Satya Nadella, their CEO, has been a core element of their culture, and protecting their multi-billion dollar investment in open Ai and chat GPT.

ですから、これはMicrosoftが投資し、オープンソースに貢献するという細かいバランスです。それは彼らのCEOであるサティア・ナデラのおかげで、彼らの文化の中核要素となっており、また、オープンAIとChat GPTへの数十億ドルの投資を保護することでもあります。

Now let's talk about what I consider to be the most important aspect of LLaMA 2.

さて、私がLLaMA 2の最も重要だと考える点について話そう。

Going back to LLaMA 1, it was an incredibly powerful model that was leaked from meta and spawned a wave of fine-tuned versions and lit a spark in the open-source llm room.

LLaMA 1に話を戻すと、それは信じられないほどパワフルなモデルで、metaからリークされ、微調整されたバージョンの波を生み、オープンソースのllmルームに火をつけた。

But one major drawback of LLaMA one was that it was not commercially viable.

しかし、LLaMA 1の大きな欠点は、商業的に利用できないことだった。

You can use it for research purposes, but you couldn't build products and companies on top of it.

研究目的で使うことはできるが、その上に製品や会社を作ることはできなかった。

But now, LLaMA 2 is commercially viable.

しかし今、LLaMA 2は商業的に実行可能です。

But remember when I said LLaMA 2 was almost completely open source?

しかし、LLaMA 2はほぼ完全にオープンソースだと言ったことを覚えているだろうか?

Well, it turns out that there's one caveat to that.

さて、それには1つ注意点があることがわかった。

If you have greater than 700 million users on a product built on top of LLaMA 2, you need to get meta's permission to use it.

LLaMA 2の上に構築された製品に7億人以上のユーザーがいる場合、それを使用するにはmetaの許可を得る必要があるのだ。

Now, of course, I can imagine that's one of those good problems to have as a company.

もちろん、それは企業として抱えるべき問題のひとつであることは想像に難くない。

If you grow a product to have 700 million users, you probably want to have that discussion, or you're already investing in your own internal models.

製品を7億人のユーザーを持つまでに成長させるのであれば、おそらくそのような議論をしたいでしょうし、あるいはすでに独自の内部モデルに投資していることでしょう。

So why did they do that?

では、なぜそのようなことをしたのでしょうか?

They did that to protect their model against their biggest competitors.

彼らはそれを彼らの最大の競合他社に対してモデルを守るために行いました。

They don't want Google, Microsoft, Amazon taking LLaMA 2 and building massive products on top of it.

グーグルやマイクロソフト、アマゾンがLLaMA 2を利用し、その上に巨大な製品を構築するのを防ぐためだ。

So although it is commercially viable for 99.9 percent of cases, I wouldn't say it is completely open source and commercially viable.

だから、99.9パーセントのケースでは商業的に実行可能だが、完全にオープンソースで商業的に実行可能とは言えない。

If I were building another company, I'd probably risk building on top of LLaMA 2 though and crossing the 700 million user bridge when I get to it.

もし私が別の会社を設立するのであれば、LLaMA 2の上に構築し、7億ユーザーの橋を渡るリスクを冒すだろう。

Now one thing that seems to be really missing from the research paper and the announcement is its coding ability.

ただ、研究論文や発表に本当に欠けているのは、それのコーディング能力です。

And from what I've gathered, it doesn't seem to have very strong coding ability.

私が調べたところでは、あまり強力なコーディング能力はないようだ。

In fact, I've seen it called out that GPT-4's coding ability far surpasses what is possible with even LLaMA 2.

実際、GPT-4のコーディング能力は、LLaMA 2で可能なものをはるかに凌ぐと言われているのを見たことがある。

Now let's talk about safety, which seems to be the primary focus of much of the work of LLaMA 2.

さて、LLaMA 2の作業の多くが主眼を置いていると思われる安全性について話そう。

In fact, almost half of the LLaMA 2 white paper is dedicated to talking about safety guardrails, red teaming, and evaluations.

実際、LLaMA 2のホワイトペーパーのほぼ半分が、安全ガードレール、レッドチーム、評価についての記述に費やされている。

So now let's go back to that 34 billion parameter model.

さて、ここで340億パラメータモデルに話を戻そう。

Why didn't they release it?

なぜ公表しなかったのでしょうか?

They have the 7 billion parameter model, the 13 billion, and the 70 billion, but they had the 34 billion, and they just didn't release it.

彼らは70億パラメーターモデル、130億パラメーターモデルを持っていますが、34億パラメーターモデルは持っていたけどリリースしなかったんです。

It turns out that the 34 billion parameter model was significantly less safe than the other versions of their model, both larger and smaller.

その結果、340億パラメータモデルは、他のバージョンのモデルよりも安全性が著しく低いことが判明した。

And so what they said is they are delaying the 34 billion parameter model due to the lack of time to sufficiently red team and get the safety to a better place.

そのため、レッドチームを十分に行い、安全性をより良いものにする時間がないため、340億パラメータモデルの公開を延期すると発表したのです。

Let's take a look at this graph to understand how much safer LLaMA 2 is than other models.

LLaMA 2が他のモデルよりどれだけ安全かを理解するために、このグラフを見てみましょう。

On the left side, in these dark blue, these are LLaMA 2 models.

左側にある濃い青色のものは、LLaMA 2モデルです。

On the right side, these are both open source and closed Source models.

右側はオープンソースとクローズドソースのモデルです。

And this is violation percentage, and the lower the better.

これは違反率で、数値が低いほど良いです。

So basically, how often did the large language model produce a result that violated its guidelines?

つまり、基本的に、大規模な言語モデルは、ガイドラインに違反する結果をどのくらいの頻度で出したのでしょうか?

And if we look closely on the left side, the 7, 13, and 70 billion parameter model all perform about the same in terms of violation percentage.

左側をよく見ると、70億、130億、700億のパラメータ・モデルは、違反率という点ではどれもほぼ同じです。

But the 34 billion parameter model is double that of the other models.

しかし、340億パラメータモデルは他のモデルの2倍です。

And that is why they're delaying the release of the 34 billion parameter model.

そのため、彼らは340億パラメータモデルの発表を延期しているのです。

But I'm personally very excited for that specific size because it's large enough to have great quality but small enough to fit on a high-end consumer-grade GPU.

しかし、私は個人的にこの特定のサイズに非常に期待しています。なぜなら、素晴らしい品質を持つのに十分な大きさでありながら、ハイエンドのコンシューマーグレードのGPUに搭載できるほど小さいからです。

Now, LLaMA 2 is censored, but if it's anything like LLaMA one, there are going to be fine-tuned versions of it that effectively remove the censorship altogether.

現在、LLaMA 2は検閲されているが、もしLLaMA 1のようなものであれば、検閲を事実上完全に取り除く微調整されたバージョンが登場するだろう。

So talking about safety and helpfulness, there has traditionally been a trade-off between these two things.

安全性と有用性について言えば、伝統的にこの2つはトレードオフの関係にある。

The more rewards that are given to safety during training, the less helpful a model becomes.

トレーニング中に安全性に報酬を与えれば与えるほど、モデルの有用性は低下する。

However, one of the big advancements of this paper is that meta seems to have solved that problem with a two reward model approach, one for helpfulness and one for saving.

しかし、この論文の大きな進歩の1つは、Metaがその問題を2つの報酬モデルアプローチで解決したように見えることです。1つは有益さのためのもの、もう1つは節約のためのものです。

Now they haven't released these reward models, but I really hope they do.

この報酬モデルはまだ発表されていないが、ぜひ発表してほしいものだ。

Okay, with all of that aside, meta still does say that there is a significant Prof performance gap between LLaMA 2 and the frontier models.

さて、そんなことはさておき、metaは依然としてLLaMA 2とフロンティアモデルとの間には大きな性能差があると言っている。

And the frontier models are GPT-4 by open Ai and palm 2 by Google.

フロンティアモデルは、オープンAiのGPT-4とグーグルのパーム2だ。

Okay, so now the part that I know you want to hear, how do I actually use this today?

はい、では今度は皆さんが聞きたいと思っている部分、これを今日どのように使うか、実際に教えます。

Well, you can download the models, the weights, and the code at meta's Hugging Face repository.

モデル、重み、コードはmetaのHugging Faceリポジトリからダウンロードできる。

And there are already fully hosted versions of the 7B and 13B models, all of which I'll link to in the description below.

すでに7Bモデルと13Bモデルの完全ホスティング版が存在しています。それらはすべて以下の説明欄にリンクを貼っておきます。

I plan on doing extensive testing on not only the base models and all the different sizes of them but all of the inevitable fine-tuned versions that come from the LLaMA 2 model.

私は、ベースモデルとそのすべての異なるサイズだけでなく、LLaMA 2モデルから生まれる必然的な微調整されたバージョンすべてについて、広範囲にテストを行う予定だ。

I'll be running all of the versions through my llm rubric, and I'm going to report the results to you.

すべてのバージョンを私のllmルーブリックにかけ、その結果を報告するつもりだ。

If you like this video, please consider giving me a like and subscribe, and I'll see you in the next one.

もしこの動画が気に入ったら、高評価とチャンネル登録をお願いします。次の動画でお会いしましょう。

この記事が気に入ったらサポートをしてみませんか?