見出し画像

【LLaMA】英語解説を日本語で読む【2023年4月25日|@WorldofAI】

LangChainの解説です。
公開日:2023年4月25日
※動画を再生してから、インタビューを読むのがオススメです。


Hey what is up guys welcome back to another youtube video at the world of AI.

こんにちは、AIの世界のYouTubeビデオにお帰りなさい。

In today's video I'm going to be showcasing LLaMA academy.

今日のビデオでは、LLaMAアカデミーを紹介します。

Basically it's a new project aimed to teaching GPT's which is a generative pre-trained transformer and it's basically showing you guys how to read API documentations using LLaMA which is another large language model for APIs.

基本的には、GPT(generative pre-trained transformer)を教えることを目的とした新しいプロジェクトで、API用の大規模言語モデルであるLLaMAを使って、APIドキュメントの読み方を紹介するものです。

And it also utilizes Lora which is LLaMA oracle for APIs as well as LangChain which is language model chain and this is something that I've highlighted previously in my videos.

また、API用のLLaMAオラクルであるLoraや、言語モデルチェーンであるLangChainも利用しています。これは、以前私のビデオで紹介したものです。

And what the goal is is that this project is trying to enable GPT's to learn and use new APIs such as Stripe and Notion or even your own products API.

このプロジェクトのゴールは、GPTがStripeやNotion、あるいは自社製品のAPIなどの新しいAPIを学習して使えるようにすることです。

And this is quite revolutionary, guys, because then you're going to be able to host different API documentations, and it'll basically teach different language models as well as applications on how to code and utilize certain types of prompts to actually help you with certain generations of maybe websites.

そしてこれはかなり革新的です、皆さん。なぜなら、異なるAPIドキュメントをホストできるようになり、基本的には、さまざまな言語モデルやアプリケーションにコードを書き、特定のタイプのプロンプトを利用して、たとえばウェブサイトの生成を手助けする方法を教えることができます。

It might be utilized for JavaScript and many different things for different software developers.

JavaScriptや、さまざまなソフトウェア開発者のためのさまざまなものに活用されるかもしれません。

But with that thought guys before we get into the gist of that I have a lot of videos and a lot of content that might be very beneficial for you guys so I highly recommend that you check it out.

しかし、そのような考えから、その要点に入る前に、私は多くのビデオと、あなた方にとって非常に有益かもしれない多くのコンテンツを持っているので、ぜひそれをチェックすることをお勧めします。

Continuously going to be uploading stuff and always going to be providing you guys with the best content.

これからもアップロードを続け、常に最高のコンテンツを皆さんに提供するつもりです。

So I highly recommend that you check out all my other previous videos as it's very detailed and there's a lot of value that will definitely benefit you.

だから、私の他の過去のビデオもすべてチェックすることを強くお勧めします。非常に詳細で、間違いなくあなたのためになる価値がたくさんあります。

And with that thought, guys, if you haven't subscribed, it would mean the world to me if you could do so.

もしまだ購読していないなら、購読してもらえるととてもうれしいです。

Please turn on the notification bell, like this video, and comment anything that you want to see in the future updates, as I'll try my best to upload with the pace I have.

通知ベルをオンにして、このビデオに「いいね!」して、今後のアップデートに望むことがあればコメントしてください。

And with that thought let's get right into the video.

ということで、さっそく動画に入りましょう。

So, as I talked about, LLaMA Academy has basically the potential to be viable as well as a very valuable tool for software developers.

さて、今回お話したように、LLaMA Academyは基本的にソフトウェア開発者にとって非常に価値のあるツールであると同時に、実現可能な可能性を持っています。

And this is something that I'm going to be explaining in today's video, where I'm going to be showing you guys a demonstration of what it's trying to do, explain you guys a little bit more about its analysis, going to show you guys the flow chart of how that data is basically flowed through.

今日のビデオで説明することですが、皆さんにこれが何をしようとしているのかのデモンストレーションを見せ、もう少し分析について説明し、データがどのように流れているかを示すフローチャートを皆さんに見せ

