MIPRO / Multi-Stage DSPy (2024)
FreeOptimizes instructions and demonstrations across multi-stage LM programs
About MIPRO / Multi-Stage DSPy (2024)
MIPRO (Multi-Stage Instruction and Demonstration Optimizer) is an algorithm for optimizing prompts in multi-stage Language Model (LM) programs. LM programs are pipelines of modular LM calls that increasingly tackle complex NLP tasks, but require carefully crafted prompts for all modules. MIPRO introduces strategies to jointly optimize free-form instructions and few-shot demonstrations across modules without module-level labels or gradients. Its techniques include program- and data-aware instruction proposal, a stochastic mini-batch evaluation function to learn a surrogate objective, and a meta-optimization procedure that refines how LMs construct proposals over time. In benchmarks, MIPRO outperformed baseline optimizers on five of seven diverse multi-stage LM programs using Llama-3-8B, achieving up to 13% accuracy improvement. The algorithm is released as part of the DSPy open-source framework.
Key Features
Pros & Cons
- Outperforms baseline optimizers on 5 out of 7 diverse multi-stage LM programs
- Up to 13% accuracy improvement using Llama-3-8B
- Does not require module-level labels or gradient access
- Published research with full paper and code available
- Open source and integrated into the popular DSPy framework
- Currently only implemented within the DSPy ecosystem, limiting standalone use
- Designed for multi-stage programs; single-step prompt optimization may not benefit
- Performance depends on the underlying language model (demonstrated with Llama-3-8B)