8
6

Amazon Bedrock 全14 LLM 日本語能力比較(Claude3 x2追加版)

Posted at

Bedrockに噂のClaude3が2モデル追加されたので、Bedrockで使用可能な全LLMに対して日本語で味噌汁の作り方を質問して日本語能力と知識を確認します。

2024/3/15現在、Claude3はLangChainのチャットモデルのみ対応されている為、そこのみチャットモデルを使用しています。

テストプログラム

japanese_test.py
from langchain_community.llms import Bedrock

prompt="質問:味噌汁の作り方を詳しく日本語で説明してください。"

# Jurassic-2 Mid
llm = Bedrock(model_id="ai21.j2-mid-v1",model_kwargs={"maxTokens":1000})
answer = llm.invoke(prompt)
print("Jurassic-2 Mid: " + answer + "\n")

# Jurassic-2 Ultra
llm = Bedrock(model_id="ai21.j2-ultra-v1",model_kwargs={"maxTokens":1000})
answer = llm.invoke(prompt)
print("Jurassic-2 Ultra: " + answer + "\n")

# Titan Text G1 - Lite
llm = Bedrock(model_id="amazon.titan-text-lite-v1",model_kwargs={"maxTokenCount":1000})
answer = llm.invoke(prompt)
print("Titan Text G1 - Lite: " + answer + "\n")

# Titan Text G1 - Express
llm = Bedrock(model_id="amazon.titan-text-express-v1",model_kwargs={"maxTokenCount":1000})
answer = llm.invoke(prompt)
print("Titan Text G1 - Express: " + answer + "\n")

# Claude Instant
llm = Bedrock(model_id="anthropic.claude-instant-v1",model_kwargs={"max_tokens_to_sample": 1000})
answer = llm.invoke(prompt)
print("Claude Instant: " + answer + "\n")

# Claude2.1
llm = Bedrock(model_id="anthropic.claude-v2:1",model_kwargs={"max_tokens_to_sample": 1000})
answer = llm.invoke(prompt)
print("Claude2.1: " + answer + "\n")

# Claude3 はとりあえずチャットモデルで
from langchain_community.chat_models import BedrockChat

# Claude3 Haiku
llm = BedrockChat(model_id="anthropic.claude-3-haiku-20240307-v1:0",model_kwargs={"max_tokens": 1000,})
answer = llm.invoke(prompt).content
print("Claude3 Haiku: " + answer + "\n")

# Claude3 Sonnet
llm = BedrockChat(model_id="anthropic.claude-3-sonnet-20240229-v1:0",model_kwargs={"max_tokens": 1000,})
answer = llm.invoke(prompt).content
print("Claude3 Sonnet: " + answer + "\n")

# Command-Light
llm = Bedrock(model_id="cohere.command-light-text-v14",model_kwargs={"max_tokens": 1000})
answer = llm.invoke(prompt)
print("Command-Light: " + answer + "\n")

# Command
llm = Bedrock(model_id="cohere.command-text-v14",model_kwargs={"max_tokens": 1000})
answer = llm.invoke(prompt)
print("Command: " + answer + "\n")

# Llama 2 Chat 13B
llm = Bedrock(model_id="meta.llama2-13b-chat-v1",model_kwargs={"max_gen_len": 1000})
answer = llm.invoke(prompt)
print("Llama 2 Chat 13B: " + answer + "\n")

# Llama 2 Chat 70B
llm = Bedrock(model_id="meta.llama2-70b-chat-v1",model_kwargs={"max_gen_len": 1000})
answer = llm.invoke(prompt)
print("Llama 2 Chat 70B: " + answer + "\n")

# Mistral 7B
llm = Bedrock(model_id="mistral.mistral-7b-instruct-v0:2",model_kwargs={"max_tokens": 1000,})
answer = llm.invoke(prompt)
print("Mistral 7B:" + answer + "\n")

# Mistral 8x7B
llm = Bedrock(model_id="mistral.mixtral-8x7b-instruct-v0:1",model_kwargs={"max_tokens": 1000,})
answer = llm.invoke(prompt)
print("Mistral 8x7B: " + answer + "\n")

実行結果

