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

LangChain Toolsの運用と改善

peisuke
April 25, 2023

LangChain Toolsの運用と改善

2023/4/25 LLM(GPT, PaLM等) with MLOps LT大会!!! 発表資料

peisuke

April 25, 2023
Tweet

More Decks by peisuke

Other Decks in Technology

Transcript

  1. LangChain Toolsͷӡ༻ͱվળ
    !QFJTVLF

    View full-size slide

  2. ࣗݾ঺հ
    ໊લɿ౻ຊ ܟհ
    ॴଐɿ"#&+"ʢ-BCTʣ
    ෭ۀɿ.-Λத৺ʹ૬ஊ͔Β։ൃ·Ͱ΍ͬͯ·͢
    ੋඇ͓੠͕͚Լ͍͞
    ׆ಈɿ5XJUUFS!QFJTVLF
    (JUIVC IUUQTHJUIVCDPNQFJTVLF
    2JJUB IUUQTRJJUBDPNQFJTVLF
    4MJEF4IBSF IUUQTXXXTMJEFTIBSFOFU'VKJNPUP,FJTVLF
    গ͚ͩ͠ॻ͍ͯ·͢

    View full-size slide

  3. ࠓճͷςʔϚʹ͍ͭͯ
    • --.͸୯ಠͩͱ༻్ʹݶք͕͋Γɺ֎෦πʔϧͱͷ࿈ܞ͕େࣄ
    • -BOH$IBJO5PPMTͷՄೳੑ͕ੌ͍
    • 5PPMΛݺͼग़ͨ͢Ίʹઃఆ͢Δ%FTDSJQUJPOΛɺ.-ͷϊϦͰ
    ςετɾमਖ਼Λ͢Δ࢓૊ΈͷఏҊͱ࣮ݧ

    View full-size slide

  4. --.ͷݶք
    • --.୯ಠͰ࢖༻ͨ͠৔߹ͷݶք
    • ֶश͍ͤͯ͞ͳ͍σʔλʹ͸ରԠͰ͖ͳ͍ͨΊɺϦΞϧλΠϜͳ࣭໰
    ΍ઐ໳తɾಠࣗͷ࣭໰ʹ͸౴͑ΒΕͳ͍
    • ౦ژ౎ͷਓޱͱ͍ͬͨಛఆͷ࣭໰ʹ͍ͭͯ͸ޡͬͨճ౴Λ͕ͪ͠
    • ͍͔ʹͯ͠ޡͬͨճ౴Λग़͞ͳ͍Α͏ʹͭͭ͠ɺ༗༻ͳ݁ՌΛ
    ಘΔ͔͕ࠓޙͷ׆༻ͷϙΠϯτʹͳͬͯ͘Δ

    View full-size slide

  5. ํ਑
    • ཁ݅తͳͱ͜Ζ
    • --.͕ճ౴ෆՄೳͳઐ໳తͳ஌ࣝ˞΁ͷΞΫηε
    ˞࠷৽ͷ৘ใɺ࢛ଇԋࢉɺࣾ಺ͷφϨοδɺͦͷଞ༷ʑͳ࢓૊Έ
    • ͳΔ΂͘ޡͬͨճ౴Λग़͞ͳ͍Α͏ʹ͢Δ
    • ղܾํ਑
    • --.୯ಠͰ࢖Θͣɺͦͷଞͷ࢓૊Έͱ࿈ܞ͢Δ
    • ݕࡧͷ࢓૊Έͱ૊Έ߹Θͤͨ-MBNB*OEFYͳͲ͕͋Δ

    View full-size slide

  6. --.ͷࠓޙͷ࢖ΘΕํͷ૝ఆ
    ཁ໿ɺ຋༁ φϨοδݕࡧ΍
    ϨίϝϯυͳͲ
    ϑΣʔζ̍ ϑΣʔζ̎ ϑΣʔζ̏
    --.୯ಠͰͷར༻
    खॱͷܾ·ͬͨλ
    εΫ
    ϧʔϧϕʔεͰ--.
    ͱผϩδοΫͷ૊Έ
    ߹Θͤ
    ॊೈʹෳ਺ϩδοΫ
    Λݺͼग़ͯ͠ར༻
    ֓ཁ
    ಛ௃
    ۩ମྫ
    ֎෦φϨοδΛ࢖
    Θͳ͍ɺର࿩ͷத
    Ͱ׬݁Ͱ͖Δ໰୊
    ࣗ༝ͳର࿩γες
    ϜɺෳࡶͳλεΫ
    ෳ਺ͷ࢓૊ΈΛ૊Έ߹Θͤ
    ʢ-MBNB*OEFYʣ
    ʢ(151MVHJOTɺ+"37*4ɺ
    -BOH$IBJO5PPMʣ

    View full-size slide

  7. --.ͷࠓޙͷ࢖ΘΕํͷ૝ఆ
    ཁ໿ɺ຋༁ φϨοδݕࡧ΍
    ϨίϝϯυͳͲ
    ϑΣʔζ̍ ϑΣʔζ̎ ϑΣʔζ̏
    --.୯ಠͰͷར༻
    खॱͷܾ·ͬͨλ
    εΫ
    ϧʔϧϕʔεͰ--.
    ͱผϩδοΫͷ૊Έ
    ߹Θͤ
    ॊೈʹෳ਺ϩδοΫ
    Λݺͼग़ͯ͠ར༻
    ֓ཁ
    ಛ௃
    ۩ମྫ
    ֎෦φϨοδΛ࢖
    Θͳ͍ɺର࿩ͷத
    Ͱ׬݁Ͱ͖Δ໰୊
    ࣗ༝ͳର࿩γες
    ϜɺෳࡶͳλεΫ
    ෳ਺ͷ࢓૊ΈΛ૊Έ߹Θͤ
    ʢ-MBNB*OEFYʣ
    ʢ(151MVHJOTɺ+"37*4ɺ
    -BOH$IBJO5PPMTʣ
    ຊ೔ͷλʔήοτ

    View full-size slide

  8. -BOH$IBJO5PPMTͷ؆୯ͳઆ໌ʢʣ
    • ֎෦ͷπʔϧΛॊೈʹར༻Ͱ͖Δ࢓૊Έ
    • ಠࣗͷπʔϧΛ༻ҙ͓͖ͯ͠ʢԼਤ̍ࢀরʣɺBHFOUʹରͯ͠
    ΫΤϦΛ౤͛ΔʢԼਤ̎ࢀরʣ
    • ྫɿϗςϧϨίϝϯυπʔϧ
    SVOϝιουͰ݁ՌΛฦ౴

    View full-size slide

  9. -BOH$IBJO5PPMTͷ؆୯ͳઆ໌ʢʣ
    • -BOH$IBJOଆͰπʔϧΛ࢖͏΂͖͔Ͳ͏͔ɺͲͷπʔϧΛ࢖
    ͏΂͖͔Λ൑அͯ͠ɺπʔϧΛۦ࢖ͭͭ݁͠ՌΛฦ͢
    πʔϧΛ࢖͏͔Λ൑ఆ
    ࢖͏πʔϧΛܾఆ

    View full-size slide

  10. -BOH$IBJO5PPMTͷ؆୯ͳઆ໌ʢʣ
    • ෳ਺ͷπʔϧΛ࿈ܞͤͨ͞ߴ౓ͳ݁ՌΛฦ͢͜ͱ΋Մೳ
    ݕࡧπʔϧ
    ܭࢉπʔϧ

    View full-size slide

  11. -BOH$IBJO5PPMTΛ࣮ࡍʹ࢖͏্Ͱͷ՝୊
    • %FTDSJQUJPOͷఆ͕ٛʮ͔ͳΓʯ೉͍͠
    • 5PPM͕૿͑ͯ͘Δͱɺ૝ఆ௨Γʹ5PPMΛ࢖ͬͯ͘Εͳ͍
    • ӡ༻ͷதͰద੾ʹ5PPMΛબ୒ͯ͘͠ΕΔΑ͏मਖ਼͍ͯ͘͠ඞཁ͕͋Δ
    %FTDSJQUJPO

    View full-size slide

  12. ʮ%FTDSJQUJPO0QTʯ
    Λߟ͑ͯΈͨ

    View full-size slide

  13. %FTDSJQUJPO0QTͱ͸
    • ʮ͜ͷΫΤϦʹରͯ͠ɺ͜ͷπʔϧͱ͜ͷπʔϧ͕ݺ͹ΕΔ΂͖ʯͱ͍͏ɺ
    ೖྗͱਖ਼ղͷϖΞΛ༧Ί୔ࢁ༻ҙ͓ͯ͘͠ʢ.-ʹ͓͚Δڭࢣσʔλʣ
    • ࣮ࡍʹΫΤϦΛୟ͍ͯΈͯɺ૝ఆ௨Γͷπʔϧ͕ݺ͹Ε͍ͯΔ͔Λςετ
    ʢ.-ʹ͓͚Δਪ࿦ʣ
    • ݺ͹Ε͍ͯͳ͔ͬͨΒɺ݁ՌΛ--.ʹ౉ͯ͠मਖ਼͠ɺ͜ΕΛ܁Γฦ͢
    ʢ.-ʹ͓͚Δֶशʣ
    ͜ͷ࢓૊Λ࢖͍ɺӡ༻தʹվળͷϓϩηεΛճ͢ʂ
    ʢͱ͍͏ϑϨʔϜϫʔΫͷఏҊʣ

    View full-size slide

  14. %FTDSJQUJPO0QTͷ࣮ݧ
    • Φεεϝͷגͷ໏ฑΛग़ྗͦ͠ͷࣄۀ಺༰Λग़ྗ͢Δ࢓૊ΈΛ
    ର৅ʹ͢Δ
    • גͷ໏ฑ͚ͩϨίϝϯυ͞Εͯ΋ɺͦͷϏδωεϞσϧ΍ച্ΛҰॹ
    ʹ஌Γͨ͘ͳΔ
    • ࣗ෼Ͱ৭Μͳ৘ใΛௐ΂ͯௐࠪΛͤͣͱ΋ɺ5PPMTͷ࢓૊ΈΛ࢖͍ඞ
    ཁͳ৘ใΛҰׅͰूΊ͍ͨ
    • ҎԼͷطଘπʔϧ܈Λ͍࣋ͬͯΔ͜ͱΛ૝ఆ
    • πʔϧ̍ɿΦεεϝͷגͷձ໊ࣾΛग़ྗ͢Δ"1*
    • πʔϧ̎ɿձ໊͔ࣾΒ໏ฑίʔυʹม׵͢Δ"1*
    • πʔϧ̏ɿ໏ฑίʔυʹରԠ͢Δࣄۀ಺༰Λग़ྗ͢Δ"1*

    View full-size slide

  15. ςετ༻ͷ5PPMΛ࡞੒͓ͯ͘͠
    • 5PPM͕ݺ͹ΕΔ͔͚ͩݟΕ͹ྑ͍ͷͰɺ"1*ࣗମ͸ϞοΫΞο
    ϓͰ0,
    • Սۭͷձ໊ࣾΛೖΕ͓ͯ͘͜ͱͰɺ(15ࣗମ͕௚઀౴͑ͳ͍Α
    ͏ʹ͓ͯ͘͠

    View full-size slide

  16. %FTDSJQUJPO0QTͷϑϩʔ
    ਖ਼ղσʔλͷೖྗ
    ॳظͷ%FTDSJQUJPOઃఆ
    ༩͑ͨ%FTDSJQUJPOΛݩʹπʔϧΛݺͼग़͠
    ਖ਼ղσʔλͱൺֱͯ͠ɺͲͷҐͷਫ਼౓Ͱπʔϧ͕ݺͼग़͞Ε
    ͔ͨΛςετ
    ਫ਼౓্͕͕ΔΑ͏ʹ%FTDSJQUJPOΛमਖ਼
    ʹ໭Δ

    View full-size slide

  17. %FTDSJQUJPO0QTͷϑϩʔ
    ਖ਼ղσʔλͷೖྗ
    ॳظͷ%FTDSJQUJPOઃఆ
    ༩͑ͨ%FTDSJQUJPOΛݩʹπʔϧΛݺͼग़͠
    ਖ਼ղσʔλͱൺֱͯ͠ɺͲͷҐͷਫ਼౓Ͱπʔϧ͕ݺͼग़͞Ε
    ͔ͨΛςετ
    ਫ਼౓্͕͕ΔΑ͏ʹ%FTDSJQUJPOΛमਖ਼
    ʹ໭Δ

    View full-size slide

  18. ਖ਼ղσʔλͷ࡞੒
    ΫΤϦαϯϓϧ
    ݺͼग़͞ΕΔ΂͖
    5PPM܈ͱ૝ఆग़ྗ

    View full-size slide

  19. %FTDSJQUJPO0QTͷϑϩʔ
    ਖ਼ղσʔλͷೖྗ
    ॳظͷ%FTDSJQUJPOઃఆ
    ༩͑ͨ%FTDSJQUJPOΛݩʹπʔϧΛݺͼग़͠
    ਖ਼ղσʔλͱൺֱͯ͠ɺͲͷҐͷਫ਼౓Ͱπʔϧ͕ݺͼग़͞Ε
    ͔ͨΛςετ
    ਫ਼౓্͕͕ΔΑ͏ʹ%FTDSJQUJPOΛमਖ਼
    ʹ໭Δ

    View full-size slide

  20. ॳظͷ%FTDSJQUJPOઃఆ
    • ͪΌΜͱֶश͞ΕΔࣄΛ֬ೝ͍ͨ͠ͷͰɺ࠷ॳ͸ద౰ͳ಺༰Λ
    ೖΕ͓ͯ͘

    View full-size slide

  21. %FTDSJQUJPO0QTͷϑϩʔ
    ਖ਼ղσʔλͷೖྗ
    ॳظͷ%FTDSJQUJPOઃఆ
    ༩͑ͨ%FTDSJQUJPOΛݩʹπʔϧΛݺͼग़͠
    ਖ਼ղσʔλͱൺֱͯ͠ɺͲͷҐͷਫ਼౓Ͱπʔϧ͕ݺͼग़͞Ε
    ͔ͨΛςετ
    ਫ਼౓্͕͕ΔΑ͏ʹ%FTDSJQUJPOΛमਖ਼
    ʹ໭Δ

    View full-size slide

  22. मਖ਼ϓϩϯϓτͷ࡞੒
    ݱࡏͷEFTDSJQUJPO
    ݺ͹Εͨ5PPMͱݺ͹Εͳ
    ͔ͬͨ5PPMΛ༩͑Δ
    ग़ྗϑΥʔϚοτΛࢦఆ
    ϢʔβͷΫΤϦࣗମʹ
    ෇༩͢΂͖৘ใ

    View full-size slide

  23. ఆྔධՁ



    मਖ਼ճ਺ FQPDI

    • मਖ਼ʹΑͬͯਫ਼౓͕޲্͢Δ͜ͱ͸֬ೝ
    • ద੾ͳमਖ਼͕ͳ͞Εͣɺ࠷ޙʹਫ਼౓͕Լ͕ͬͯ͠·͏ࣄ͕͋Δ

    View full-size slide

  24. ఆੑධՁ

    • ੜ੒͞Εͨ%FTDSJQUJPOͱΫΤϦ΁ͷ௥Ճ৘ใ
    %FTDSJQUJPO
    ௥Ճ৘ใ

    View full-size slide

  25. ఆੑධՁ

    • աֶशͯ͠͠·͏ྫʢ͜ͷล΋.-ͬΆ͍ʣ
    ˞मਖ਼༻ͷϓϩϯϓτΛ࿔͍ͬͯͨΒ࿉੒͞Εͨ݁Ռ
    ֶशσʔλʹؚ·ΕΔΫΤϦ
    ͱ౴͑Λ֮͑ͯ͠·ͬͨ

    View full-size slide

  26. ·ͱΊ
    • --.ͱɺͦΕҎ֎Λͭͳ͛ΔՄೳੑ͕ੌ͍ʂ
    • ؆୯ʹ͸ܨ͕Βͳ͍ɺ൚༻Λ໨ࢦ͢΄Ͳੑೳ্͕͕Βͳ͍
    • .-ͷཁྖͰɺ%FTDSJQUJPOΛςετɾվળ͢Δ࢓૊ΈΛߟҊ
    • %FTDSJQUJPO0QTͱݴ͍ͭͭɺ·ͩ0QTͷ࢓૊Έ·Ͱ͸࡞ͬ
    ͍ͯͳ͍ͷͰɺࠓޙؤுΓ·͢

    View full-size slide