I'm going to talk a little bit about the installation, but I'm not going to be showing you guys how to install it, because this is basically for research purposes at the moment.

インストールについても少しお話ししますが、これは研究用なので、インストール方法をお見せするつもりはありません。

It's basically open source right now at this moment, but you're not able to, not everyone will be able to install it because of the requirements, which I'll talk about a little bit later.

基本的にはオープンソースですが、要件があるので、誰でもインストールできるわけではありません、後で少しお話します。

But this is a very hardware-intense like application, so you might need a lot of different like requirements to actually run this capability on your actual local desktop.

しかし、これは非常にハードウェアを必要とするアプリケーションなので、実際にこの機能をローカルデスクトップで実行するためには、さまざまな要件が必要になるかもしれません。

So, before we actually get into all that, I'm going to be talking a little bit more about the analysis of what this actual application is and some of the use cases.

そこで、実際にこのアプリケーションを使う前に、このアプリケーションの分析とユースケースについてもう少しお話ししたいと思います。

And as we talked about, it's basically going to be teaching LLaMAs on how to code, basically through different GPTs, and it will read API documentations.

先ほどもお話したように、基本的にはラマにコードの書き方を教え、GPTを使い、APIドキュメントを読むというものです。

Now, LLaMA Academy has been able to allow developers to do this so much easier, and it's very easy to like quickly learn and use different APIs, including their own product's API.

ラマ・アカデミーのおかげで、開発者はこの作業を非常に簡単に行うことができ、自社製品のAPIを含め、さまざまなAPIを素早く学習して使用することができます。

And not only is it able to use just Notion as well as Stripe, but it's able to utilize different types of web API as well as your own product's API, which could be very beneficial for a lot of different software developers.

また、NotionやStripeだけでなく、さまざまな種類のWeb APIや自社製品のAPIを利用することができ、多くのソフトウェア開発者にとって非常に有益なものとなっています。

Now obviously with LLaMA Academy, developers can also host their own API implementation instead of just hosting API documentations which is something that a lot of people are very frustrated with.

LLaMA Academyを使えば、多くの人が不満に思っているAPIドキュメントのホスティングではなく、自分たちのAPI実装をホスティングすることもできます。

Now this project has been created by Daniel Gross and I highly recommend that you check it out guys.

このプロジェクトはDaniel Grossが作成したもので、ぜひ皆さんもご覧になってみてください。

I'm going to leave all the links down in the description below.

このプロジェクトはDaniel Grossによって作られました。

Definitely give this guy a follow as well as support the actual project by giving it a star as well as maybe installing it locally if you have the capabilities to do so.

また、このプロジェクトに星をつけて応援してください。そして、もしあなたがそうできるのであれば、ローカルにインストールしてください。

Now the API docs as well as running the script is through LLaMA which is another large language model and this basically is something like mini GPT where it can be hosted on the developer's server and it allows users to call it to generate different API glues.

APIドキュメントとスクリプトの実行は、もうひとつの大きな言語モデルであるLLaMAを通して行います。これは基本的にミニGPTのようなもので、開発者のサーバーでホストすることができ、ユーザーはこれを呼び出してさまざまなAPIグルーを生成することができます。

Now, this can save developers so much time and effort from building softwares that relies on APIs, and this is something that I'm going to be showing you guys in this demo.

これにより、開発者はAPIに依存するソフトウェアを構築する際の時間と労力を大幅に削減することができます。このデモでは、このようなことをお見せします。

And what Daniel does is that basically he's saying that it's showing LLaMA how to write API code, and it's not just through ChatGPT plugins, but you're able to actually do this by fine-tuning the model and learning how it can talk to Notion, which is another application by reading its API docs.

そして、Danielがやっていることは、基本的にLLaMAにAPIコードの書き方を教えることで、それはChatGPTプラグインだけでなく、モデルを微調整して、別のアプリケーションであるNotionと会話する方法を学び、そのAPIドキュメントを読むことで実際にこれを行うことができます。

And we can see this in the example right here.

そして、この例でそれを確認することができます。

