Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon Bedrock概要と生成AIの基礎 / 20231118-jawsug-niig...

kasacchiful
November 18, 2023

Amazon Bedrock概要と生成AIの基礎 / 20231118-jawsug-niigata-15

2023/11/18 (土) JAWS-UG 新潟 #15 にて発表した資料。

JAWS-UG 新潟 #15 Amazon Bedrock ハンズオン
https://jawsug-niigata.connpass.com/event/299332/

kasacchiful

November 18, 2023
Tweet

More Decks by kasacchiful

Other Decks in Programming

Transcript

  1. Classmethod, Inc. Solutions Architect / Software Developer AWS Community Builder

    (Serverless) Favorite: Community: • JAWS-UG Niigata • Python ML in Niigata • JaSST Niigata • ASTER • SWANII • Cloud fl are Meetup Niigata • etc. Hiroshi Kasahara @kasacchiful @kasacchiful 2
  2. ੜ੒AIͷ୅දతͳྫ • ࣗવݴޠੜ੒ • ChatGPTͷΑ͏ʹɺਓ͕ؒ࡞ͬͨΑ͏ͳจষΛੜ੒͢Δٕज़ • ը૾ੜ੒ • GAN (Generative

    Adversal Network) ͷΑ͏ͳٕज़Ͱɺೖྗͷը૾͔Β৽͍͠ը૾ Λੜ੒͢Δٕज़ • ଞ • ʮࣗવݴޠ → ը૾ʯ΍ʮࣗવݴޠ → ࣗવݴޠͱը૾ʯ͕Ͱ͖ΔϞσϧ͕ଘࡏ͢Δɻ
  3. ChatGPTͷিܸ • 2022೥11݄ • OpenAI͕ࣾChatGPTΛϦϦʔε • ର࿩ͷମݧ͕ඇৗʹྑ͍ͱ࿩ ୊ʹͳΔ • Google

    → ඇৗࣄଶ(Code Red)એݴ • Microsoft → ఏܞ & ࣗࣾαʔ ϏεऔΓࠐΈ (Bing / Azure) ग़యIUUQTQSFTJEFOUKQBSUJDMFT • 2023೥3݄ • ChatGPTͷAPIΛϦϦʔε • ར༻ྉ͕҆ՁͳGPT-3.5-Turbo • Bot΍ΞϓϦ͕ଓʑϦϦʔε • 2023೥3݄ • GPT-4ΛϦϦʔε • ໿100ஹݸͷύϥϝʔλ
  4. ଞͷੜ੒AIαʔϏε • Bard • Google͕ఏڙ͢Δର࿩ܕAIαʔϏε (ChatGPTͷର߅) • Claude • Anthropic͕ఏڙ͢Δର࿩ܕAIαʔϏε

    • Anthropic͸ݩOpenAIͷϝϯόʔ͕ىۀɻGoogleɺAmazon౳͕ग़ࢿɻ • Amazon BedrockͰClaude v2͕ར༻Մೳ • Claude v2ͷ೔ຊޠੑೳ͸ɺGPT-4ʹඖఢ͢Δͱ͍ΘΕ͍ͯΔ
  5. ϓϩϯϓτͷίπ • ໌֬Ͱ۩ମతͳࢦࣔΛॻ͘ • ໌֬ͳ໾ׂΛॻ͘ • ۠੾ΓจࣈΛ࢖͏ • ճ౴ྫΛग़͢ •

    ຐ๏ͷݴ༿ʮεςοϓόΠεςοϓͰʯ • ճ౴݁Ռͷ௕͞Λࢦఆ͢Δ • ୯७ͳ࣭໰ʹ෼͚Δ
  6. ϓϩϯϓτͷίπ: ຐ๏ͷݴ༿ʮεςοϓόΠε ςοϓͰʯ • ܭࢉΛ൐͏έʔεͳͲෳࡶͳϓϩϯϓτͷ৔߹ɺਖ਼͍͠౴͑ʹͳΒͳ͍͜ͱ͕ଟ͍ɻ • લड़ͷճ౴ྫΛग़ͯ͋͛͠Δͱਫ਼౓্͕͕Δ͕ɺʮεςοϓόΠεςοϓͰߟ͑ͯΈ ·͠ΐ͏ɻʯͱ౤͔͚͛Δ͜ͱͰݴޠϞσϧଆͰॱ൪ʹࢥߟͯ͠ਖ਼͍͠౴͑ʹͳΔ έʔε͕ଟ͍ɻ(͜ΕΛ Zero-shot

    Chain of Thought Prompting ͱݺͿ ) • ྫ: ࢲ͸ࢢ৔ʹߦͬͯ10ݸͷϦϯΰΛങ͍·ͨ͠ɻྡਓʹ2ͭɺमཧ޻ʹ2ͭ౉͠·ͨ͠ɻ ͦΕ͔Β5ͭͷϦϯΰΛങͬͯ1ͭ৯΂·ͨ͠ɻ࢒Γ͸ԿݸͰ͔͢ʁεςοϓόΠε ςοϓͰߟ͑ͯΈ·͠ΐ͏ɻ
  7. ϓϩϯϓτͷίπ: ୯७ͳ࣭໰ʹ෼͚Δ • ෳࡶͰᐆດͳ࣭໰Ͱ΋ճ౴ͯ͘͠ΕΔ͕ɺ࣭໰಺༰Λ෼ׂ͢Δ͜ͱͰͦͷ಺༰ΛҰͭͣͭճ౴ͯ͠ ͘ΕΔɻ • ྫ: • ༑ਓͷ݁ࠗࣜͷ͝ॕّʹ͍ͭͯڭ͍͑ͯͩ͘͞ •

    ͝ॕّͷ૬৔͸͍͘ΒͰ͔͢ʁ • ࠓճͷέʔεͩͱ͍͘Β͕ଥ౰Ͱ͔͢ʁ • ͝ॕّା͸ͲΜͳσβΠϯΛબͿ΂͖Ͱ͔͢ʁ • ͝ॕّାʹॻ͘Ѽ໊͸ͲͷΑ͏ʹॻ͘΂͖Ͱ͔͢ʁ • ଞʹ஫ҙ఺͸͋Γ·͔͢ʁ
  8. Amazon Bedrock ͷಛ௃ • ओཁͳੜ੒AIͷجװϞσϧΛར༻Մೳ • Amazon: Titan • AI21

    Labs: Jurassic-2 • Anthropic: Claude • Meta: Llama 2 • Cohere: Command • Stability AI: Stable Diffusion (ը૾ੜ੒)
  9. Amazon Bedrock ͷಛ௃ • ηΩϡϦςΟͷ֬อ • https://aws.amazon.com/jp/bedrock/security-compliance/ • ίϯςϯπ͕جװϞσϧͷ޲্΍αʔυύʔςΟ΁ڞ༗͞ΕΔ͜ͱ͸ͳ ͍ͱ໌ݴ͞Ε͍ͯΔ

    • GDPR ΍ HIPAA ͳͲͷҰൠతͳίϯϓϥΠΞϯεඪ४ʹରԠ • σʔλ͸ৗʹ҉߸Խ • CloudWatch΍CloudTrailΛ࢖ͬͯΨόφϯε΍؂ࠪʹରԠՄೳ
  10. Word2Vec • ୯ޠΛϕΫτϧԽ • ୯ޠͷҙຯΛఆྔతʹ೺Ѳ͢Δ͜ͱ͕Մೳ • ʮԦ༷ʯ-ʮஉੑʯ+ʮঁੑʯ=ʮঁԦʯ • Word2VecͷϞσϧ͸ͨ͘͞Μެ։͞Ε͍ͯΔ •

    จষ͔Β୯ޠʹ෼͚Δॲཧ͸ɺผ్ܗଶૉղੳͰʮ෼͔ͪॻ͖ʯΛߦ͏͜ͱ͕ ଟ͍ • MeCab / Janome ౳Ͱ࣮ࢪ
  11. OpenAIͷEmbedding • จষΛʮτʔΫϯʯʹ෼͚Δ • ୯ޠ΍۟ಡ఺ͳͲ͕ɺͦΕͧΕҰҙͷ਺஋ID (=τʔΫϯ) ʹม׵ • ʮτʔΫϯʯ͕ར༻ྉʹؔΘΔ •

    ʮτʔΫϯʯຖʹEmbedding • Embeddingࣗମ΋ֶशʹΑͬͯ֫ಘ͍ͯ͘͠ • Embedding݁ՌͷϕΫτϧΛ࢖ֶͬͯश • GPT౳ͷݴޠϞσϧͷֶश