SBTB23: Omar Khattab, DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 มิ.ย. 2024
  • The ML community is rapidly exploring techniques for prompting language models (LMs) and for stacking them into pipelines that solve complex tasks. Unfortunately, existing LM pipelines are typically implemented using hard-coded "prompt templates", i.e. lengthy strings discovered via trial and error. Toward a more systematic approach for developing and optimizing LM pipelines, we introduce DSPy, a programming model that abstracts LM pipelines as text transformation graphs, i.e. imperative computational graphs where LMs are invoked through declarative modules. DSPy modules are parameterized, meaning they can learn (by creating and collecting demonstrations) how to apply compositions of prompting, finetuning, augmentation, and reasoning techniques. We design a compiler that will optimize any DSPy pipeline to maximize a given metric. We conduct two case studies, showing that succinct DSPy programs can express and optimize sophisticated LM pipelines that reason about math word problems, tackle multi-hop retrieval, answer complex questions, and control agent loops. Within minutes of compiling, a few lines of DSPy allow GPT-3.5 and llama2-13b-chat to self-bootstrap pipelines that outperform standard few-shot prompting and pipelines with expert-created demonstrations. On top of that, DSPy programs compiled to open and relatively small LMs like 770M-parameter T5 and llama2-13b-chat are competitive with approaches that rely on expert-written prompt chains for proprietary GPT-3.5. DSPy is available as open source at github.com/stanfordnlp/dspy.
    More details available here: www.scale.bythebay.io/post/om...
  • บันเทิง

ความคิดเห็น • 9

  • @beedr.metwallykhattab115
    @beedr.metwallykhattab115 27 วันที่ผ่านมา

    Very good Omar Khattab
    يحفظكم الله ويرعاكم ويبارك فيكم

  • @420_gunna
    @420_gunna 5 หลายเดือนก่อน +6

    dank

  • @vbywrde
    @vbywrde 4 หลายเดือนก่อน

    Great! Thank you!

  • @julianrosenberger1793
    @julianrosenberger1793 5 หลายเดือนก่อน +2

    🙏

  • @campbellhutcheson5162
    @campbellhutcheson5162 4 หลายเดือนก่อน +4

    I've met a lot of people skeptical of DSPy and these kinds of videos do nothing to dispel the skepticism. I'm 10 minutes in and we haven't seen any examples of how this is any different from ordinary prompting with an LLM. The "goal" that he describes is literally just the prompt without explicit CoT language and CoT language will probably be unnecessary with stronger models, which will better infer when they need to do CoT to reach a good result (excluding cases where output is coerced in JSON mode, etc...).

    • @campbellhutcheson5162
      @campbellhutcheson5162 4 หลายเดือนก่อน

      I literally paused at 16:44 to read the produced prompt. It's fine. But, you literally had to do all the work to get there. And, I'm not sure that's substantially less than writing the prompt yourself, especially when you are going to get GPT-4 to write the first version of the prompt for you (remember turbo-preview knows what LLM prompts are).

    • @GURUPRASADIYERV
      @GURUPRASADIYERV 4 หลายเดือนก่อน +2

      The magic is in the compiling engine underneath. The optimization will get better with open source contribution.

  • @pensiveintrovert4318
    @pensiveintrovert4318 หลายเดือนก่อน

    The whole point of LLMs is the ability to interact with them in natural language, directly. If that is gone, then FMs should be built around automation and NOT using English.

    • @sathishgangichetty685
      @sathishgangichetty685 16 วันที่ผ่านมา

      you are still interacting (as an end user) via natural language. This is showing how to best make sota prompting techniques available to masses without them having to learn them.