A DbC Inspired Neurosymbolic Layer for Trustworthy Agent Design
Claudiu Leoveanu-Condrei

TL;DR
This paper introduces a contract layer inspired by Design by Contract to enhance trustworthiness in Large Language Models by ensuring semantic and type compliance through probabilistic validation.
Contribution
It adapts DbC principles to LLMs, creating a contract layer that enforces semantic and type requirements, improving verifiability and functional equivalence.
Findings
Contract layer improves LLM reliability
Probabilistic validation ensures compliance
Agents satisfying same contracts are functionally equivalent
Abstract
Generative models, particularly Large Language Models (LLMs), produce fluent outputs yet lack verifiable guarantees. We adapt Design by Contract (DbC) and type-theoretic principles to introduce a contract layer that mediates every LLM call. Contracts stipulate semantic and type requirements on inputs and outputs, coupled with probabilistic remediation to steer generation toward compliance. The layer exposes the dual view of LLMs as semantic parsers and probabilistic black-box components. Contract satisfaction is probabilistic and semantic validation is operationally defined through programmer-specified conditions on well-typed data structures. More broadly, this work postulates that any two agents satisfying the same contracts are \emph{functionally equivalent} with respect to those contracts.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
