PDL: A Declarative Prompt Programming Language

Mandana Vaziri, Louis Mandel, Claudio Spiess, Martin Hirzel
10/24/2024
cs.AIcs.PL

No official code found. Best implementation: IBM/prompt-declaration-language (303 stars, Apache-2.0, last commit 2026-04-29).

Abstract

Large language models (LLMs) have taken the world by storm by making many previously difficult uses of AI feasible. LLMs are controlled via highly expressive textual prompts and return textual answers. Unfortunately, this unstructured text as input and output makes LLM-based applications brittle. This motivates the rise of prompting frameworks, which mediate between LLMs and the external world. However, existing prompting frameworks either have a high learning curve or take away control over the exact prompts from the developer. To overcome this dilemma, this paper introduces the Prompt Declaration Language (PDL). PDL is a simple declarative data-oriented language that puts prompts at the forefront, based on YAML. PDL works well with many LLM platforms and LLMs. It supports writing interactive applications that call LLMs and tools, and makes it easy to implement common use-cases such as chatbots, RAG, or agents. We hope PDL will make prompt programming simpler, less brittle, and more enjoyable.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Prompt Declaration Language (PDL) is a declarative prompt programming language.

30351CSS, HTMLJul 22, 20245 months agoApache-2.0

Similar Papers

Cite this paper

@article{vaziri2024pdl,
  title  = {PDL: A Declarative Prompt Programming Language},
  author = {Mandana Vaziri and Louis Mandel and Claudio Spiess and Martin Hirzel},
  year   = {2024},
  eprint = {2410.19135},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.19135v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.19135.svg)](https://codeofpaper.com/paper/2410.19135)

Discussion