Fixed-parameter tractable inference for discrete probabilistic programs, via string diagram algebraisation
arXiv:2604.25321 · doi:10.4230/LIPIcs.LICS.2026.76
Abstract
Discrete probabilistic programs (DPPs) provide a highly expressive formalism for compactly defining arbitrary finite probabilistic models. This expressivity comes at a price: DPP inference is PSPACE-hard. In this work, we show that DPP inference only takes polynomial time for programs that are 'structurally simple'. More precisely, inference can be performed in polynomial time when the primal graph of each function appearing in the probabilistic program has bounded treewidth, and the inverse acceptance probability is at most exponential in the size of the probabilistic program. Existing algorithms do not achieve this performance guarantee. Our method relies on finding suitable decompositions, algebraisations, of the string diagrams underlying DPPs, employing existing algorithms for tree decompositions. This is independent of the probabilistic setting of DPPs and has direct applications to many problems, such as evaluating queries on relational databases and cybersecurity risk assessment via attack trees.
arXiv commentExtended version of the paper published in the proceedings of LICS 2026, with an appendix containing the omitted proofs and two supplementary sections. This version corrects several errors of the initially published version and the earlier preprint; the revision notice at the end describes the corrections