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

LLM エージェントを使った実験

LLM エージェントを使った実験

Moto Ishizawa

July 21, 2023
Tweet

More Decks by Moto Ishizawa

Other Decks in Technology

Transcript

  1. LLM ΤʔδΣϯτΛ࢖࣮ͬͨݧ
    @summerwind
    AI Agent Meetup Tokyo #0

    View full-size slide

  2. @summerwind
    Software Engineer

    View full-size slide

  3. 🤔
    GPTʹ࢓ࣄΛ୅ΘΓʹ΍ͬͯ΋Β͏͜ͱ͕ՄೳͳͷͰ͸…?


    (ϦϞʔτͰ࢓ࣄΛ͍ͯ͠Δ;ΓΛ͠ͳ͕Βͬͦ͜ΓθϧμΛϓϨΠͰ͖Δͧ…ʁ)

    View full-size slide

  4. gptask
    • LLM ʹ೚ҙͷίϚϯυͱ Python ίʔυΛ࣮ߦͤ͞Δ CLI

    • LangChain ͷ ReAct Agent ͕Ͳ͏ಈ͍͍ͯΔͷ͔஌Γͨͯ͘։ൃ

    • ΤϥʔΛࣗΒमਖ਼ͯ͠λεΫΛ࠶࣮ߦ͢ΔͳͲͷϙςϯγϟϧͷߴ͞ʹڻ͘
    $ gptask "AWS Ͱϙʔτ͕શ։์͞Ε͍ͯΔ Security Group ΛϦετΞοϓͯ͠"

    View full-size slide

  5. code-search-agent
    • ίʔυΛॻ͍ͯ΋Β͏લఏͱͯ͠ɺ·ͣݕࡧΛͰ͖ΔΑ͏ʹͨ͠ LLM ΤʔδΣϯτ

    • GPT-4 ͱ Language Server Protocol (LSP) Λ૊Έ߹ΘͤͯɺEmbedding ͳͲ͸࢖༻ͤͣʹίʔ
    υ΍γϯϘϧΛݕࡧͯ͠ճ౴ͯ͠΋Β͏࢓૊Έ

    • Kubernetes ͷΑ͏ͳڊେͳίʔυϕʔεͰ΋ͦͦ͜͜ͷਫ਼౓Ͱճ౴Ͱ͖Δ͜ͱ͕෼͔ͬͨ
    $ code-search-agent \
    -r github.com/kubernetes/kubernetes \
    "Deployment ϦιʔεͷόϦσʔγϣϯΛ΍͍ͬͯΔίʔυΛ୳ͯ͠ɺͦͷ৔ॴͱఆٛ಺༰Λࣔͯ͠ॲཧͷઆ໌Λ͍ͯͩ͘͠͞"
    The `ValidateDeployment` function in the file `pkg/apis/apps/validation/validation.go` is responsible for validating Deployment
    resources in Kubernetes. It calls two other validation functions on the deployment object: `apivalidation.ValidateObjectMeta` which
    validates the metadata of the deployment object, including the deployment name; and `ValidateDeploymentSpec` which validates the spec of
    the deployment object. These checks ensure that the deployment object is correctly formed and holds valid data, thereby avoiding invalid
    configurations in the Kubernetes system.
    ```github.com/kubernetes/kubernetes/pkg/apis/apps/validation/validation.go
    func ValidateDeployment(obj *apps.Deployment, opts apivalidation.PodValidationOptions) field.ErrorList {
    allErrs := apivalidation.ValidateObjectMeta(&obj.ObjectMeta, true, ValidateDeploymentName, field.NewPath("metadata"))
    allErrs = append(allErrs, ValidateDeploymentSpec(&obj.Spec, field.NewPath("spec"), opts)...)
    return allErrs
    }
    ```

    View full-size slide

  6. CotEditor ͔Βͷ LLM ݺͼग़͠
    • CotEditor (macOS ༻ΤσΟλ) ʹೖྗͨ͠಺༰
    Λͦͷ··ϓϩϯϓτʹͯ͠ LLM Λݺͼग़͢

    • ΩʔϘʔυγϣʔτΧοτͰ຋༁΍ςΩετͷ
    ੔ܗͳͲ͕࣮ߦͰ͖Δͷ͸ศར

    • CotEditor ଆͷ੍໿ͰετϦʔϛϯάදࣔͰ͖
    ͣɺ·ͨಡΈࠐΈதͷ UI ͷදࣔ΋೉͍͠ͷͰ
    ଴͕ͪ࣌ؒ௕͘ײͯ͡͠·͏

    View full-size slide

  7. ϢʔβʔͷߦಈΛݩʹಈ࡞͢ΔΤʔδΣϯτ
    • ϒϥ΢βͷϖʔδભҠͳͲΛτϦΨʔʹ LLM Λಈ࡞ͤ͞Δ࣮ݧ

    • ྫ͑͹ arxiv.org Λ։͘ͱɺͦͷϖʔδͷ࿦จΛղઆͯ͘͠ΕͨΓ͢Δ

    • ҰఆศརͰ͸͋Δ͕ɺߦಈΑΓ΋ LLM ͷग़ྗͷํ͕஗͍ͷͰ͍ͭग़ྗΛ଴ͬͯ͠·͏

    • τϦΨʔͱͦͷΞΫγϣϯΛ૿΍͍ͯ͘͠ͱ໘നͦ͏ͳ༧ײ͸͍ͯ͠Δ

    View full-size slide

  8. • ͍͍ײ͡ͷΠϯλʔϑΣʔεʹ͏·͘ LLM (ΤʔδΣϯτ) Λ૊ΈࠐΉͷ͸೉͍͠

    • LLM ͷग़ྗΛ଴ͭඞཁ͕͋ΔΑ͏ͳ࢖͍ํ͸ɺݸਓతʹ͸ͪΐͬͱҧ͏ײ

    • ʮ͜Ε΍ͬͱ͖·͠ΐ͏͔ʁʯʮ΍ͬͱ͖·ͨ͠ʯ͙Β͍ͷඇಉظతʹ LLM (ΤʔδΣϯτ) ͕
    ಈ͍ͯ͘ΕΔͱخ͍͔͠΋͠Εͳ͍
    ࣮ݧʹΑΔֶͼ

    View full-size slide