Skip to main content

Additional Resources

Tutorials

LevelTutorialRun in ColabDescription
BeginnerGetting StartedIntroduces the basic building blocks in DSPy. Tackles the task of complex question answering with HotPotQA.
BeginnerMinimal Working ExampleN/ABuilds and optimizes a very simple chain-of-thought program in DSPy for math question answering. Very short.
BeginnerCompiling for Tricky TasksN/ATeaches 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.
BeginnerLocal Models & Custom DatasetsIllustrates 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.
IntermediateThe DSPy PaperN/ASections 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.
IntermediateDSPy AssertionsIntroduces example of applying DSPy Assertions while generating long-form responses to questions with citations. Presents comparative evaluation in both zero-shot and compiled settings.
IntermediateFinetuning for Complex ProgramsTeaches 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.
AdvancedInformation ExtractionTackles 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