---
title: 'DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines'
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
license_note: 'This note is CC BY 4.0. It links to the paper and does not reproduce it. Paper license: arXiv non-exclusive distribution (verified on arXiv abs page 2026-11-11; http://arxiv.org/licenses/nonexclusive-distrib/1.0/).'
source: https://iinventedlight.com/library/notes/2310-03714-dspy.md
source_license: 'arXiv default (non-exclusive distribution license)'
attribution: '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.'
author: 'iinventedlight (AI-assisted)'
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 20:58 PT, Grok Bot chat widget t1717s7407: \"Publish all 100 including the LLMs Encode Clinical Knowledge note\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: 'Pointer note only. Abs page read 2026-11-11. The paper is not reproduced here.'
category: arxiv
topic_area: 'ai-research: RAG'
tags: arxiv, pointer, RAG, tools
arxiv_id: 2310.03714
alias: 2310.03714-dspy
format: pointer
type: pointer
sources:
  - id: S1
    title: 'DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines'
    publisher: arXiv
    authors: 'Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, Zhiyuan Zhang, Keshav Santhanam, et al. (13 authors)'
    url: https://arxiv.org/abs/2310.03714
    version_read: 'v1 (5 Oct 2023)'
    accessed: 2026-11-11
    license: 'arXiv default (non-exclusive distribution license)'
---
# 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](https://iinventedlight.com/library/notes/2310-11511-self-rag/) and [The Prompt Report](https://iinventedlight.com/library/notes/2406-06608-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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
