The DSPy paper described declarative signatures and reusable language-model modules. Its compiler used evaluation feedback to construct prompts and demonstrations for multi-step pipelines.
DSPy
Also known as: Declarative Self-improving Python · DSPy optimizers
Plain English
DSPy is a Python framework for building language-model workflows from reusable pieces. It can tune parts of the workflow by running examples and scoring the answers.
Technical Overview
Signatures declare inputs and outputs, while modules compose language-model calls into steps such as retrieval and generation. Optimizers search for instructions or demonstrations using a developer-supplied metric and examples. The resulting behavior depends on the chosen model and how well the optimization data represents production requests.
Timeline (4)
2023
Paper2024
PaperThe MIPRO paper proposed optimizing instructions and demonstrations together for multi-stage programs. The objective measured the final output even when the developer had no labels for each intermediate step.
2025
PaperGEPA introduced reflective prompt evolution. The optimizer inspects traces and feedback, proposes instruction changes, and preserves candidates that succeed on different subsets of examples.
2026
ReleaseDSPy 3.3 introduced experimental Flex, which can search over program structure as well as instructions. An optimization run can change how a task is split into model calls while scoring the result with the same metric.