Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update README.md

Omar Khattabe269f8b90efa
diff --git a/README.md b/README.md
index cfc344d2b..7642c1856 100644
--- a/README.md
+++ b/README.md
@@ -21,14 +21,6 @@ Composing these into the right pipelines is a hard and messy process: every time
**DSPy** can routinely teach powerful models like `GPT-3.5` or `GPT-4` and local models like `T5-base` or `Llama2-13b` to be much more reliable (higher quality and/or avoiding specific failure patterns) at tasks. **DSPy** will "compile" the _same program_ into different few-shot prompts and/or finetunes for each LM.
-### Mini-FAQs
-
-**What can DSPy optimizers do?** Different DSPy optimizers work differently, but they all maximize a metric on your program. Among other things, DSPy `optimizers` can inspect your data, simulate traces through your program to collect good (or 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.
-
-**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.
-
-**What if I have a better idea for prompting or synthetic data generation?** Perfect. We encourage you to think if it's best expressed as a module or an optimizer, and we'd love to merge it in DSPy so everyone can use it. DSPy is not a complete project; it's an ongoing effort to create structure (modules and optimizers) in place of hacky prompt and pipeline engineering tricks.
-
### Table of Contents
@@ -47,6 +39,14 @@ When we build neural networks, we don't write manual _for-loops_ over lists of _
Ditto! **DSPy** gives you the right general-purpose modules (e.g., `ChainOfThought`, `ReAct`, etc.), which replace string-based prompting tricks. To replace prompt hacking and one-off synthetic data generators, **DSPy** also gives you general optimizers (`BootstrapFewShotWithRandomSearch` or `BayesianSignatureOptimizer`), which are algorithms that update parameters in your program. Whenever you modify your code, your data, you assertions, or your metric, you can _compile_ your program again and **DSPy** will create new effective prompts that fit your changes.
+### Mini-FAQs
+
+**What can DSPy optimizers do?** Different DSPy optimizers work differently, but they all maximize a metric on your program. Among other things, DSPy `optimizers` can inspect your data, simulate traces through your program to collect good (or 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.
+
+**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.
+
+**What if I have a better idea for prompting or synthetic data generation?** Perfect. We encourage you to think if it's best expressed as a module or an optimizer, and we'd love to merge it in DSPy so everyone can use it. DSPy is not a complete project; it's an ongoing effort to create structure (modules and optimizers) in place of hacky prompt and pipeline engineering tricks.
+
## 1) Installation