So, it installs all the packages and all the language models, and what the human does is it gives it a prompt: get me all the comments from a specific page from using Notion API.

パッケージと言語モデルをすべてインストールし、人間が行うのは、「Notion APIを使って、特定のページのコメントをすべて取得する」というプロンプトを出すことです。

And the assistant, the model, actually like the application, is going to use JavaScript as well as work towards creating this code.

アシスタントは、アプリケーションと同様にJavaScriptを使い、このコードを作成します。

And we can see at the end it's able to formulate the actual API notion, and it's able to talk to Notion with this API, and you're able to get this code.

そして最後に、実際のAPI概念を定式化することができ、このAPIを使ってNotionと会話することができ、このコードを取得することができることがわかります。

And this is just a little example as to what they've been able to retain with their application.

これは、彼らがアプリケーションで保持できたほんの一例にすぎません。

So, this is quite remarkable, guys, as it's going to save a significant time and effort from building software as that rely on API's.

このように、APIに依存したソフトウェアを構築する際の時間と労力を大幅に削減することができるのは、非常に素晴らしいことです。

So this is quite remarkable, and I definitely recommend if you're interested in this, obviously take a look at it.

ですから、これは非常に驚くべきことで、これに興味がある方は、ぜひ見てみることをお勧めします。

But this is something that they're like continuously working on, and it's not something they've even noted that it's not something that is released at this current moment as it's still currently under construction.

しかし、これは彼らが継続的に取り組んでいることであり、現在まだ建設中であるため、今この瞬間にリリースされるものではないとさえ言われているのです。

So it's going to take some time before it's actually fine-tuned and released with the actual official release, as they haven't even released packages to like sincerely work towards, as it's currently under construction.

ですから、実際に微調整して正式リリースされるまでには、まだ時間がかかりそうです。現在、建設中のため、真摯に取り組むためのパッケージすら公開されていません。

So with that thought let me now go on to the next step where I'm going to show you guys a little bit more about the flowchart as to how it works.

というわけで、次のステップに進み、フローチャートでその仕組みをもう少し詳しく紹介したいと思います。

So there's basically four steps as to how this pipeline of LLaMA Academy is basically functioning in and these steps are the crawling, data generation, fine-tuning and the deployment and we can see that over here in this flowchart.

LLaMA Academyのパイプラインが基本的にどのように機能しているかに関して、基本的には4つのステップがあります。それらは、クローリング、データ生成、ファインチューニング、デプロイメントで、このフローチャートでそれを確認することができます。

Now, for the first step, which is crawling, this is where the actual LLaMA Academy crawls the web.

最初のステップであるクロールでは、実際のLLaMA Academyがウェブをクロールします。

Basically, it sources it through different API documentations, and this first step is quite necessary as it collects data for the next step, which is the data generation.

この最初のステップは、次のステップであるデータ生成のためのデータを収集するために非常に必要です。

Now, in this data generation step, you're able to get LLaMA Academy to use GPT-3.5, which is the free version from OpenAI's product, as well as it utilizes GPT-4 models, which might require you to provide an open API key, as it's going to be able to generate synthetic data.

このデータ生成ステップでは、LLaMA Academyを使ってGPT-3.5を利用できます。これはOpenAIの無料版製品です。また、GPT-4モデルも利用しており、オープンAPIキーを提供する必要があるかもしれませんが、合成データを生成できるようになります。

And what can be done with this is that by using the collected API documentation to generate the code, it also uses snippets and relative text from the first step to generate the data.

そして、これによって何ができるかというと、収集したAPIドキュメントを使ってコードを生成し、最初のステップのスニペットや相対テキストも使ってデータを生成するのです。

And then it uses to actually fine-tune using Vaikuna 13b model in the next step.

そして、次のステップでVaikuna 13bのモデルを使って実際に微調整を行うのです。

And with this next fine-tuning, we're able to get a fine-tuned version of the synthetic data that is generated in the previous step.

そして、この次の微調整によって、前のステップで生成された合成データの微調整版を得ることができるのです。

