Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
【re:Invent 2024 アプデ】 Prompt Routing の紹介
Search
Champ
December 17, 2024
Technology
560
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【re:Invent 2024 アプデ】 Prompt Routing の紹介
Champ
December 17, 2024
More Decks by Champ
See All by Champ
MCPサーバー、AWSのどこに置く?
champ
0
110
Kiro CLI 徹底解剖
champ
0
24
Amazon Bedrockの自動推論チェックを検証!
champ
0
20
Amazon BedrockでClaude 3.5 Sonnet v2のComputer useを試す
champ
0
130
【Bedrock×Athena】生成系AIでSlackデータの分析に挑戦
champ
0
230
Amazon Qの全体像を掴んでみよう!
champ
0
87
神アプデ?Amazon Comprehendで 生成系AIの毒性検出に挑戦!
champ
0
390
Bedrockで挑戦! 生成系AIで Slackコミュニケーションの活性化!
champ
0
470
Other Decks in Technology
See All in Technology
Claude code Orchestra
ozakiomumkj
3
990
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1.2k
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development with AI-DLC
yoshidashingo
0
140
Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026
gawa
8
380
AIを「創る」と「使う」の循環 — HRテックが実践するリアルなAI組織実装
taketo957
0
1.7k
ITエンジニアを取り巻く環境とキャリアパス / A career path for Japanese IT engineers
takatama
4
1.8k
Databricks 月刊サービスアップデート 2026年05月号
tyosi1212
0
210
サイバーセキュリティ概論 / Introduction to Cybersecurity
ks91
PRO
0
170
ABEMA の Datadog × OTel 基盤、 中から見るか? 外から見るか?
tetsuya28
0
110
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
3
220
React、まだ楽しくて草
uhyo
7
4.1k
ルールやカスタム機能、どう使う?理想の出力を引き出すために今知りたいIBM Bob 5つの機能
muehara
1
340
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
320
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
310
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
840
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
The Curse of the Amulet
leimatthew05
1
13k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
Typedesign – Prime Four
hannesfritz
42
3.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
HDC tutorial
michielstock
2
690
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Transcript
【re:Invent 2024 アプデ】 Prompt Routing の紹介
自己紹介
1. (Intelligent)Prompt Routing とは 新機能の概要 re:invent 2024 で発表された新機能(プレビュー) プロンプトの複雑さを自動判定し、最適なモデルへ自動 振り分け
2024/12/17 時点では以下のルーティングが可能 Claude Sonnet 3.5 と Claude 3 Haiku Llama 3.1 70B と Llama 3.1 8B なにが嬉しいのか? プロンプトを適切なモデルにルーティングすることでコ ストを下げることが可能
2. 仕組み 処理の流れ Prompt Routing は以下の流れで処理が行われます プロンプト受信 パフォーマンスの計算 ルーティングの実施 実行とフォールバック
それぞれについて解説していきます
2. 仕組み プロンプト受信 Prompt Routing がプロンプトを受け取る プロンプトの特徴を分析(長さ、複雑さ、要求タスクなど)
2. 仕組み パフォーマンスの計算 設定された各モデル(例:Sonnet と Haiku)でのパフォーマンスを計算 推論は実行せず、パフォーマンスの計算のみを実施 モデル間の品質差(quality_difference)を算出
2. 仕組み ルーティングの実施 quality_difference と 閾値(responseQualityDifference) を比較 quality_difference が 閾値未満の場合、軽量モデルを選択
閾値以上の場合、高性能モデルを選択 2024/12/17 時点ではデフォルト値は 0.0 になっている? ので、差が少しでもあれば Sonnet を選択
2. 仕組み ルーティングの実装 続き 簡略化したルーティングロジックのイメージ quality_difference = high_quality_model_score - lightweight_model_score
responseQualityDifference = 0.1 # 閾値が 0.1 の場合 if quality_difference < responseQualityDifference: # 品質差が小さい場合(0.1未満) # → 軽量モデル(Haiku)を使用 # → "この程度の質問なら軽量モデルで十分"というケース use_lightweight_model() else: # 品質差が大きい場合(0.1以上) # → 高性能モデル(Sonnet)を使用 # → "この質問は高性能モデルを使う価値がある"というケース use_high_quality_model()
2. 仕組み 実行とフォールバック ルーティングで選択されたモデル(Sonnet or Haiku)で推論を行う ルーティング失敗時やタイムアウト時は、フォールバックモデル(Sonnet)を使 用して推論
3. 実際に試してみる 3 つのテストケースを用意: 1. シンプルな質問 2. 中程度の質問 3. 複雑な質問
テストケース 1: こんにちは 「こんにちは」
テストケース 1: こんにちは 「こんにちは」 → Sonnet が選択される
テストケース 2: EC2 について質問 「AWS の EC2 とは何ですか?一行で説明してください」
テストケース 2: EC2 について質問 「AWS の EC2 とは何ですか?一行で説明してください」 → Sonnet
が選択される
テストケース 3: 英語で質問 What is your name?
テストケース 3: 英語で質問 What is your name? → Haiku が選択される
テストケース 4: 英語で EC2 について質問 What is EC2?
テストケース 4: 英語で EC2 について質問 What is EC2? → Haiku
が選択される
考察 日本語で質問した場合、それだけでスコアが上がっている可能性がある そのため、閾値の調整が必要 英語の質問は適切にルーティングされてそう
5. まとめ Prompt Routing のメリット 1. 簡単にプロンプトの内容に応じたモデルを動的に使用できる 2. 適切なモデルを選ぶことによってコストの削減・応答時間の改善が期待できる 実装時の注意点
日本語の場合は閾値の調整が必要 プレビュー中なので閾値の調整はできない?
ご清聴ありがとうございました!