Skip to content

Additional Resources

Tutorials

Level Tutorial Run in Colab Description
Beginner Getting Started Introduces the basic building blocks in DSPy. Tackles the task of complex question answering with HotPotQA.
Beginner Minimal Working Example N/A Builds and optimizes a very simple chain-of-thought program in DSPy for math question answering. Very short.
Beginner Compiling for Tricky Tasks N/A Teaches LMs to reason about logical statements and negation. Uses GPT-4 to bootstrap few-shot CoT demonstrations for GPT-3.5. Establishes a state-of-the-art result on ScoNe. Contributed by Chris Potts.
Beginner Local Models & Custom Datasets Illustrates two different things together: how to use local models (Llama-2-13B in particular) and how to use your own data examples for training and development.
Intermediate The DSPy Paper N/A Sections 3, 5, 6, and 7 of the DSPy paper can be consumed as a tutorial. They include explained code snippets, results, and discussions of the abstractions and API.
Intermediate DSPy Assertions Introduces example of applying DSPy Assertions while generating long-form responses to questions with citations. Presents comparative evaluation in both zero-shot and compiled settings.
Intermediate Finetuning for Complex Programs Teaches a local T5 model (770M) to do exceptionally well on HotPotQA. Uses only 200 labeled answers. Uses no hand-written prompts, no calls to OpenAI, and no labels for retrieval or reasoning.
Advanced Information Extraction Tackles extracting information from long articles (biomedical research papers). Combines in-context learning and retrieval to set SOTA on BioDEX. Contributed by Karel D’Oosterlinck.

Resources