DSPy: The framework for programming—not prompting—language models
Python
Update README.md
Omar Khattabd2c63650b4e2
diff --git a/README.md b/README.mdindex 9cfa7e579..9dca5cc53 100644--- a/README.md+++ b/README.md@@ -41,7 +41,7 @@ Ditto! **DSPy** gives you the right general-purpose modules (e.g., `ChainOfThoug### Mini-FAQs-**What do DSPy optimizers tune?** Each optimizer is different, but they all maximize a metric on your program by updating prompts or LM weights. Among other things, so far we've built DSPy `optimizers` that inspect your data, simulate traces through your program to collect good (or, soon, bad) examples of each step, propose new instructions for each step based on past results, finetune the weights of your LM on self-generated examples, or combine several of these to improve quality or cut cost. We'd love to merge new optimizers that explore a richer space. Any technique you currently manually apply for prompt engineering, "synthetic data" generation, or self-improvement can probably generalized into a DSPy optimizer.+**What do DSPy optimizers tune?** Each optimizer is different, but they all seek to maximize a metric on your program by updating prompts or LM weights. So far we've built DSPy `optimizers` that inspect your data, simulate traces through your program to generate good (or, soon, bad) examples of each step, propose or refine instructions for each step based on past results, finetune the weights of your LM on self-generated examples, or combine several of these to improve quality or cut cost. We'd love to merge new optimizers that explore a richer space: most manual steps you currently go through for prompt engineering, "synthetic data" generation, or self-improvement can probably generalized into a DSPy optimizer that acts on arbitrary LM programs.**How should I use DSPy for my task?** Using DSPy is an iterative process. You first define your task and the metrics you want to maximize, and prepare a few example inputs — typically without labels (or only with labels for the final outputs, if your metric requires them). Then, you build your pipeline by selecting built-in layers (`modules`) to use, giving each layer a `signature` (input/output spec), and then calling your modules freely in your Python code. Lastly, you use a DSPy `optimizer` to compile your code into high-quality instructions, automatic few-shot examples, or updated LM weights for your LM.