Slide 1

Slide 1 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Bedrock のはじめ方 Machine Learning Developer Relations Takahiro Kubo アマゾン ウェブ サービス ジャパン合同会社

Slide 2

Slide 2 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3 つのステップ 準備 実行 監視

Slide 3

Slide 3 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3 自己紹介 アマゾン ウェブ サービス ジャパン合同会社 Machine Learning Developer Relations 久保隆宏 (Kubo Takahiro) ミッション 「機械学習を実用するなら AWS 」という認知を拡大すること。 10 年以上の業務コンサルタント経験、また研究開発していたテーマをプロダクトと してリリースした経験をもとにお話しします。

Slide 4

Slide 4 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 準備 実行 監視

Slide 5

Slide 5 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Bedrock : API から利用できる基盤モデル 5 Amazon だけでなく先進的スタートアップ企業の基盤モデルを提供 対話向けの LLM 質問回答、 業務フローの自動化 責任ある AI に 向けた学習 テキスト生成用 多言語対応 LLM 英語、西語、仏語 独語、葡語、伊語 蘭語 Amazon の構築した LLM テキスト要約 テキスト生成 テキスト分類 自由形式の Q&A 情報抽出 Embedding 検索 オープンソースの 画像生成 LLM 独自性、高精細、 リアルなロゴや デザイン生成 インペインティング 業務アプリ向けの テキスト生成モデル 要約、広告文、 対話、情報抽出 質問回答 JU RA S SIC -2 C L A U DE 2 S DXL 1 .0 A M A ZO N T IT A N C O M M AN D L L A M A 2 オープンソースの LLM 質問回答や文書読解 などの自然言語処理 タスク Coming Soon

Slide 6

Slide 6 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 知ってる ?? 6

Slide 7

Slide 7 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7 汎用的な基盤モデルだけでなく、文書校正や要約に特化したモデルを提供。 ※ Amazon Bedrock では基盤モデルのみ、 JumpStart ( 後述 ) で他のモデルを利用可能 文書の校正を支援する Wordtune などを開発する企業。 AI に より人が読み書きする方法の変革を目指す。 ※日本語は扱えない Bedrock Model Providers 1/6

Slide 8

Slide 8 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8 Claude は約百ページ超の 100,000 トークンを扱えるだけでなく、GPT-3.5 / GPT 4 と近しい精度を (日本語でも) 持つモデル (※1, 2 参照)。 ※1 https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard ※2 https://yuzuai.jp/benchmark OpenAI 在籍メンバーが 2021 年に創業。安全かつ制御可能な AI の開発を目指す。Amazon からは 40 億ドルを出資。 Bedrock Model Providers 2/6

Slide 9

Slide 9 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9 伊藤忠商事の決算報告書読み込ませ て、事業と業績について質問した例 (※1) 。 ① 事業は概ね正しく列挙。 ② 業績について数字と増減要因に 誤りがない。 ※1 :第 100 期 第 1 四半期報告書 Bedrock Model Providers 2/6

Slide 10

Slide 10 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 10 “The enterprise LLM” を掲げ、顧客自身のネットワーク / 環境 へのデプロイ、そこでのカスタマイズ、さらにサポートを提供。 テキスト生成の Command 、ベクトル表現の Embed といった基盤モデルの開 発に加え、マッキンゼーとの協業による導入支援、またサポートの提供も行う。 日本語は、理解しているが英語で返す。 Embedding のモデルは多言語対応している Bedrock Model Providers 3/6

Slide 11

Slide 11 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11 AI に対しオープンイノベーションのアプローチをとることを支持 し実践する。 Llama2 などのモデルをオープンソースで公開。 Llama2 は単体で高い性能を誇るだけでなく、オープンソースゆえにさまざまな 派生モデルが生まれている。 https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard Hugging Face の Chatbot Arena ではトップ 10 にオリジナル含め 4 モデルがランクイン。 ELYZA や rinna から日本語データで追加学習されたモデルも公開。 Bedrock Model Providers 4/6

Slide 12

Slide 12 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12 Stable Diffusion をはじめ、 Stable LM 、Stable Audio など多様なモダリティ のモデルを公開。日本法人を立ち上げ、日本語のモデルも公開。 世界をリードするオープンソースの生成 AI モデルの開発と展開を 行う企業。画像だけでなく言語、音声など多様なモデルを公開。 Japanese StableLM Alpha Bedrock Model Providers 5/6 11/13 商用利用可能な 画像 to テキストの モデルを公開

Slide 13

Slide 13 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13 オンラインで求めるあらゆるものをいつでも検索・発見できるこ と、地球上で最もお客様を大切にする企業になることを目指す Amazon Titan はコードを含めた幅広なコーパスで学習しているほか、不適切 または有害なコンテンツを減らすことで、責任ある AI の使用を支援。 Bedrock Model Providers 6/6

Slide 14

Slide 14 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 使い方 14

Slide 15

Slide 15 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. まだ Bedrock 使ったことがない方は Step5 までぜひ一緒にやりましょう! 15 YouTube 動画リンク

Slide 16

Slide 16 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 東京リージョンで使えます! ※利用可能なモデルに制限あり 1.“Amazon Bedrock” を AWS Console で検索

Slide 17

Slide 17 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Get started!

Slide 18

Slide 18 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3.“Model access” を選択

Slide 19

Slide 19 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4. Anthropic について “Submit use case details” を押す 表示される フォームに回答

Slide 20

Slide 20 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20 会社での使用を前提としたフォーム になっています。 所属の会社の情報を入れていただき、 社内検証用の建付けであれば Internal employees を選択、ユース ケースについては検証したい内容を 記載ください。 ( 日本語で書いて Amazon Translate で英 訳すると楽です。 )

