Colored Markov Polycategories
- Colored Markov polycategories are ordered polycategories whose morphisms are Markov kernels augmented with a two-level color system for coherent typed interfaces.
- They employ kernel slotwise composition and trace semantics to model finite acyclic stochastic diagrams and enable structured stochastic analysis.
- The framework integrates object- and morphism-level coloring with interface kernels to support dynamic indexing and reverse-mode differentiation.
Colored Markov polycategories are ordered polycategories whose morphisms are Markov kernels, equipped with a two-level color discipline and coherent interface kernels for typed connections. They were introduced to give categorical semantics for stochastic systems built by wiring typed components together in ways that are neither purely sequential nor type-homogeneous. Their basic composition operation is kernel slotwise composition, which connects one output slot of a many-output kernel to one input slot of another and marginalizes the internal wire; their typed extension, colored kernel slotwise composition, inserts interface kernels between color-compatible but non-identical objects. The resulting formalism provides trace semantics for finite acyclic stochastic diagrams, a co-indexed treatment of systems whose structure changes over an indexing category, and a reverse-mode differentiation theorem for expected scalar objectives of parameterized diagrams (Papamarkou, 30 Apr 2026).
1. Ordered polycategorical substrate
The underlying combinatorial structure is an ordered polycategory. Inputs and outputs are finite ordered lists, and no symmetries are implicitly identified. For finite ordered tuples and , the polyarrows form a set
with identities for each object . Composition is slotwise: if
and , then output slot of may be wired to input slot of 0, producing
1
where
2
and
3
A Markov polycategory datum interprets each object 4 as a standard Borel space 5 and each polyarrow 6 as a Markov kernel
7
written 8. Identity polyarrows are identity kernels,
9
Kernel slotwise composition is defined by explicit bookkeeping maps that delete, project, and reinsert the internal variable. With 0, 1, 2, 3, and 4 as in the original definition, the composite is
5
Operationally, one samples 6 from 7, feeds the distinguished component 8 into 9, retains the surviving outputs of 0 together with the outputs of 1, and marginalizes the internal wire. A Markov polycategory is a Markov polycategory datum that is closed under this operation (Papamarkou, 30 Apr 2026).
The ordered convention is structurally significant. It means that polycategorical positions are literal slot indices rather than equivalence classes modulo permutation. This makes the wiring discipline suitable for finite acyclic stochastic diagrams whose external interfaces are ordered and typed.
2. Trace semantics for finite acyclic stochastic diagrams
The structural laws of kernel slotwise composition are controlled by a trace semantics on finite acyclic KSC diagrams. Such a diagram consists of finitely many vertices, each labeled by a kernel
2
together with internal wires
3
connecting the 4-th output slot of one vertex to the 5-th input slot of another, subject to type equality, linearity of slot usage, and acyclicity of the induced directed graph. External inputs and outputs are the untargeted and unsourced slots, ordered to determine profiles 6 and 7.
Given a topological ordering 8 of the vertices, the semantics is constructed by input-assembly maps
9
which assemble the inputs of each vertex from external inputs and outputs of earlier vertices. The induced joint trace measure on all vertex outputs is
0
Projecting to the external outputs gives the trace kernel
1
The key theorem states that for any finite acyclic KSC diagram, this trace kernel is a Markov kernel 2 and is independent of the chosen topological ordering. Hence each finite acyclic diagram determines a unique global kernel 3. The binary KSC composite is recovered as the trace kernel of the two-vertex one-wire diagram, and compatibility of trace semantics with diagram composition yields the polycategory laws: KSC is a well-defined Markov kernel, identities are units, and associativity and interchange hold (Papamarkou, 30 Apr 2026).
A common misunderstanding is to regard KSC as merely a notational variant of sequential composition. It is instead a primitive many-input, many-output operation indexed by slots. Its associativity theorem is not a triviality of notation but a consequence of the order-independent trace semantics for finite acyclic wiring diagrams.
3. Color systems, interface kernels, and typed composition
A colored Markov polycategory augments the untyped Markov polycategory structure by a global type discipline with both object-level and morphism-level colors. The color system comprises three pieces:
- A category 4, the object-color category.
- An ordered polycategory 5, the morphism-color polycategory, with
6
- A functor 7, identity-on-objects, where 8 is the unary part of 9.
An object-coloring is a function
0
extended pointwise to tuples. A morphism-coloring assigns to each polyarrow 1 a morphism color
2
subject to
3
and preservation of slotwise composition: 4
Typed compatibility between non-identical objects is realized by interface data. For each pair 5 there is a set
6
of admissible interface witnesses, and each
7
is implemented by a unary interface kernel
8
satisfying
9
The interface system is coherent when it satisfies identity compatibility
0
and composition compatibility
1
The unary KSC equation here is explicitly identified with Chapman–Kolmogorov.
This structure supports colored kernel slotwise composition. If
2
and there is an interface witness
3
then one defines
4
Thus the connection between the 5-th output of 6 and the 7-th input of 8 is mediated by an explicit interface kernel. The morphism color of the composite is computed synchronously in 9: 0
Finite acyclic CKSC diagrams generalize KSC diagrams by labeling each internal wire with an interface witness. Their semantics is defined by interface expansion: every interface-labeled wire is replaced by an additional unary vertex labeled by the corresponding interface kernel, producing an ordinary KSC diagram. The trace kernel of the CKSC diagram is then the trace kernel of its interface expansion, and the independence-of-ordering theorem carries over. Consequently, CKSC is a valid kernel, satisfies unit laws, and obeys associativity and interchange (Papamarkou, 30 Apr 2026).
A recurrent misconception is that colors in this theory are merely labels on objects. In fact the formalism has three interacting levels: object colors, morphism colors, and interface kernels implementing object-color morphisms at the kernel level. The typing discipline is therefore not exhausted by object annotation.
4. Co-indexed colored Markov polycategories
The formalism extends from a single typed stochastic calculus to families of such calculi varying over an indexing category. For a fixed color system 1, colored Markov polycategories and CMP-functors form a category
2
A CMP-functor 3 is an ordered polyfunctor preserving identities and KSC, together with strict preservation of colors and interfaces: 4 and
5
A co-indexed colored Markov polycategory consists of two strict functors over a category 6. The first,
7
assigns to each state 8 a CMP 9 and to each morphism 0 a state pushforward
1
The second,
2
assigns to each 3 a finite-dimensional real parameter space 4 and to each 5 a differentiable parameter pushforward
6
Strictness means
7
and similarly for parameter pushforwards.
This formulation is used to model systems whose typed stochastic structure changes with time, graph structure, or another indexing parameter. The supplied examples include typed workflows, where one may pass from 8 to 9, then to 0 by an interface kernel using a sigmoid, and then to 1 by a deterministic kernel; and dynamic graph systems, where CMPs are indexed by graphs and local update kernels are transported as the graph grows. Diagram semantics is functorial under state pushforwards: 2 for CKSC-reducible diagrams, so typed wiring and global kernel semantics commute with reindexing (Papamarkou, 30 Apr 2026).
The co-indexed viewpoint is important because it separates two kinds of variation: variation of stochastic architecture across 3, handled by CMP-functors, and variation of numerical parameters, handled by differentiable maps between parameter spaces.
5. Diagrammatic differentiation
The differentiation theory applies to finite acyclic parameterized CKSC diagrams. A parameterized kernel
4
has fixed source and target objects and fixed morphism color, with joint measurability of 5. A parameterized CKSC diagram assigns such a family to each vertex 6, with local parameter space 7, and total parameter space
8
For 9, the instantiated diagram 00 has trace kernel
01
Given a reference profile 02, a probability measure 03 on 04, and an objective function
05
the expected scalar objective is
06
The analysis proceeds via the trace law
07
on external inputs, reference variables, and all vertex outputs in the interface-expanded diagram. Under 08 one considers a conditional expected future objective
09
with 10.
The local analytic device is an admissible local parameter-gradient operator. For a parameterized kernel 11 with extra context 12, such an operator assigns to each measurable payoff function
13
a measurable covector-valued function
14
that differentiates expectations by moving the derivative inside the kernel integral. Two explicit examples are singled out:
- Score-function rule:
15
when 16 has a density 17 and the stated regularity holds.
- Deterministic pathwise rule:
18
when
19
and 20 is differentiable in 21.
For a chosen parameterized vertex 22, one introduces a local context 23 whose joint law with 24 is independent of 25, together with a conditional expected future objective
26
The local reverse rule is then
27
The global theorem states that if 28 is differentiable and the local hypotheses hold for every parameterized vertex, then
29
is given componentwise by expected local contributions,
30
Thus reverse-mode differentiation is expressed as a tuple of vertexwise expectations, with stochastic and deterministic kernels handled through admissible local gradient operators and with the CKSC typing retained throughout (Papamarkou, 30 Apr 2026).
6. Conceptual lineage and related frameworks
Colored Markov polycategories sit within a broader landscape of many-input, many-output categorical structures. A foundational antecedent is the theory of colored PROPs and 31-propertopes. In that setting, a colored PROP has vertical composition, horizontal composition, units, and permutation actions, and polycategories are encoded by suitable colored PROPs. Presheaves on the category of 32-propertopes define 33-propertopic sets, and horn- and boundary-filling conditions define weak 34 35-algebras; for suitable 36, one obtains higher versions of polycategories, colored PROPs, and TQFTs (0809.2161). This suggests a possible higher-dimensional continuation of the CMP program: a plausible implication is that one could seek a probabilistic colored PROP whose algebras model Markovian polymorphisms and then apply the propertope machinery to formulate higher colored Markov polycategories. In the supplied material, however, this is explicitly presented as conceptual extrapolation rather than as a theorem about CMPs.
A second neighboring line comes from bifibrations of polycategories and classical multiplicative linear logic. There, birepresentable polycategories correspond to 37-autonomous categories, and bifibrations generalize representability in the sense that such structures are birepresentable when they are bifibred over the terminal polycategory. The operational reading of polylinear maps in Banach-space examples treats inputs as states and outputs as probed by effects, with norms encoding preserved properties of systems (Blanco, 2023). This suggests fibrational and indexed reorganizations of typed stochastic polycategories, especially when one wants colors or modes to vary over a base category, although the supplied excerpt does not furnish a formal definition of a Markov version.
CMPs are also distinct from other colored diagrammatic categories. The multiparameter colored partition category is a rigid symmetric strict monoidal category whose morphisms are colored partition diagrams, whose path algebra admits a triangular decomposition, and whose representation theory involves complex reflection groups and reduced Kronecker coefficients. The supplied source explicitly notes that “colored Markov polycategory” is not a term used there (Mazorchuk et al., 2022). A useful clarification follows: colored partition categories study a different kind of colored diagrammatics, while CMPs are specifically measure-theoretic, kernel-based, and slotwise-polycategorical.
Relative to standard categorical probability, the distinguishing point is that ordinary categories, including Markov categories, model 38-input, 39-output morphisms with monoidal structure added externally, whereas CMPs take many-input, many-output morphisms as primitive and equip them with typed slotwise wiring and a diagrammatic reverse-mode calculus. That combination of ordered polycategorical composition, interface-mediated typing, and stochastic differentiation is the defining feature of the subject (Papamarkou, 30 Apr 2026).