Jurassic-2 Mid
多egan にうがいしたが育てた軍人を backstory
たぶん言い方が変わると思います
質問の内容は、味噌汁を詳しく説明していますが、私はprecision att Conniesionの質問に普通あります。
漫画 DISCUSSION
漫画の話ではありませんか?
Jurassic-2 Ultra
味噌汁は材料として大根や튀김、떡や牛肉などがありますが、一般に醤油と味噌ナッツを用い、後は大根と茹でたご飯を加えて味噌汁を作ります。 
茹でたご飯がサイコロに倒れないように方法はいくつかあります。
その一つとして、一定の混率を持つサイコロをラーメンや餃子などからいくつか 取り除去することなくそのまま茹でています。
Titan Text G1 - Lite
Bot: I would be glad to help you. What do you want to know about the manufacturing process of Miso soup?
Titan Text G1 - Express
味噌汁は、醤油、味噌、水を混ぜて作る日本料理です。まず、醤油と味噌を混ぜます。そして、この混合物を水に加え、かき混ぜます。
この時、味噌汁が濃くなるように、醤油を少し程度加えます。
さらに、お好みで塩やこしょうを加えることができます。味噌汁は、寿司や刺身、うどんなどに食べることができます。
また、味噌汁は、健康的な食材であり、ビタミンやミネラルが豊富です。
Claude Instant
味噌汁の作り方は以下のとおりです。

材料は、味噌、水、大豆。オプションとして、ワカメやメンマなどの具材も使用できます。

1.鍋に水を熱する。水量は味噌1丁当たりおよそ100~150mlが標準量だと思います。
2.水が温まったら、味噌を少しずつ水に溶かしていきます。木べらなどで混ぜながら溶かします。
3.全量の味噌が溶けたら、弱めの火にしておよそ5分間煮立ちます。
4.大豆を加え、弱火で30分程煮詰めます。大豆が柔らかくなったら完成です。
5. OPTIONとして、煮立ったタイミングでワカメを入れ煮溶かしたり、完成後メンマなどをトッピングします。
6.盛りつけます。味見をして、少し水分が足りない場合は熱湯を加え調整します。

以上が基本的な味噌汁の作り方です。材料の量や工程は、口味や個人差によって調整してください。ぜひお試し下さい。
Claude2.1
味噌汁の作り方を詳しく説明します。

材料(2人分)
- 味噌 大さじ4
- だし汁 400ml
- トウモロコシ 1/2本
- わかめ 適量
- 青ねぎ 適量

作り方
1. だし汁400mlを鍋に入れ、中火で温める
2. 味噌大さじ4をだし汁に溶き入れる
3. トウモロコシを斜めに薄切りにし、鍋に入れる
4. わかめをよく洗い、適当な大きさに切って鍋に入れる
5. 青ねぎを小口切りにし、鍋に入れる
6. 沸騰したらすぐに火を止める
7. 手間暇かけて丁寧に和える

以上の手順で味噌汁の出来上がりです。トウモロコシやわかめの量は好みで調整してください。青ねぎや刻みネギを飾って完成です。
Claude3 Haiku
はい、味噌汁の作り方を詳しく日本語で説明します。

<材料>
- 水または出し汁
- 味噌
- 具材(例:じゃがいも、玉ねぎ、豆腐、ねぎなど)

<作り方>
1. 具材を洗って切る。じゃがいもは一口大、玉ねぎは薄切り、豆腐は角切り、ねぎは小口切りにする。
2. 鍋に水または出し汁(昆布だし、かつお節だしなど)を入れ、具材を入れる。
火にかけ、具材が柔らかくなるまで中火で煮る。
3. 味噌を鍋の一部に溶かす。味噌を溶くときは、鍋の汁を少量取り、味噌と混ぜてから鍋に戻す。
これにより、味噌の風味を損なわずに溶けやすくなる。
4. 味噌を溶き終えたら、弱火で5-10分ほど煮立てる。
具材が柔らかくなり、味噌の風味が出てきたら完成。
5. 最後に、ねぎなどの香味野菜を加えて味わう。
ご飯にかけたり、生卵を落としてもおいしい。

以上が、基本的な味噌汁の作り方になります。具材や出し汁、味噌の量などを好みで調整してみてください。
Claude3 Sonnet
はい、味噌汁の作り方を詳しく説明させていただきます。

【材料】
・水 4カップ
・味噌 3~4tablespoons
・だし昆布 5cm角くらい
・dried小魚(あられ、いわし、さば節など)
・野菜(ねぎ、えのき、豆腐、わかめなど好みのもの)

