DSPy (2023)
FreePrompts as compilable programs — defines the engineering-first paradigm
About DSPy (2023)
DSPy is a programming model and compiler that abstracts language model (LM) pipelines as text transformation graphs. Instead of relying on hard-coded prompt templates discovered via trial and error, DSPy introduces declarative modules that are parameterized and can learn how to apply compositions of prompting, finetuning, augmentation, and reasoning techniques. Its compiler automatically optimizes any DSPy pipeline to maximize a given metric, enabling self-improving pipelines that outperform few-shot prompting and expert-created demonstrations. The framework supports a variety of tasks including math word problems, multi-hop retrieval, complex question answering, and agent loops, and works with both proprietary (GPT-3.5) and open (llama2-13b-chat, T5) language models.
Key Features
Pros & Cons
- Significantly outperforms standard few-shot prompting and expert-created demonstrations
- Self-improving pipelines without manual prompt engineering
- Works effectively with relatively small open models (e.g., 770M-parameter T5, llama2-13b-chat)
- Systematic, engineering-first approach to LM pipeline optimization