Now, with this step, it takes a crucial step towards actually improving the model's ability to understand and generate code.

このステップでは、モデルがコードを理解し生成する能力を実際に向上させるための重要なステップを踏んでいます。

That is actually related to your first step, which is the crawling, where it sources from website data to get the right information for your code.

これは、最初のステップであるクロールと関連しており、コードのために適切な情報を得るためにウェブサイトのデータから情報を取得します。

Lastly, it's obviously going to take the next steps to deploy it, and what it does is that it involves hosting the newly fine-tuned model on the actual server.

最後に、次のステップであるデプロイを行うのですが、これは何をするかというと、新しく微調整されたモデルを実際のサーバーでホストすることになります。

It depends if you're using a local computer; you might source it through your local desktop, but users can basically find and then call the model to generate code related to the API's documentation that was crawled from the first step.

ローカルコンピューターを使用しているかどうかによりますが、ローカルデスクトップから取得するかもしれません。しかし、基本的にユーザーはモデルを見つけて呼び出し、最初のステップでクロールされたAPIのドキュメントに関連するコードを生成できます。

We can see this in this example over here, where it starts off with the reference that you give it, and it sources it through different data sets as well as on the web.

この例では、あなたが与えたリファレンスから始まり、さまざまなデータセットやウェブ上でそれを取得します。

What it next does is that it uses GPT models; in this case, you can use GPT-3.5 or GPT-4, and from this, it's basically sourcing as well as looking at synthetic data to generate the actual context of your API documentation.

この場合、GPT-3.5またはGPT-4を使用します。ここから、基本的にソースと合成データを見て、APIドキュメントの実際のコンテキストを生成します。

From this, it is sent to the vector store, which is the API docs; obviously, it could be sent to another LLM, or in this case, we're going to be using Vaikuna 13b model, which is used to fine-tune it.

ここから、APIドキュメントであるベクターストアに送られます。当然、別のLLMに送ることもできますし、今回はVaikuna 13bモデルを使って、微調整をします。

Once that is done, it is deployed to the final step in which it is hosting the newly fine-tuned model on an actual server, and this is something that we can see.

それが終わると、最終段階として、新たに微調整されたモデルを実際のサーバーにホストするためにデプロイされるのですが、これを見ることができます。

In this case, they've prompted it to calculate the 20-day moving average for the stock symbol Apple.

このケースでは、Appleという銘柄の20日移動平均を計算するように指示されています。

This is Apple's stock ticker, and it basically determines if the current stock is above and below the average.

これはAppleの株価ティッカーで、基本的には現在の株価が平均値を上回っているか下回っているかを判断します。

What it does is that it sends it through the crawling phase, the next step is it uses GPT-3.5 or GPT-4 model, and from the data generation from the synthetic data, it then fine-tunes it using Vaikuna's 13b model.

クロールの段階で、GPT-3.5やGPT-4のモデルを使い、合成データからデータを生成し、Vaikunaの13bモデルを使って微調整を行います。

From that, it is able to deploy it onto a server, and we can see it over here from the code that we get over here.

そして、それをサーバーにデプロイするわけです。

Something that is cool to note is that it uses both GPT-3.5 as well as GPT-4 models to generate the synthetic data, and we're able to see that they're continuously working on different models to actually get you different parameters for data searching as well as to give you the best generative context of your code.

注目すべきことは、GPT-3.5とGPT-4の両方のモデルを使用して合成データを生成し、データ検索のさまざまなパラメーターや、コードの最適な生成コンテキストを提供するために、さまざまなモデルの開発に継続的に取り組んでいることです。

This is something that they're going to continuously work on, guys, because this is just the start of what their project is.

これは彼らのプロジェクトの始まりに過ぎないので、今後も継続的に取り組んでいくつもりです。

This is fairly new, as it was something that was released very shortly around early April, April 19, obviously, it was the post about what it is trying to do, and this is something that they're continuously going to be working on.

これはかなり新しいもので、4月初めごろ、4月19日に非常に短期間でリリースされました。明らかに、それが何をしようとしているのかについての投稿で、これは彼らが継続的に取り組んでいくものです。

