Let the LLM Write the Prompts: An Intro to DSPy in Compound Al Pipelines

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Prompt optimisation like DSPy lets small local models replace much larger ones on narrow tasks, cutting inference cost while making prompt-switching between models a measurable evaluation instead of guesswork.

Read this as

Drew Breunig gave a talk at the Databricks Data + AI Summit explaining DSPy, a tool that lets AI write its own instructions instead of humans doing it. He matched 70 million addresses from different map providers by having a tiny free model compare them. Using a larger AI to improve the prompt raised its accuracy from 60.7% to 82%.

This talk shows a cost lever: a tiny open model (Qwen3-0.6B) running locally can match 70 million addresses for map data, once DSPy's MIPROv2 optimizer, driven by GPT-4.1, rewrites its prompt, lifting accuracy from 60.7% to 82%. The trade-off is one-off optimisation effort versus cheap recurring inference, and prompts become swap-ready when models change.

DSPy's MIPROv2 optimizer used GPT-4.1 to produce a 700-token prompt for Qwen3-0.6B, a 0.6B-parameter local model, for a binary conflation task matching places of interest across datasets. Accuracy rose from 60.7% to 82% on the address-matching job. The optimized prompt handles case, diacritics, transliteration and multilingual scripts, and the pipeline makes re-evaluating replacement models cheap.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

DSPy Qwen3-0.6B GPT-4.1 MIPROv2 Databricks Data + AI Summit Overture Maps

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading