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

Azure OpenAIをもちいたLLMアプリの企画から本番構築までの道のり/Microsof...

Azure OpenAIをもちいたLLMアプリの企画から本番構築までの道のり/Microsoft Build Japan

2023.6.27 Microsoft Build Japan で話した資料です。

吉田真吾

June 27, 2023
Tweet

More Decks by 吉田真吾

Other Decks in Technology

Transcript

  1. MS Azure OpenAI Cognitive Search ckpt BraV5 吉田真吾 n p

    Oracle SA p 113 / pAWS n ( ) CTO p SaaS ( ) pAWS DevOps n pAWS (2012 ) pAWS Samurai 2014 / 2016 pAWS Serverless Hero
  2. ຊ൪༻ͷ--.ΞϓϦέʔγϣϯΛͭ͘Δ --.ͰΫʔϧͳ΋ͷΛ࡞Δͷ͸؆୯͕ͩຊ൪Ϩϕϧͷ΋ͷΛ࡞Δͷ͸ඇৗʹ೉͍͠  ՝୊ͱղܾࡦ  ࣗવݴޠͷ͍͋·͍͞ ܾఆ࿦తͰͳ͍)ʹΑΔ69ෆ੔߹ ˠ UFNQFSBUVSFɺϓϩϯϓτ࠷ద Խɾόʔδϣχϯά؅ཧ

     ίετͱϨΠςϯγʔ ˠਪ࿦ʹ࢖͏ϞσϧબఆɺτʔΫϯ਺ͷௐ੔ɺ ݱঢ়͸ ϨΠςϯ γʔղੳ  ϓϩϯϓςΟϯά ϑΝΠϯνϡʔχϯά ͦΕҎ֎ • ϓϩϯϓτνϡʔχϯάɿ&NCFEEJOHTΛೖΕସ͑Δ 044ͰͷΈՄೳ • ϑΝΠϯνϡʔχϯάɿλεΫʹ࠷దԽͤ͞ΔͨΊͷαϯϓϧ͕ੑೳʹӨڹˠ͕ɺ͋·Γظ଴Ͱ͖ͳ͍ • ৠཹϑΝΠϯνϡʔχϯάɿ5FYUEBWJODJ େ Ͱ--B." খ ͷνϡʔχϯάʹ࢖͏ˠ"MQBDB খ • &NCFEEJOHT ϕΫλʔετΞɿ'FXTIPUT  ޙํޓ׵ੑͱલํޓ׵ੑ • ৽͍͠Ϟσϧ͸શମతʹ༏ΕͯΔ͔΋͠Εͳ͍͕ɺྼ͍ͬͯΔϢʔεέʔε΋͋Δ͸ͣ • લͷϞσϧʹରͯ͠͏·͘ಈ͍͍ͯͨϓϩϯϓτ͕͏·͘ಈ͔ͳ͍৔߹ɺͲΜͳҙਤͰϓϩϯϓτ͕νϡʔ χϯά͞Ε͍ͯΔ͔ ढจ όουϓϥΫςΟε Θ͔Βͳ͘ͳΔ IUUQTIVZFODIJQDPNMMNFOHJOFFSJOHIUNM
  3. ຊ൪༻ͷ--.ΞϓϦέʔγϣϯΛͭ͘Δ  ෳ਺ͷλεΫͰ੍ޚ͞ΕΔϑϩʔߏ੒ΛͲ͏͢Δ͔ɺπʔϧͷ૊ΈࠐΈ • ϓϩάϥϛϯάʹΑΔ੍ޚϑϩʔͷ࣮૷ • --.ΤʔδΣϯτʹΑΔஞ੍࣍ޚ  ༗๬ͳϢʔεέʔε •

    "*Ξγελϯτɿεέδϡʔϧ؅ཧɺϝϞ࡞੒ɺϖΞϓϩɺϝʔϧରԠɺ༧໿ɺങ͍෺ λεΫΛ͜ͳ͢ • νϟοτCPUɿίϯύχΦϯ จࣈ΍Ի੠Ͱ૬ஊ΍ΞΠσΞͳͲͷձ࿩ • ϓϩάϥϛϯά΍ήʔϜɿ8FCΞϓϦΛͭ͘ΔɺηΩϡϦςΟͷڴҖΛൃݟ͢ΔɺήʔϜΛ࡞੒͢Δ • ϥʔχϯάɿຊͷཁ໿ɺߨٛɺཧղ౓ςετɺ࠾఺΍ϑΟʔυόοΫɺσΟϕʔτ૬ख • ࣾ಺σʔλநग़ɿࣗવݴޠ΍2"ܗࣜͰࣾ಺ͷσʔλΛরձ͢Δ • ݕࡧɾਪનɿΩʔϫʔυͰ͸ͳࣗ͘વݴޠ͔Βਪఆ͢Δݕࡧ • Ӧۀޮ཰Ξοϓ • 4&0ରࡦ • ݁࿦  એ఻จ۟Λແࢹͯ͠ϲ݄ޙʹఆணͯ͠Δ͔֬ೝ͢Δ  αϚϦʔΛಡΉ  ࠷৽ͷπʔϧʹ৮ΕΔΑ͏ʹ৺͕͚Δ IUUQTIVZFODIJQDPNMMNFOHJOFFSJOHIUNM
  4. ίϯϓϥΠΞϯεʴ"0"*ˠ "[VSF • ίϯϓϥΠΞϯε • *40 #$1 • *40 *4.4

     • *40 ඼࣭ • 40$  5ZQF • ͦͷଞͷୈࡾऀೝূ • ίϯϙʔωϯτ • "[VSF0QFO"* • $PHOJUJWF4FBSDI
  5. 8FCϑϩϯτ 8FC"QQ "QQ4FSWJDF • $JSDMF$*ͱͷ*".ೝূ࿈ܞ • ࣮ߦ؀ڥͷอक؅ཧͷ༰қ͞ • 3FRVJSFNFOUUYU ʹ؀ڥࢦఆ

    ͢Δ͚ͩ ศར • ϩόετੑ • 7/FUܦ༝Ͱ"0"*ͱ઀ଓՄೳ .PNFOUP ΞϓϦΩϟογϡ • ׬શͳαʔόʔϨε • 55-Ͱشൃ͢ΔΩϟογϡ • ߴ଎͔ͭ҆ఆ
  6. $PTNPT%#WT$PHOJUJWF4FBSDI "[VSF$PTNPT%#GPS .POHP%#W$PSF $PHOJUJWF4FBSDIXJUI $PTNPT%##MPC4UPSBHF \ TDPSF IJHIMJHIUTVOEFGJOFE EPDVNFOU\ DPOUFOUYYYYYYYYYYYYYYYYYYYYYYYYY

    NFUBEBUB@TUPSBHF@QBUIYYYYYYYYYY ^ ^ \ TDPSF IJHIMJHIUTVOEFGJOFE EPDVNFOU\ DPOUFOUbYYYYYYYYYYYYYYYYYYYYYYYYYY NFUBEBUB@TUPSBHF@QBUIYYYYYYYYYYYY ^ ^  \ @JEOFX0CKFDU*E FGCCBCGCF DPOUFOUbYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY WFDUPS$POUFOU<     தུʜ࣍ݩશ෦ NPSFJUFNT > ^
  7. ݕࡧ $PHOJUJWF4FBSDI • ϚωʔδυͳݕࡧαʔϏε • ΠϯσοΫε࡞੒΍ݕࡧΛ·͔ ͤΒΕΔ &NCFEEJOHෆཁ • ߴ଎ɾߴػೳ

    • ݕࡧείΞ • จॻΠϯσοΫε࣌ͷλΠτϧ ύεϑΝΠϧ໊ $PTNPT%# /P42- • ׬શͳαʔόʔϨε • ߴ଎͔ͭ҆ఆ
  8. ΞϓϦέʔγϣϯͷ޻෉ • ͭͷؔ࿈࣭໰ɿจࣈೖྗΛ࠷খݶʹ • ྨࣅݕࡧ݁ՌͷʙҐΛ࠶ར༻͢Δ͜ͱͰݕࡧ࠷খԽ • ͭͳ͍෼͸൚༻తͳ࣭໰Λੜ੒ • ճ౴Λʮ(15ʯͰɺؔ࿈࣭໰ͳͲͦͷଞΛHUQUVSCPͰ •

    νϟϯΫαΠζΛἧ͑Δɿ'"2σʔλͷࣄલ੔උɺཁ໿ • ࠓޙ $PHOJUJWF4FBSDIର৅Λ '"2 खಈυΩϡϝϯτʹ • 1%'ͷνϟϯΫ͸੍ޚ͕೉͍͠ จࣈ ϖʔδ ͔ηϯςϯε˞ ϖʔδͱ΄΅ಉ͡ • ࠓޙ ηϨΫλͷ࣮૷ είΞʹ߹ΘͤͯσϞϯετϨʔγϣ ϯσʔλͷݸ਺Λௐ੔͢Δ
  9. ίϯςϯπɿ҆શੑɾಁ໌ੑɾਖ਼֬ੑ • .PEFSBUJPOίϯςϯπϑΟϧλʔ • ຊՈ0QFO"*΋-BOH$IBJOͰνΣʔϯͰ͖Δ͕৑௕ • ߴ౓ͳϑΟϧλϦϯά͕Մೳ ཁਃ੥ • ఢରతϓϩϯϓτ཈ࢭ

    • ϓϩϯϓτΠϯδΣΫγϣϯΛݕ஌ɾແࢹ͢Δϓϩϯϓτ • όΠΞεͷ཈ࢭ • ;Δ·͍ͷࢦఆ • ϋϧγωʔγϣϯճආɿΘ͔Βͳ͍ͱ͖͸Θ͔Βͳ͍ͱ౴͑ͤ͞Δ • ࢀরݩ৘ใͷදࣔ • '"2ͷϦϯΫ • 1%'ͷϑΝΠϧ໊ϦϯΫͷ௥Ճ • 0VUQVU1BSTFSͰԠ౴Λ+40/Ͱߏ଄Խ͞ΕͨσʔλܗࣜͰडྖ • "*ʹΑͬͯճ౴Λੜ੒͍ͯ͠Δ஫ҙදࣔ • ੜ੒"*ར༻ʹ͓͚ΔΨΠυϥΠϯ αΠμεࣾ Ͱඞਢ
  10. UFNQFSBUVSF͸3"(ͷԠ౴඼࣭ʹͲͷ͘Β͍Өڹ͢Δͷ͔ʁ • Թ౓ɿੜ੒͞ΕΔςΩετͷʮ૑଄ੑʯ·ͨ͸ϥϯμϜੑΛ੍ ޚ͢ΔύϥϝʔλʔͰ͋Δ GPT-3Ҏ߱ • Թ౓͕ߴ͍ FY0.7 ˠΑΓଟ༷Ͱ૑଄తͳग़ྗ •

    Թ౓͕௿͍ FY0.2 ˠΑΓܾఆ࿦తͰूதతͳग़ྗ • top_pαϯϓϦϯά ίΞαϯϓϦϯά ͱͷซ༻͸ඇਪ঑ https://platform.openai.com/docs/api-reference/chat Ϣʔεέʔε Թ౓ આ໌ ίʔυੜ੒  ཱ֬͞Εͨύλʔϯͱ׳शʹैͬͨίʔυΛੜ੒͢Δɻग़ྗ͸ΑΓܾఆ࿦తͰয఺Խ͞ΕΔɻߏจతʹਖ਼͍͠ίʔυ Λੜ੒͢Δͷʹ໾ཱͭɻ ΫϦΤΠςΟϒɾϥΠ ςΟϯά  ετʔϦʔςϦϯάͷͨΊͷ૑଄తͰଟ༷ͳςΩετΛੜ੒͢ΔɻΞ΢τϓοτ͸ΑΓ୳ࡧతͰɺύλʔϯʹΑΔ੍ ໿͕গͳ͍ɻ νϟοτϘοτԠ౴  Ұ؏ੑͱଟ༷ੑͷόϥϯεͷͱΕͨձ࿩Ԡ౴Λੜ੒͠·͢ɻΞ΢τϓοτ͸ΑΓࣗવͰັྗతɻ ίʔυɾίϝϯτੜ੒  ΑΓ؆ܿͰద੾ͳίʔυίϝϯτΛੜ੒͠·͢ɻग़ྗ͸ΑΓܾఆ࿦తͰɺن໿ΛकΔɻ σʔλ෼ੳεΫϦϓτ  ΑΓਖ਼֬Ͱޮ཰తͳσʔλ෼ੳεΫϦϓτΛੜ੒͠·͢ɻग़ྗ͸ΑΓܾఆ࿦తͰूதతͰ͢ɻ ୳ࡧతͳίʔσΟϯά  ୅ସҊ΍૑଄తͳΞϓϩʔνΛ໛ࡧ͢ΔίʔυΛੜ੒͢Δɻط੒ͷύλʔϯʹͱΒΘΕͳ͍Ξ΢τϓοτ https://community.openai.com/t/cheat-sheet-mastering-temperature-and-top-p-in-chatgpt-api-a- few-tips-and-tricks-on-controlling-the-creativity-deterministic-output-of-prompt-responses/172683
  11. ϓϩϯϓτΛӳޠʹ͢Δ Your name is PEOPLE Copilot Chat, you are an

    HR agent that answer via employees's questions with chat history like below. ---- {retrieval} ---- Please answer the question below with thinking about the knowledge above in Japanese. But if you have no knowledge to refer to, you can answer with "その件については存じ上げませんので⼈事に直接お問い合わせください。". {question} UFNQFSBUVSFʹؔΘΒͣɺΉ͠Ζճ౴ͷ࣭͕Լ͕ͬͨ खଓ͖ํ๏͕Ҋ಺͞Εͳ͘ͳͬͨ
  12. ·ͱΊ 0QFO"*Ͱຊ൪--.ΞϓϦΛͭ͘Δ • 0QFO"*Λ࢖͏ͳΒ"[VSFҰ୒ • $PHOJUJWF4FBSDIͷػೳੑɾඇػೳੑͷߴ͞ʹ஫໨ • ΞϓϦͷಛੑʹ߹Θͤͨίϯςϯπ ೖྗग़ྗ ͷ҆શੑͷ޻෉

    • ଞͷ--.ΞϓϦͷ࠷దԽख๏͕ࣗ෼ʹ΋ສೳͱ͸͔͗Βͳ͍ • UFNQFSBUVSFͰճ౴Λܾఆతʹ͢ΔˠӨڹܰඍʗόϥϯε • ϓϩϯϓτ͸ӳޠͷ΄͏͕಄͕ྑ͍ˠ೔ຊޠͷ΄͏͕࣭໰ͷҙਤɾճ ౴ͷஸೡ͞Λ࠶ݱͰ͖Δ৔߹͋Γ • ຐ๏ΛՊֶʹண஍ͤ͞Δʹ͸؍ଌͱΤϏσϯε • 8FCΞϓϦͱಉ౳ͷे෼ͳςετ࣮ࢪ • ύϥϝʔλ΍ϓϩϯϓτςϯϓϨʔτͷόʔδϣϯ؅ཧ • վળཁ๬ • "[VSF0QFO"* ͷετϦʔϜͷνϟϯΫΛ΋ͬͱখ͘͞ • $PTNPT%#GPS.POHP%#W$PSF ͷݕࡧείΞύϥϝʔλ
  13. %":4্࢙࠷ߴͷϥΠϯφοϓ • ߽՚ηογϣϯ • Ωʔϊʔτɿ"84 .PNFOUP 5J%# •  αʔόʔϨε೥ͷ੒ख़

    •  αʔόʔαΠυओମ͔ΒΤοδϑϩϯτ΁ͷ։ൃϥΠϑαΠΫϧͷมԽ •  ੜ੒"*ͱαʔόʔϨε • ߽՚εϙϯαʔ • "84 • .PNFOUP • 1JOH$"1 5J%# • .JDSPTPGU • $MPVEGMBSF • ʲ݄͔Βएׯืू։࢝͠·͢ʳ