So it's great to see as well as have a tab on this project because it's going to be something that could be very viable to use for different software developers.

このプロジェクトは、さまざまなソフトウェア開発者にとって、非常に実用的なものになりそうだからです。

Now, in terms of installing it, guys, one thing before you even try to install it, make sure you have the hardware requirements.

さて、インストールに関してですが、インストールする前に1つだけ、ハードウェアの要件を確認しておいてください。

Obviously, you can have it on a Google Colab, but at the same time, you need to have the right GPU to actually run this because it is very tech-heavy.

もちろん、Google Colabにインストールすることも可能ですが、同時に、これを実際に動かすには適切なGPUが必要です(非常に技術が必要なため)。

Because if you can read this right over here, the code is tested with one RTX, which is an instance of in Vast AI, and the thing is the peak RAM is basically 27 GB.

というのも、このコードはVast AIのインスタンスである1つのRTXでテストされており、RAMのピークは基本的に27GBです。

Therefore, any GPU with RAM that is greater than 30 GB will be safe for fine-tuning.

したがって、RAMが30GBを超えるGPUであれば、微調整の際に安全であることがわかります。

So that's basically saying that if you do not have anything, if you have any type of RAM that is below 30 GB, don't even try, guys, because this thing is going to wreck your PC or whatever laptop or anything that you have.

つまり、もしあなたが何も持っていないなら、30GB以下のRAMを持っているなら、試さないでください、ということです。

Because this thing is going to require a lot of RAM to actually fine-tune as well as use this application.

このアプリケーションを使うには、多くのRAMが必要になるからです。

So, I highly recommend that you wait it out a little bit, wait until it gets posted on different web servers so that you can actually start working and learning how to use it online.

だから、少し待って、いろいろなウェブサーバーに掲載されるのを待つことを強くお勧めします。

Obviously, if you do have the requirements, it is quite easy to run it; you just have to have Git, Python, Visual Studio Code to actually install it on your local desktop.

Git、Python、Visual Studio Codeがあれば、ローカルのデスクトップにインストールすることができます。

I have a rough demonstration of how it works on my previous videos, so if you want to check that out, definitely do so.

以前のビデオで、どのように動作するかの大まかなデモンストレーションをしているので、もしそれをチェックしたいのであれば、ぜひそうしてください。

In each of these different LM videos, I actually give you a rough outline of how to actually do it; it's quite fairly easy, but just make sure that you have the right requirements to do so.

LMの各ビデオでは、実際にどのように行うかの大まかなアウトラインを紹介しています。

Now, in terms of its plans, we'll be going over some things as well as their roadmap as to what they're trying to achieve.

さて、これからLMの計画について、彼らが何を目指しているのか、そのロードマップを紹介します。

Something I also wanted to note before I get into the next part is that the code files on this repository on GitHub, they're able to provide certain understanding, like descriptions of what each folder is, so I definitely recommend that if you don't have any idea of what these folders are, definitely have a read-through of these as you'll get a better understanding of what it actually means.

次に進む前に、GitHubのこのリポジトリのコードファイルは、各フォルダーの説明のように、ある程度の理解を提供できることを付け加えておきたいと思います。ですので、これらのフォルダーが何であるか全くわからない場合は、ぜひ一読して、実際に何を意味するのかをより理解できるようになることをお勧めします。

And make sure that if you're going to be using this, you have your API keys as well as the different requirements that they actually have, and this is something that you can read on their page.

そして、もしあなたがこれを使うのであれば、APIキーと、彼らが実際に持っているさまざまな要件を確認してください。

Now, in terms of the actual project's potential, this project is going to be quite useful for a lot of cases, as I stated before.

さて、実際のプロジェクトの可能性についてですが、このプロジェクトは、先に述べたように、多くのケースでかなり役に立つと思います。

But firstly, the one thing that I wanted to talk about is how it aims to tackle a problem that has been challenging in the field of AI, which is teaching GPTs how to read and understand API documentations.

