DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines
Summary
DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines (2023), by Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, and coauthors, is at https://arxiv.org/abs/2310.03714. The authors describe DSPy as a programming model whose modules are parameterized and can learn how to combine prompting, finetuning, augmentation, and reasoning by creating and collecting demonstrations. A compiler then optimizes a pipeline for a given metric. In two case studies they report that short DSPy programs can express pipelines for math word problems, multi-hop retrieval, complex questions, and agent loops. Within minutes of compiling, they say a few lines of DSPy let GPT-3.5 and llama2 13b chat self-bootstrap pipelines that outperform standard few-shot prompting, generally by over 25% and 65% respectively, and that compiled programs on smaller open models can compete with expert prompt chains for proprietary GPT-3.5. The project is pointed to https://github.com/stanfordnlp/dspy. Title, authors, abstract, and comments were taken from the arXiv abs page. The version is v1 (5 Oct 2023), submitted 5 Oct 2023.
Claims
Pointer notes do not quote the paper. See Verification and Sources for the link and license.
Verification
- Format: pointer note only. The paper is not reproduced here.
- Why it matters: It matters because it treats prompting, retrieval, and tool pipelines as programs that can be compiled and optimized, rather than as frozen prompt strings found by hand.
- Reproduced: not reproduced (2026-11-11).
- Related work: Related notes already in the library include Self-RAG and The Prompt Report.
- Limits: This is a pointer note only. Percentage gains are the authors' reported case-study results from the 5 Oct 2023 version.
- License: arXiv default (non-exclusive distribution license) on the abs page (2026-11-11; http://arxiv.org/licenses/nonexclusive-distrib/1.0/). Submitted 5 Oct 2023 (v1). Sources: [S1] https://arxiv.org/abs/2310.03714, v1 (5 Oct 2023). checked_on: 2026-11-11. Paper license: arXiv non-exclusive distribution; this note links to it and does not reproduce it. The note itself is CC BY 4.0.
When to apply
Use when you need the original DSPy paper on treating prompting, retrieval, and tool pipelines as compiled programs.
Facts
- id: F1 claim: 'DSPy is a programming model that abstracts language-model pipelines as text transformation graphs, with parameterized declarative modules that can learn compositions of prompting, finetuning, augmentation, and reasoning techniques.' confidence: medium date: 2026-11-11 sources: [S1] license: CC-BY-4.0
- id: F2 claim: 'The authors design a compiler that optimizes a DSPy pipeline to maximize a given metric.' confidence: medium date: 2026-11-11 sources: [S1] license: CC-BY-4.0
- id: F3 claim: 'They report that succinct DSPy programs let GPT-3.5 and llama2-13b-chat self-bootstrap pipelines that outperform standard few-shot prompting, generally by over 25% and 65% respectively, and they point to https://github.com/stanfordnlp/dspy.' confidence: medium date: 2026-11-11 sources: [S1] license: CC-BY-4.0
Sources
- [S1] arXiv 2310.03714, https://arxiv.org/abs/2310.03714. Paper license: arXiv default (non-exclusive distribution license). v1 (5 Oct 2023). Accessed 2026-11-11. This note links to the paper and does not reproduce it.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Pointer by iinventedlight (AI-assisted). Paper license: arXiv non-exclusive distribution; this note links to it and does not reproduce it.
License: CC-BY-4.0 · Pointer note by iinventedlight (AI-assisted). Links to: Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, Zhiyuan Zhang, Keshav Santhanam, et al. (13 authors), DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines (arXiv). This note does not reproduce the paper.
Cite this
'iinventedlight (AI-assisted)'. 2026. "DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines." iinventedlight Library, iil:note:yczbpy6d, version of 2026-11-11. https://iinventedlight.com/library/notes/2310-03714-dspy/. License: CC-BY-4.0.
@misc{iil_note_yczbpy6d,
author = {{'iinventedlight (AI-assisted)'}},
title = {{DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-11},
url = {https://iinventedlight.com/library/notes/2310-03714-dspy/},
note = {Permanent ID iil:note:yczbpy6d. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/2310-03714-dspy.md.