Representing Prompting Patterns with PDL: Compliance Agent Case Study

📅 2025-07-08
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing LLM prompting frameworks suffer from insufficient flexibility: excessive API encapsulation obscures underlying complexity, while rigid templates hinder customization—impeding the development of sophisticated agent systems. To address this, we propose Prompt Declaration Language (PDL), a declarative language that elevates prompt patterns to first-class linguistic constructs, enabling unified modeling of prompts, rule-based logic, external tool invocations, and LLM calls. PDL bridges manual prompt design and automated optimization through an integrated rule engine and native tool orchestration mechanism. Evaluated on compliance-oriented agent tasks, PDL achieves substantial performance gains via tunable, composable prompt patterns—delivering up to 4× speedup over static templates. Our approach establishes a novel prompting paradigm for agent programming that jointly ensures expressive power and end-to-end optimizability.

Technology Category

Application Category

📝 Abstract
Prompt engineering for LLMs remains complex, with existing frameworks either hiding complexity behind restrictive APIs or providing inflexible canned patterns that resist customization -- making sophisticated agentic programming challenging. We present the Prompt Declaration Language (PDL), a novel approach to prompt representation that tackles this fundamental complexity by bringing prompts to the forefront, enabling manual and automatic prompt tuning while capturing the composition of LLM calls together with rule-based code and external tools. By abstracting away the plumbing for such compositions, PDL aims at improving programmer productivity while providing a declarative representation that is amenable to optimization. This paper demonstrates PDL's utility through a real-world case study of a compliance agent. Tuning the prompting pattern of this agent yielded up to 4x performance improvement compared to using a canned agent and prompt pattern.
Problem

Research questions and friction points this paper is trying to address.

Addressing complexity in LLM prompt engineering frameworks
Enabling flexible prompt customization and automatic tuning
Improving performance of agentic programming through declarative representation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Introduces Prompt Declaration Language (PDL)
Enables manual and automatic prompt tuning
Combines LLM calls with rule-based code