Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Update README.md

Omar Khattabaee378301d9f
diff --git a/README.md b/README.md
index 0094f7016..941d6abf5 100644
--- a/README.md
+++ b/README.md
@@ -15,9 +15,9 @@
----
-**DSPy** is a framework for developing and optimizing LM pipelines for complex tasks. To use LMs to build a complex system without DSPy, you generally have to: (1) break the problem down into steps, (2) prompt your LM well for each step, (3) generate synthetic data to tune each step, and (4) use that data to finetune smaller LMs to cut costs.
+**DSPy** is a framework for developing **LM pipelines** and automatically optimizing their quality and cost. LMs are sensitive to prompts. This becomes a serious challenge in multi-stage pipelines, where different prompts (or finetunes) have to compose effectively. To use LMs to build a complex system without DSPy, you generally have to: (1) break the problem down into steps, (2) prompt your LM well for each step, (3) generate synthetic data to tune each step, and (4) use that data to finetune smaller LMs to cut costs.
-Composing these into the right multi-step pipelines is a hard, messy process. **DSPy** creates a systematic space of modular and trainable pieces, instead of hacky 'prompt engineering' or one-off pipeline tuning. To do that, **DSPy** separates the flow of your program (`modules`) from the parameters (LM prompts and weights) of each step. DSPy introduces new `optimizers`, which are algorithms that can craft and tune the parameters of your pipeline, given a `metric` you want to maximize.
+Composing these into the right multi-step pipelines is a hard, messy process. **DSPy** creates a systematic space of modular and trainable pieces, instead of hacky 'prompt engineering' or one-off pipeline tuning. To do that, **DSPy** separates the flow of your program (`modules`) from the parameters (LM prompts and weights) of each step. DSPy introduces new `optimizers`, which are algorithms that can craft and tune the parameters of your pipeline, given a `metric` you want to maximize. Among other things, these algorithms 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.
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.