PDL: A Declarative Prompt Programming Language (2410.19135v1)
Abstract: 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.
- Granite-Function Calling Model: Introducing Function Calling Abilities via Multi-task Learning of Granular Tasks. https://arxiv.org/abs/2407.00121
- Program Synthesis with Large Language Models. https://arxiv.org/abs/2108.07732
- Pipeline Combinators for Gradual AutoML. In Advances in Neural Information Processing Systems (NeurIPS). 19705–19718. https://proceedings.neurips.cc/paper/2021/file/a3b36cb25e2e0b93b5f334ffb4e4064e-Paper.pdf
- YAML Ain’t Markup Language. http://yaml.org/spec/history/2004-12-28/2004-12-28.pdf
- Prompting Is Programming: A Query Language for Large Language Models. In Conference on Programming Language Design and Implementation (PLDI). 1946–1969. https://doi.org/10.1145/3591300
- Language Models are Few-Shot Learners. https://arxiv.org/abs/2005.14165
- LangChain. https://github.com/langchain-ai/langchain
- Links: Web Programming Without Tiers. In Symposium on Formal Methods for Components and Objects (FMCO). 266–296. https://doi.org/10.1007/978-3-540-74792-5_12
- Formally Specifying the High-Level Behavior of LLM-Based Agents. https://arxiv.org/abs/2310.08535
- PAL: Program-aided Language Models. In International Conference on Machine Learning (ICML). 10764–10799. https://proceedings.mlr.press/v202/gao23f.html
- Granite Team, IBM. 2024. Granite 3.0 Language Models. https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf
- Hugging Face. 2023. Chat Templates. https://huggingface.co/docs/transformers/en/chat_templating
- IBM. 2023. watsonx. https://www.ibm.com/watsonx
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?. In International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=VTF8yNQM66
- DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines. https://arxiv.org/abs/2310.03714
- Codellm-Devkit: A Framework for Contextualizing Code LLMs with Program Analysis Insights. https://arxiv.org/abs/2410.13007
- Efficient Memory Management for Large Language Model Serving with PagedAttention. In Symposium on Operating Systems Principles (SOSP). 611–626. https://doi.org/10.1145/3600006.3613165
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. In Conference on Neural Information Processing Systems (NeurIPS). 9459–9474. https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html
- Relational Programming with Foundation Models. In Conference on Artificial Intelligence (AAAI). 10635–10644. https://doi.org/10.1609/aaai.v38i9.28934
- Prompting Frameworks for Large Language Models: A Survey. https://arxiv.org/abs/2311.12785
- John McCarthy. 1960. Recursive functions of symbolic expressions and their computation by machine, Part I. Communications of the ACM (CACM) 3, 4 (April 1960), 184–195. https://doi.org/10.1145/367177.367199
- When and how to develop domain-specific languages. ACM Computing Surveys (CSUR) 37, 4 (2005), 316–344. https://doi.org/10.1145/1118890.1118892
- Microsoft. 2023. {guidance}: A guidance language for controlling large language models. https://github.com/langchain-ai/langchain
- João Moura. 2023. CrewAI: Framework for orchestrating role-playing, autonomous AI agents. https://github.com/crewAIInc/crewAI
- Foundations of JSON Schema. In International Conference on World Wide Web (WWW). 263–273. https://doi.org/10.1145/2872427.2883029
- Armin Ronacher. 2008. Jinja2 Documentation Release 2.0. http://mitsuhiko.pocoo.org/jinja2docs/Jinja2.pdf
- Alexander Rush. 2023. MiniChain: A Small Library for Coding with Large Language Models. In Conference on Empirical Methods in Natural Language Processing: System Demonstrations (EMNLP-Demo). 311–317. https://aclanthology.org/2023.emnlp-demo.27/
- Toolformer: Language Models Can Teach Themselves to Use Tools. In Advances in Neural Information Processing Systems (NeurIPS). https://proceedings.neurips.cc/paper_files/paper/2023/hash/d842425e4bf79ba039352da0f658a906-Abstract-Conference.html
- PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models. In Conference on Empirical Methods in Natural Language Processing (EMNLP). 9895–9901. https://doi.org/10.18653/v1/2021.emnlp-main.779
- Revised Report on the Algorithmic Language ALGOL 68. ACM SIGPLAN Notices 12, 5 (May 1977), 1–70. https://doi.org/10.1145/954652.1781176
- A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT. https://arxiv.org/abs/2302.11382
- AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation. https://arxiv.org/abs/2308.08155
- Decoupling Reasoning from Observations for Efficient Augmented Language Models. https://openreview.net/forum?id=CpgoO6j6W1
- ReAct: Synergizing Reasoning and Acting in Language Models. In International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=WE_vluYUL-X
- Efficiently Programming Large Language Models using SGLang. https://arxiv.org/abs/2312.07104
- GPTSwarm: Language Agents as Optimizable Graphs. In International Conference on Machine Learning (ICML). https://openreview.net/forum?id=uTC9AFXIhg
Collections
Sign up for free to add this paper to one or more collections.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.