【作り方】
1. 鍋に水を入れ、昆布と小魚を入れて火にかけます。小魚は袋に入ったまま沈めます。
2. 沸騰する前に昆布を取り出します。これでおいしいだしができあがりました。
3. 野菜は一口大に切っておきます。
4. だしが沸騰したら火を弱め、味噌を溶いていきます。最初に小さじ1杯程度入れ、木べらでよくといて溶かします。
5. 味を見ながら、味噌を加えていき、好みの濃さに調整します。最後に小魚を取り出します。
6. 野菜を入れ、火を通したら出来上がりです。
7. 最後に小口切りのネギを散らすと香りが一層良くなります。

ポイントは、具材は和風だしを汚さないシンプルな物が良いこと。味噌は徐々に加え、味を確かめながら調整することです。だしと味噌の風味が活 
きた、優しい味が出来上がります。
Command-Light
Here's a brief explanation of how to make Japanese soup stocks, with some added details for better understanding:

1. **Base Stocks**:
   - **Kombu Daruma** - This is a common base stock used in many Japanese dishes. It is made by simmering dried kombu (a type of seaweed) in water for several hours. The kombu releases its nutrients into the water, resulting in a rich and flavorful stock.
   - **Katsuo stocks** - Another popular base stock, made from smoked bonito (katsuo) flakes. It is simmered with other ingredients like soy sauce, Mirin (a type of sweet cooking rice wine), and sometimes ginger and garlic. The smoked flavor of the katsuo adds depth and complexity to the stock.
2. **Other Ingredients**:
   - **Noodles** - Dried shitake mushrooms, konjac noodles, or other types of dried noodles can be added to the stock to enhance its flavor and texture. Simply add them to the stock after it has simmered for a while and allow them to absorb the flavors.
   - **Herbs and spices** - Fresh or dried herbs like kelp, basil, or coriander can be added to the stock for additional flavor. Similarly, spices like black pepper, turmeric, or chili flakes can be used to bring out the flavors.
   - **Fish or seafood** - If you want to add a seafood element, you can add cooked fish or shellfish to the stock. Just make sure to cook the seafood thoroughly before adding it to the stock to avoid food safety issues.
3. **Simmering and Seasoning**:
   - **Simmering time** - The length of time you simmer the stock is crucial. Simmering for several hours allows the flavors to meld 
and intensify.
   - **Seasoning** - Once the stock is ready, it should be seasoned with salt and pepper to taste. You can also add other seasonings like soy sauce, miso, or Mirin to enhance the flavors.
4. **Use in dishes**:
   - **Soup** - The stock can be used to make soups, such as miso soup or clear broth soups. Simply add your desired ingredients, such as vegetables, tofu, or noodles, and heat until warm.
   - **Stocks and sauces** - The stock can also be used as a base for stocks and sauces, such as soups, stews, or sauces. You can use it to add flavor and depth to your dishes.
   - **Beverages** - Some soups, likeRamen broth, are often served as a beverage, as the rich and flavorful stock is enjoyed on its own.

I hope this explanation is helpful, and please let me know if you have any further questions.
Command
To make the broth for ramen, you will need a few key ingredients and a simple preparation process. Here is a step-by-step guide to making ramen broth, which is the base of the dish.

1. Choose your broth base. You can use a combination of chicken, pork, and beef bones or just chicken bones. These bones are usually 
roasted first to bring out the flavor. You can also use a combination of meat and bones, such as pork belly or chicken thighs, for a more flavorful broth.
2. Prepare the aromatics. Aromatics are the ingredients that give your broth a deep and complex flavor. The most common aromatics used in ramen broth are onions, garlic, ginger, and leeks. These aromatics are often sliced and then briefly stir-fried to bring out their flavors before being added to the broth.
3. Add the seasoning. The broth is typically seasoned with salt, soy sauce, and sometimes mirin, which is a type of rice wine. These seasonings add depth of flavor and umami to the broth. You can also add other ingredients such as dried kombu (seaweed), dried shiitake mushrooms, or fish sauce to enhance the broth's flavor.
4. Simmer the broth. Once you have all the ingredients in the pot, bring the broth to a boil and then reduce the heat to a gentle simmer. Allow the broth to simmer for several hours, stirring occasionally and skimming off any impurities that rise to the surface. The longer you simmer the broth, the more concentrated and flavorful it will become.
5. Fine-tune the flavor. Once the broth has finished simmering, taste it and adjust the seasoning if needed. You can also add additional ingredients at this point to customize the flavor of the broth, such as more soy sauce, salt, or mirin. If you want a clearer broth, you can strain it through a fine-mesh strainer or cheesecloth to remove any impurities or fat that has risen to the surface.     
6. Use the broth immediately or store it for later use. If you are using the broth immediately, you can add the noodles and any additional ingredients you like. If you are storing the broth for later use, let it cool to room temperature before transferring it to an airtight container and storing it in the refrigerator for up to five days or in the freezer for up to two months.

