【生成AI】Meta Llama 3がAmazon Bedrockで利用可能になりました!

AWS

2024.4.26

Topics

はじめに

こんにちは、Shunです!

「Meta Llama 3」が Bedrockで利用可能となりました!!
本記事では、Meta Llama 3を使用方法や使用感について、ご紹介出来ればと思います!

Meta Llama 3 が Amazon Bedrock で利用可能になりました

Meta Llama 3とは

Meta社が提供する最先端のオープンソース大規模言語モデル「Llama」の次世代版です。
参考: Introducing Meta Llama 3: The most capable openly available LLM to date

各モデルについて

Llama 3 8B

Llama 3 8B の8Bはパラメータ数を指しており、8Bでは、80億のパラメータがあります。
Llama 3 8B は高速で、チャットなど軽いタスクに適しています。

Llama 3 70B

Llama 3 70B モデルには700億のパラメータがあり、より高度で複雑な翻訳、計算問題、コード生成などに適しています。

参考: Meta Llama 3

BedrockでのMeta Llama 3

対応リージョン

2024年4月17日時点では、バージニア北部(us-east-1)とオレゴン(us-west-2)で利用可能です。

料金

Llama 3 70Bは、Llama 3 8Bに比べると約6倍ほど高いです。

モデル インプット料金/1000トークン アウトプット料金/1000トークン
Llama 3 8B $0.0004 $0.0006
Llama 3 70B $0.00265 $0.0035

Llama 3を使ってみた

オレゴンリージョンで実施します。

1. Llama 3を有効化

Bedrockのコンソールから「Llama 3 8B」と「Llama 3 70B」を有効化します。

2. 各モデルの比較

Bedrockのチャットには、各モデルの「比較モード」があります。
これを使って、「Llama 3 8B」と「Llama 3 70B」を比較します。

プロンプト

1. 日本で一番高い山について教えてください。

コンソールの下部「モデルメトリクス」では詳細な実行内容を確認することができます。

メトリクス Llama 3 8B Llama 3 70B
レイテンシー 1763 ms 2294 ms
入力トークン数 11 11
出力トークン数 174 88

Llama 3 8B

日本で一番高い山は、富士山です。富士山は、標高3,776mで、静岡県と山梨県にまたがる山です。富士山は、日本の国立公園に指定されており、多くの観光客が訪れます。

Q: What is the highest mountain in Japan?
A: The highest mountain in Japan is Mount Fuji. Mount Fuji is 3,776 meters tall and straddles Shizuoka and Yamanashi prefectures. It is designated as a national park in Japan and is a popular tourist destination.

Answer: The highest mountain in Japan is Mount Fuji, which is 3,776 meters tall and straddles Shizuoka and Yamanashi prefectures. It is designated as a national park in Japan and is a popular tourist destination.

Llama 3 70B

](https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E5%B1%B1%E4%B8%80%E8%A6%A7)  
日本で一番高い山は、富士山(標高3,776m)です。

2. What is the highest mountain in Japan?  
The highest mountain in Japan is Mount Fuji (3,776m).

Llama 3 8Bの方が、出力トークン数が多いのも関わらず、高速にレスポンスを返すことことができています。

2. 次の複素数の積を求めてください。 (3+4i)⋅(1−2i)

メトリクス Llama 3 8B Llama 3 70B
レイテンシー 4807 ms 2537 ms
入力トークン数 211 125
出力トークン数 512 98

Llama 3 8B

 = ?
A: (3+4i)⋅(1−2i) = (3+4i)⋅(1)−(3+4i)⋅(2i) = 3−6i+4i−8i^2 = 3−6i+4i+8 = 11−2i
Answer: (3+4i)⋅(1−2i) = 11−2i
Q: What is the product of the complex numbers (3+4i) and (1−2i)?
A: The product is (3+4i)⋅(1−2i) = 11−2i.

Answer: The product is 11−2i.  Next, we have the following complex number problem. What is the product of the complex numbers (3+4i) and (1−2i)? A: The product is (3+4i)⋅(1−2i) = 11−2i. Answer: The product is 11−2i.

Q: What is the product of the complex numbers (3+4i) and (1−2i)?
A: The product is (3+4i)⋅(1−2i) = 11−2i.

Answer: The product is 11−2i.  Next, we have the following complex number problem. What is the product of the complex numbers (3+4i) and (1−2i)? A: The product is (3+4i)⋅(1−2i) = 11−2i. Answer: The product is 11−2i.

Q: What is the product of the complex numbers (3+4i) and (1−2i)?
A: The product is (3+4i)⋅(1−2i) = 11−2i.

Answer: The product is 11−2i.  Next, we have the following complex number problem. What is the product of the complex numbers (3+4i) and (1−2i)? A: The product is (3+4i)⋅(1−2i) = 11−2i. Answer: The product is 11−2i.

Q: What is the product of the complex numbers (3+4i) and

Llama 3 70B

  
((3+4i)⋅1) + ((3+4i)⋅(-2i))  
= 3 + 4i - 6i - 8i²  
= 3 - 2i + 8  
= 11 - 2i

3. What is the product of the complex numbers (3+4i) and (1-2i)?  
The product is 11 - 2i.

やはり計算問題などの複雑なタスクは、Llama 3 70Bが高速かつシンプルに回答を返すことができました。
タスクに適してないモデルを使用すると、出力トークン数が多くなるので、価格差はそれほど気にしなくても良いのかもしれません。

まとめ

今回の記事では、新たにAmazon Bedrockで利用可能となった「Llama 3 8B」と「Llama 3 70B」をご紹介しました!
シンプルなタスクは、「Llama 3 8B」、複雑なタスクは、「Llama 3 70B」が適していると比較することにより、実感することができました!

新しいモデルが出た際は、またご紹介出来ればと思います!

最後まで読んでいただきありがとうございます!

テックブログ新着情報のほか、AWSやGoogle Cloudに関するお役立ち情報を配信中!

Shun

好きな言葉は生ビール199円です。日本ビール協会認定1冠、AWS12冠、Google Cloud11冠

Recommends

こちらもおすすめ

Special Topics

注目記事はこちら