📄️ Using DSPy in 8 Steps
Using DSPy well for solving a new task is just doing good machine learning with LMs.
📄️ Language Models
The most powerful features in DSPy revolve around algorithmically optimizing the prompts (or weights) of LMs, especially when you're building programs that use the LMs within a pipeline.
📄️ Signatures
When we assign tasks to LMs in DSPy, we specify the behavior we need as a Signature.
📄️ Modules
A DSPy module is a building block for programs that use LMs.
📄️ Data
DSPy is a machine learning framework, so working in it involves training sets, development sets, and test sets.
📄️ Metrics
DSPy is a machine learning framework, so you must think about your automatic metrics for evaluation (to track your progress) and optimization (so DSPy can make your programs more effective).
📄️ Optimizers (formerly Teleprompters)
A DSPy optimizer is an algorithm that can tune the parameters of a DSPy program (i.e., the prompts and/or the LM weights) to maximize the metrics you specify, like accuracy.
📄️ DSPy Assertions
Introduction
📄️ Typed Predictors
In DSPy Signatures, we have InputField and OutputField that define the nature of inputs and outputs of the field. However, the inputs and output to these fields are always str-typed, which requires input and output string processing.