Towards a Probabilistic Framework for Analyzing and Improving LLM-Enabled Software
Juan Manuel Baldonado, Flavia Bonomo-Braberman, Víctor Adrián Braberman
TL;DR
The paper addresses reliability and verifiability challenges in LLM-enabled software by modeling distributions over meaning-classes produced by Transference Models (TMs) and estimating empirical distributions $p(\text{meaning-class})$ via clustering. It defines alignment, concentration, and improvement, and introduces almost-sure improvement across an input distribution $D$ to guide principled refinement. A key contribution is the Illustrative autoformalization case study on translating NL docstrings to Dafny pre-/post-conditions, demonstrating that concentrating probability mass on the correct meaning-class and reducing concentrated misalignment yields targeted improvements (e.g., reducing misaligned cases from 6 to 2). The framework also extends to agentic AI by treating LLM-driven agents as MDPs, facilitating safety analyses through meaning-class distributions and trajectory evaluation, thereby offering a practical foundation for robust, interpretable LLM-enabled software engineering.
Abstract
Ensuring the reliability and verifiability of large language model (LLM)-enabled systems remains a significant challenge in software engineering. We propose a probabilistic framework for systematically analyzing and improving these systems by modeling and refining distributions over clusters of semantically equivalent outputs. This framework facilitates the evaluation and iterative improvement of Transference Models--key software components that utilize LLMs to transform inputs into outputs for downstream tasks. To illustrate its utility, we apply the framework to the autoformalization problem, where natural language documentation is transformed into formal program specifications. Our case illustrates how distribution-aware analysis enables the identification of weaknesses and guides focused alignment improvements, resulting in more reliable and interpretable outputs. This principled approach offers a foundation for addressing critical challenges in the development of robust LLM-enabled systems.
