PPDL: LLM-Based Flows as Probabilistic Programs
Researchers introduce PPDL, a probabilistic language for programming LLM-based flows. It aims to quantify and propagate uncertainty, enhancing trust in LLM applications.
Intelligence analysis by Gemini 2.5 Flash Lite

Building reliable LLM applications is challenging due to output uncertainty. This paper proposes PPDL, a novel probabilistic programming language designed to manage and propagate uncertainty in flows involving LLMs and other tools. Developers can use PPDL to gain confidence in LLM outputs without extensive code changes.
Imagine you're asking a super-smart robot friend to do a multi-step task, like baking a cake. Sometimes, the robot isn't sure about a step, like how much flour to use. PPDL is like a special instruction book that helps the robot keep track of its 'maybe's' and 'I'm sure's' for each step, so you know how confident it is about the final cake.
Analysis
LLM Uncertainty
The core challenge addressed by PPDL lies in the inherent uncertainty of Large Language Models (LLMs). While LLMs exhibit remarkable capabilities, their outputs are often probabilistic and lack clear confidence measures. This makes it difficult to build applications that depend on the accuracy and predictability of these models. When multiple LLM calls or interactions with external tools are chained together, this uncertainty can compound, leading to unreliable results and eroding user trust. PPDL aims to provide a structured way to manage this uncertainty, allowing developers to quantify and propagate it throughout the application's execution flow.
Probabilistic Programming
PPDL introduces a probabilistic language specifically tailored for programming LLM-based flows. This approach allows developers to express computations in a way that explicitly accounts for uncertainty. By treating LLM outputs and tool interactions as probabilistic events, PPDL enables the propagation of confidence levels or probability distributions across the entire flow. This means that if an early step in the flow has a high degree of uncertainty, that uncertainty can be tracked and reflected in the final output, providing users with a more accurate understanding of the result's reliability. The language is designed to be flexible, allowing experimentation with different inference scaling techniques without requiring significant code refactoring.
Theorem Proving Agent
To demonstrate the practical utility of PPDL, the researchers present an experimental study and a case study. The case study involves building a theorem proving agent for the Rocq theorem prover. Theorem proving is a domain that demands high accuracy and logical rigor, making it an excellent testbed for a system designed to manage uncertainty. By applying PPDL to this task, the authors aim to show how probabilistic programming can enhance the reliability of complex AI-driven reasoning systems. The success of such an agent would highlight PPDL's potential for applications where correctness and verifiable confidence are paramount.
Key points
- LLM outputs often lack accuracy and confidence measures, hindering reliable application development.
- PPDL is a new probabilistic language designed to program LLM-based flows.
- It enables quantification and propagation of uncertainty throughout application logic.
- Developers can experiment with inference scaling without extensive code changes.
- A theorem proving agent for Rocq was built as a case study to demonstrate PPDL's capabilities.
PPDL could significantly boost the adoption of LLMs in critical applications by providing a robust framework for managing uncertainty. This would lead to more dependable AI assistants, automated reasoning systems, and complex decision-support tools that users can trust.
If PPDL's probabilistic modeling proves too complex to implement or scale efficiently, or if the uncertainty quantification remains insufficient for highly sensitive tasks, its adoption might be limited, leaving a gap in reliable LLM application development.



