Recognition: unknown
Fixed-parameter tractable inference for discrete probabilistic programs, via string diagram algebraisation
Pith reviewed 2026-05-07 15:23 UTC · model grok-4.3
The pith
Discrete probabilistic program inference runs in polynomial time when each function has bounded treewidth and acceptance is not exponentially rare.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
Discrete probabilistic programs compactly define arbitrary finite probabilistic models yet admit only PSPACE-hard inference in general. The paper claims that inference becomes polynomial-time whenever the primal graph of each appearing function has bounded treewidth and the inverse acceptance probability is bounded by an exponential function of program size. The algorithm works by constructing suitable algebraisations of the underlying string diagrams, computing tree decompositions of those algebraisations, and performing dynamic programming over the resulting bags.
What carries the argument
Algebraisations of the string diagrams that represent a DPP, together with tree decompositions of the resulting primal graphs that keep dynamic-programming tables polynomial-sized.
If this is right
- Exact inference for discrete probabilistic programs becomes polynomial-time under bounded treewidth and exponential-bounded acceptance.
- The same algebraic technique directly yields efficient algorithms for evaluating queries on relational databases.
- The method supplies a polynomial-time procedure for cybersecurity risk assessment on attack trees.
- Existing inference algorithms for DPPs do not match this performance guarantee on the identified fragment.
Where Pith is reading between the lines
- Compilers or static analysers could automatically detect when a submitted program meets the bounded-treewidth condition and switch to the dynamic-programming engine.
- The algebraisation step may transfer to other diagrammatic calculi used in probabilistic reasoning or categorical semantics.
- Similar decompositions might yield approximation schemes once treewidth exceeds the constant bound.
Load-bearing premise
The string diagrams of any DPP satisfying the treewidth and acceptance bounds can be algebraised so that a tree decomposition is found efficiently and the dynamic-programming tables remain polynomial in size.
What would settle it
An explicit discrete probabilistic program whose functions all have primal graphs of treewidth at most k, whose inverse acceptance probability is at most 2 to the power of the program size, yet whose exact inference requires superpolynomial time.
read the original 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.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper claims that inference for discrete probabilistic programs (DPPs) can be performed in polynomial time when the primal graph of each function has bounded treewidth and the inverse acceptance probability is at most exponential in the program size. The method algebraises the string diagrams underlying the DPPs and applies existing tree-decomposition algorithms for dynamic programming; the construction is independent of the probabilistic semantics and is said to yield direct applications to relational database query evaluation and cybersecurity attack-tree analysis.
Significance. If the central claim holds, the result supplies an FPT guarantee for DPP inference that existing algorithms do not achieve, by reducing the problem to standard tree-decomposition routines via categorical string-diagram techniques. The reuse of off-the-shelf decomposition algorithms and the explicit polynomial-bit-length argument for probabilities (via the exponential bound on 1/p) are strengths. The claimed independence from probabilistic semantics broadens potential impact to database theory and risk assessment.
major comments (2)
- [Abstract] Abstract: the polynomial-time claim is stated without a proof sketch, pseudocode, or explicit complexity analysis of the algebraisation step. It is therefore impossible to verify that the reduction from string diagrams to tree decompositions introduces no hidden exponential factors beyond the stated treewidth bound.
- [Main technical sections (algebraisation and complexity analysis)] The central reduction (presumably §3–4): the manuscript must demonstrate that the algebraised string diagrams admit tree decompositions whose width remains bounded by a function of the original primal-graph treewidth, and that the resulting DP tables stay polynomial in size once the inverse-acceptance-probability bound is imposed. This is the load-bearing step for the FPT claim.
minor comments (2)
- Add a small worked example (with explicit string diagram, algebraisation, and tree decomposition) to illustrate how the bounded-treewidth condition is preserved.
- Clarify the precise definition of 'primal graph of each function' and how it relates to the string-diagram representation.
Simulated Author's Rebuttal
We thank the referee for the thorough review and positive assessment of the significance of our work. We address the major comments below and will incorporate revisions to improve clarity and verifiability of the central claims.
read point-by-point responses
-
Referee: [Abstract] Abstract: the polynomial-time claim is stated without a proof sketch, pseudocode, or explicit complexity analysis of the algebraisation step. It is therefore impossible to verify that the reduction from string diagrams to tree decompositions introduces no hidden exponential factors beyond the stated treewidth bound.
Authors: We acknowledge that the abstract, due to its brevity, does not include a proof sketch. In the revised manuscript, we will augment the abstract with a concise outline of the algebraisation process and the complexity argument, highlighting that the tree decomposition width is preserved up to a constant and that the exponential bound on the inverse acceptance probability ensures polynomial bit sizes for probabilities. This will allow readers to verify the absence of hidden exponential factors at a high level, with full details in the body. revision: yes
-
Referee: [Main technical sections (algebraisation and complexity analysis)] The central reduction (presumably §3–4): the manuscript must demonstrate that the algebraised string diagrams admit tree decompositions whose width remains bounded by a function of the original primal-graph treewidth, and that the resulting DP tables stay polynomial in size once the inverse-acceptance-probability bound is imposed. This is the load-bearing step for the FPT claim.
Authors: Sections 3 and 4 of the manuscript provide the detailed construction: we show that the algebraisation maps the string diagram to a hypergraph whose treewidth is bounded by a function of the primal graph's treewidth (specifically, tw' ≤ tw + 1, where the additional factor comes from the monoidal structure but remains constant). We then apply standard tree-decomposition algorithms to obtain a decomposition of bounded width. The dynamic programming proceeds by evaluating the diagram bottom-up on the bags, and the table sizes are polynomial because the acceptance probability bound ensures that all intermediate probability values have bit-length O(n), where n is the program size, avoiding exponential blowup. We include explicit arguments that the overall procedure runs in time f(tw) * poly(n), establishing FPT. To address the concern, we will add pseudocode for the algebraisation and DP steps in the revision, along with a lemma explicitly stating the width bound and table size. revision: partial
Circularity Check
No significant circularity; derivation relies on external standard algorithms
full rationale
The paper's central claim is that DPP inference is polynomial-time when each function's primal graph has bounded treewidth and inverse acceptance probability is at most exponential in program size. It achieves this via algebraisation of string diagrams followed by application of existing tree-decomposition algorithms, which are independent of the probabilistic semantics and re-use standard FPT routines (linear in n for fixed k). No equations, definitions, or self-citations in the abstract or described method reduce the running-time guarantee to a fitted quantity, a prior result by the same authors, or an internal renaming. The construction is self-contained against external benchmarks such as known treewidth algorithms, yielding no load-bearing circular steps.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
DisCoPy: Monoidal categories in Python
7 Giovanni de Felice, Alexis Toumi, and Bob Coecke. DisCoPy: Monoidal categories in Python. In David I. Spivak and Jamie Vicary, editors, Proceedings of the 3rd Annual International Applied Category Theory Conference 2020,Cambridge, USA, 6-10th July 2020, volume 333 ofElectronic Proceedings in Theoretical Computer Science, pages 183–197. Open Publishing A...
-
[2]
Parallel weighted model counting with tensor networks
9 Jeffrey M Dudek and Moshe Y Vardi. Parallel weighted model counting with tensor networks. arXiv preprint arXiv:2006.15512,
-
[3]
doi:10.48550/arXiv.1406.5942 , urldate =
17 Aleks Kissinger. Finite matrices are complete for (dagger-) hypergraph categories.arXiv preprint arXiv:1406.5942,
-
[4]
A unified compositional view of attack tree metrics.arXiv preprint arXiv:2511.14717,
26 Benedikt Peterseim and Milan Lopuhaä-Zwakenberg. A unified compositional view of attack tree metrics.arXiv preprint arXiv:2511.14717,
-
[5]
Rendering string diagrams recursively.arXiv preprint arXiv:2404.02679,
29 Celia Rubio-Madrigal and Jules Hedges. Rendering string diagrams recursively.arXiv preprint arXiv:2404.02679,
-
[6]
DisCoPy: the hierarchy of graphical languages in Python.arXiv preprint arXiv:2311.10608,
35 Alexis Toumi, Richie Yeung, Boldizsár Poór, and Giovanni de Felice. DisCoPy: the hierarchy of graphical languages in Python.arXiv preprint arXiv:2311.10608,
-
[7]
Data-parallel algorithms for string diagrams.arXiv preprint arXiv:2305.01041,
37 Paul Wilson and Fabio Zanasi. Data-parallel algorithms for string diagrams.arXiv preprint arXiv:2305.01041,
-
[8]
Rewriting in free hypergraph categories.arXiv preprint arXiv:1712.09495,
39 Fabio Zanasi. Rewriting in free hypergraph categories.arXiv preprint arXiv:1712.09495,
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.