しかし、まず、私が話したかったのは、AIの分野でチャレンジングだった問題、つまり、GPTにAPIドキュメントの読み解き方を教えるという問題に取り組もうとしている点です。

This is an important problem to actually solve; it has a lot of different potential, like progresses that developers might have, as it's a significant amount of time that will be cut if this project is able to proficiently innovate its actual application.

これは実際に解決すべき重要な問題です。このプロジェクトが実際のアプリケーションを巧みに革新することができれば、かなりの時間を削減することができるので、開発者が持つかもしれない進歩のような、さまざまな可能性を持っているのです。

This is going to basically help software developers save a lot of time and efficiently work on different APIs and documentations.

このプロジェクトは、ソフトウェア開発者が多くの時間を節約し、さまざまなAPIやドキュメントを効率的に作成するのに役立つことでしょう。

Now, secondly, LLaMA Academy is an open-source project, which means that anyone can actually contribute to it and actually help improve it.

次に、LLaMA Academyはオープンソースのプロジェクトであり、誰でもこのプロジェクトに貢献し、実際に改良を加えることができます。

So, if you guys have the right mindset as well as the right understanding of how things work, I'd definitely recommend that maybe if you are interested, you can work with this project, contact people such as Daniel on their Twitter, and get a better understanding of how you can actually provide your efforts to improve this project and potentially solve more complex problems in the future.

だから、皆さんが正しいマインドセットと物事の仕組みを理解しているなら、興味があるなら、このプロジェクトに取り組んで、TwitterでDanielなどの人々と連絡を取り、実際にどのように努力を提供してこのプロジェクトを改善し、将来的にはもっと複雑な問題を解決できるようになるかをより理解できるようになることをお勧めします。

The second feature that was actually talked about is how they're going to basically implement flash attention, and these are some of the things that they're going to continuously work on.

また、2つ目の特徴として、フラッシュアテンションをどのように実装していくのかが語られましたが、これらは、彼らが継続的に取り組んでいくことです。

So, I highly recommend that you keep a tab on this, guys.

ですから、皆さんもこのプロジェクトに注目することを強くお勧めします。

Obviously, this is a project that is under construction, so keep that in mind before you start to use it because this is something that will be a project that will continuously innovate.

もちろん、これは建設中のプロジェクトなので、使い始める前にそのことを心に留めておいてください。なぜなら、これは継続的に革新していくプロジェクトだからです。

So, keep a tab on this because it's going to be something that could be a potential breakthrough.

だから、ブレイクスルーになる可能性のあるものになるだろうから、これを監視しておいてくれ。

But with that thought, guys, I hope you found this video informative and you were able to get some sort of value out of it.

しかし、このビデオが有益で、何らかの価値を得ることができたなら、幸いです。

I'm going to leave all the links down in the description below.

下の説明文にすべてのリンクを残しておくつもりです。

Definitely give a shout-out, I'm definitely giving a shout-out to Daniel for creating such an amazing application.

このような素晴らしいアプリケーションを作ったダニエルに、ぜひともエールを送ってください。

Definitely leave a like as well as a star on the GitHub because this is something that is going to support these guys in producing different types of applications.

GitHubに「いいね!」と「スター」をつけてください。これは、彼らがさまざまな種類のアプリケーションを作るのをサポートするためのものですからね。

Now, with that thought, guys, if you haven't seen any of my previous videos, I highly recommend that you do so.

もし、まだ私の過去のビデオを見たことがないのなら、ぜひ見てください。

If you want me to upload anything, definitely let me know, and with that thought, guys, thank you so much for watching.

もし何かアップロードしてほしいものがあれば、ぜひ教えてください。それでは、ご覧いただきありがとうございました。

Please subscribe, turn on the notification bell, like, and comment.

購読、通知ベル、いいね!、コメントをお願いします。

And with that thought, guys, have an amazing day, keep a smile, and I'll catch you guys with the next upload.

そして、みんな、素晴らしい一日を、笑顔で過ごしてください!また次のアップロードで会いましょう。

Peace out, fellas.

それでは、また。

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