Slide 21

Slide 21 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5. 待つ

Slide 22

Slide 22 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Save Changes のボタン 6. Anthropic も含めて全選択して “Save Changes”!

Slide 23

Slide 23 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 利用料金がかかるのでご注意ください価格は↓をチェック https://aws.amazon.com/jp/bedrock/pricing/ 7. Chat したり Image 生成したりする

Slide 24

Slide 24 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8. SageMaker Studio から使いたい場合 (1/3) ①SageMaker Domain の settings から Execution role を特定

Slide 25

Slide 25 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8. SageMaker Studio から使いたい場合 (2/3) ② IAM ロールの画面で Execution role を検索し、Create inline policy を実行

Slide 26

Slide 26 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8. SageMaker Studio から使いたい場合 (3/3) ③ JSON を選択し↓を張り付け。 { "Version": "2012-10-17", "Statement": [ { "Sid": "BedrockFullAccess", "Effect": "Allow", "Action": ["bedrock:*"], "Resource": "*" } ] }

Slide 27

Slide 27 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 準備 実行 監視

Slide 28

Slide 28 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Playground を使用する 28 Chat Text Image 3 種類を選択可能 ( 選べるモデルによって メニューは変動する )

Slide 29

Slide 29 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Playground を使用する : Chat 29 推論時のパラメーターを設定可能 Temperature: 低いほど確実な単語のみ採用する。 Top P: 出現確率が高い順に並べ合計 P になるまで採用。 Top K: 出現確率が高い上位 N 個から採用する。 Length: 出力長を制限。

Slide 30

Slide 30 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Playground を使用する : Chat 30 回答スタイルを設定可能

Slide 31

Slide 31 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Playground を使用する : Chat 31 インストラクションを設定すると 回答が変化

Slide 32

Slide 32 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Playground を使用する : Chat プロンプトエンジニアリング • 入力するテキストの内容や形式によって期待する返答が得られるよ うチューニングする。 • あるモデルで有効な方法が他のモデルでも有効とは限らない。 32 Anthropic Claude では ガイドラインが公開さ れている。 ※日本語訳版も公開さ れました※ https://docs.anthropic.com/claude/docs/introduction-to-prompt-design

Slide 33

Slide 33 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 準備 実行 監視

Slide 34

Slide 34 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 利用者が重要な秘密情報や特定個人情報を送信してい ないか心配で眠れない夜もある 34 Amazon Bedrock に送信したデータは Amazon および 3rd Party のモデ ルプロバイダーのモデルの学習に使用されることはありません

Slide 35

Slide 35 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Bedrock の実行履歴は CloudTrail に記録される 35 どのモデルをいつ呼び出したかを把握可能 (InvokeModel / InvokeModelWithResponseStrea)

Slide 36

Slide 36 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 具体的なプロンプトの中身を記録する場合は Model invocation logging をオンにする (Preview)。 36 Amazon S3 か CloudWatch に記録可能。 CloudWatch の場合、事前にロググループを作成 しておく (/aws/bedrock など)。 ロールは “Create and use a new role”で作成可能。

Slide 37

Slide 37 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 具体的なプロンプトの中身を記録する場合は Model invocation logging をオンにする (Preview)。 37 入出力だけでなく、設定された パラメーターまで取得可能。

Slide 38

Slide 38 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 準備 実行 監視 Amazon Bedrock どう活かす ?

Slide 39

Slide 39 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 生成系 AI のインパクトが大きいのはサービス開発・運用、営業 39 マッキンゼーのレポートに見る企業応用を促進する大規模言語モデルの評価方法 マッキンゼーの 「The economic potential of generative AI: The next productivity frontier」より。 開発者自身が効果を体験し、 他業務領域へ伝播していくのが 王道と考えられる。

Slide 40

Slide 40 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 開発者の生産性の広がり 40 コードの自動提案 営業メールの提案 稟議書の文言提案 契約書の条項提案 開発者が「当たり前」に享受し ている生産性は他の業務では全 然当たり前ではない。

Slide 41

Slide 41 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 「何を作るか」を考える プロダクトマネージャー へのステップアップは 今後より重要に ? 日本ではエンジニア出身が 33% 、 プロジェクトマネージャーが出身 が 18.5% と合わせて半数以上 (日本で働くプロダクトマネージャー大規模調査レ ポート 2022 by pmconf より) 41 「GitHub CEO トーマス・ドムケ氏が来日。いずれコードの 80% が AI で作成されるようになると予言」より引用 https://www.publickey1.jp/blog/22/github_ceo_80ai.html

Slide 42

Slide 42 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. ML Enablement Workshop: AI/ML を製品の成長につなげる計画を立てるワークショップ AI/ML の お試し AI/ML に よるサービスの 継続的成長 ワークショップ終了後から 1~3 か月の間に、最初の効果と学びが得られる計画を アウトプットします。 プロダクトマネージャー ( 製品責任者 ) 、開発者、データサイエンティストが組織 横断で参加し、経営層の支持のもと開催することで本番導入の確度を高めます。 参考 : プロダクトの成長をリードする生成系 AI の活用戦略 42

Slide 43

Slide 43 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. ML Enablement Workshop のコンテンツは すべて GitHub で公開中。 https://github.com/aws-samples/aws-ml-enablement-workshop 43 Spotify や Amazon 、 Uber など海外の データサイエンス活用事例をほぼ毎週更新。 ぜひ☆ & Watch をよろしくお願いします!

Slide 44

Slide 44 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. re:Invent 2023 は 11/27 ~ 12/1 開催 44 https://reinvent.awsevents.com/

Slide 45

Slide 45 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.