By following these steps, you can create a flavorful and delicious ramen broth that serves as the foundation for your dish. You can customize the broth to your liking by experimenting with different combinations of aromatics, seasonings, and additional ingredients. 
Llama 2 Chat 13B
答え:味噌汁は、味噌(こんぺいと)と味噌汁(こんぺいと汁)という二つの要素で構成されています。味噌は、大豆や小豆などの穀物を主原料と 
して、麹(こう)と味噌麹(こんぺいとこう)を組み合わせて作られます。味噌汁は、味噌を水や dashi(出汁)と混ぜ合わせたもので、味噌の粘 
り強さや濃厚さを感じることができます。

以下は、味噌汁の作り方の詳細な日本語での説明です。

1. 味噌の作り方

味噌を作るには、大豆や小豆などの穀物を主原料として、麹(こう)と味噌麹(こんぺいとこう)を組み合わせて作ります。

麹は、穀物に寄生する微生物であるアスペルギルス・オーレアンス(Aspegillus oryzae)を使用して作られます。麹を作るには、穀物に水と塩を加えて混ぜ合わせ、温度と湿度を調整して寄生させます。麹を寄生させると、穀物中に含まれていたストレプトマイセス(Streptomyces)が増殖し、麹となります。
味噌麹は、麹を煮沸して作ります。煮沸することで、麹の中に含まれていたストレプトマイセスが殺され、味噌麹となります。
2. 味噌汁の作り方
味噌汁を作るには、味噌を水や dashi(出汁)と混ぜ合わせます。味噌汁の粘り強さや濃厚さを感じるには、味噌の量を調整することが大切です。 

味噌汁を作るには、以下のような方法があります。

* 味噌100g、水400ml、dashi100mlを混ぜ合わせる方法
* 味噌100g、水200ml、dashi100mlを混ぜ合わせる方法
* 味噌100g、水300ml、dashi50mlを混ぜ合わせる方法

味噌汁を作るには、味噌の粘り強さや濃厚さを調整することが大切です。また、味噌汁を長時間保存すると、味噌の粘り強さや
Llama 2 Chat 70B
回答:味噌汁は、日本の伝統的なスープであり、味噌( fermented soybean paste)、塩、砂糖、酒、醤油などを使用して作られます。以下は、味 噌汁の作り方の詳細な手順です。

1. 味噌を作る
味噌は、大豆を塩漬けにして、塩漬けを味噌にすることで作られます。まず、大豆を塩漬けにし、数日間塩漬けにしておくことで、大豆の味が強くなります。次に、塩漬けを味噌にするために、塩漬けを潰し、粉にします。

2. スープのbaseを作る
味噌汁のスープのbaseを作るために、鶏ガラ(chicken broth)や牛乳(beef broth)などを使用します。鶏ガラを作るには、鶏の骨や肉を煮詰めて、濾過して作ります。牛乳を作るには、牛の骨や肉を煮詰めて、濾過して作ります。
3. 味噌汁を作る
味噌汁を作るために、味噌をスープのbaseに加えます。まず、味噌を溶かし、スープのbaseに加えます。次に、塩、砂糖、酒、醤油などを加えて、 味を調整します。味噌汁は、味噌の味が強くなるにつれて、味が複雑になります。
4. 具を追加する
味噌汁に具を追加することで、味が更に豊かになります。具としては、豚肉、牛肉、鶏肉、卵、豆芽、椎茸、シイタケなどが使用されます。具を加える前に、味噌汁を沸騰させて、具を加えると良いです。
5. 味噌汁を仕上げる
味噌汁を仕上げるには、味噌汁を沸騰させて、具を加えた後、味を調整します。味噌汁を沸騰させることで、味が均一になり、具が柔らかくなります。

以上の手順で、味噌汁が完成します。味噌汁は、日本の伝統的なスープであり、味噌の味が強くなるにつれて、味が複雑に
Mistral 7B
答答:味噌汁(ミソスープ)は、日本の伝統的な食品です。以下に、味噌(みそ)を使って味噌汁を作り方を詳しく説明します。

1. 味噌を水に入れ、湯を熱ませます。
    * 味噌は、バクテリアの生活に必要な環境を作り、自分自身を食べて生長します。そのため、水に入れ、湯を熱ますことで、味噌が生成する特定の酸を作り、味噌を起こさせます。

2. 味噌を揚げます。
    * 味噌を揚げることで、味噌の蛋白質が固くなり、上部に薄い皮が形成されます。この皮は、味噌汁の基礎となり、その上に野菜や肉などを入 
れて、汁を作ります。

3. 味噌を揚げた後、水を入れ、湯を熱まします。
    * 味噌を揚げた後、水を入れ、湯を熱ますことで、汁を作ります。この水は、味噌の上に入れ、汁を作る際に使います。

4. 野菜や肉、豆腐などを入れます。
    * 味噌汁は、野菜や肉、豆腐などを入れて、汁を作ります。これらの食材は、味噌の特定の味をacompanies and enhances。

5. 味噌汁を火上に熱づけます。
    * 味噌汁を火上に熱づけることで、味噌の酸が揚げ、食材が熱になり、味が濃れます。

6. 味噌汁を食べる準備ができました。
    * 味噌汁は、温めて食べることが一般的です。食べる前に、味噌汁を冷やすと、味が損なわれる可能性があります。

このように、味噌を使って味噌汁を作る方法を説明しました。味噌汁は、日本の伝統的な食品であり、食べるだけでなく、健康にも有利です。例えば、味噌は、胃の酸出を促進し、胃の脂肪分解を支頓し、胃の酸性を抑制するといった効果があります。また、味噌は、胃の脂肪分解を促進し、脂肪を減らすといった効果もあります。

以上が、味噌汁の作り方を詳しく説明しました。味噌汁は、日本の伝統的な食品であり、食べるだけでなく、健康にも有利です。お勧めします!   
Mistral 8x7B
回答:味噌汁(みそしる)は、日本の食文化にとって非常に重要です。以下は、味噌汁を作るための手順です。

材料:
- 味噌(みそ): 2 杯
- 水(みず): 6 杯
- だし: 1 杯
- レバー: 1 枚
- 玉ねぎ: 1/2 個
- にんにく: 1 個
- しょうゆ: 1 テーブルソース
- 紅しょうが: 1 テーブルソース
- こしょう: 少々

手続き:
1. レバーを水に浸して、10 分間おいておきます。
2. 玉ねぎとにんにくを切り上げ、大きな鍋に入れます。
3. しょうゆと紅しょうがを加え、炒めます。
4. 水を加え、レバーを追加します。
5. だしを加え、味噌を溶かします。
6. こしょうを加え、味噌汁を煮立てます。
7. 味噌汁を味わって、調味料を調整します。

これで、味噌汁が完成です。味噌汁は、日本の主食として、ごはんや飯に添えて、食べることができます。ただし、味噌汁は、日本語の「お味噌」 とも呼ばれ、食事の始め方や、食事の間に飲むこともできます。

注意:レバーは、味噌汁の味によく合いますが、入れなくても構いません。また、だしは、魚の骨を煮詰めたものです。だしは、味噌汁に塩分やアミノ酸を与え、味を上げることができます。

結果まとめ

Titanって日本語話せましたっけ…?

モデル 回答言語 日本語能力 味噌汁能力(知識)
Jurassic-2 Mid 日本語 × 評価不能
Jurassic-2 Ultra 日本語 ×
Titan Text G1 - Lite 英語 理解はしてそう 評価不能
Titan Text G1 - Expres 日本語 ×
Claude Instant 日本語 ×
Claude2.1 日本語 ギリ○
Claude3 Haiku 日本語
Claude3 Sonnet 日本語 ギリ○
Command-Light 英語 理解はしてそう ×
Command 英語 理解はしてそう ×
Llama2-13b 日本語 ×
Llama2-70b 日本語 ×
Mistral 7B 日本語 ×
Mistral 8x7B 日本語 ×

結論

軽量であればClaude3 Haiku、性能重視なら(今は)Claude3 Sonnetを使いましょう

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6