Manuscript Offprint
arXiv:2608.24713Lifted Model Construction under Approximate Commutativity
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
Malte Luttermann , Jan Speller , Tanya Braun , Marcel Gehrke , and Ralf Möller
Institute for Humanities-Centered Artificial Intelligence, University of Hamburg {malte.luttermann,marcel.gehrke,ralf.moeller}@uni-hamburg.de
Data Science Group, University of Münster {jan.speller,tanya.braun}@uni-muenster.de
Abstract. Lifted inference algorithms enable scalable probabilistic inference even for large object domains by leveraging the indistinguishability of objects in a probability distribution. An essential prerequisite for constructing a lifted representation is to identify commutative factors, i.e., functions whose output values are invariant under permutations of a subset of their input values, in a potential-based factorisation. In practice, however, parameters learned from data inevitably deviate even if associated objects are indistinguishable, causing their corresponding factors to be only approximately commutative instead of being exactly commutative. We address this problem by introducing the concept of -commutativity, a relaxation of commutativity where output values are only approximately invariant under permutations of input values. Specifically, we show how -commutativity can be exploited for lifted model construction, downstream probabilistic inference, and prove strict bounds on the induced approximation error, thereby ensuring the practical applicability of lifted model construction while maintaining highly accurate query results. These theoretical guarantees are confirmed empirically, demonstrating comparable query accuracy at lower runtime.
1 Introduction
Uncertain reasoning is a fundamental task in artificial intelligence, where uncertainty is commonly represented through probability distributions over random variables. Probabilistic graphical models such as factor graphs (FGs) provide a compact way to encode joint distributions over a set of random variables (randvars) by decomposing a distribution into products of local functions, called factors. Even with a factorised representation, the problem of probabilistic inference (i.e., computing marginal or conditional distributions of randvars) is intractable in general as the computational cost grows exponentially with the number of randvars [3]. To allow for tractable probabilistic inference whose complexity grows polynomially in the number of objects in the underlying domains, lifted inference algorithms exploit the indistinguishability of objects by using a
These authors contributed equally to this work.
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
representative for computations [13]. Performing lifted inference, however, requires a lifted representation in which indistinguishable objects are grouped together. The construction of such a lifted representation includes identifying factors that exhibit symmetries and can therefore be grouped together. One important class are commutative factors (that is, factors whose output values are invariant under permutations of a subset of their input values). Whether a factor is commutative depends on the precise output values it maps its input values to, and herein lies a subtle but pervasive practical issue: When numbers are estimated from observational data, two values that should ideally coincide hardly ever do so up to the last digit. Even in simple cases such as counted data, learning can always yield a distribution of values, which makes an otherwise commutative factor fail the strict definition of commutativity, even though the commutativity is clearly present from a modelling perspective. Current state-of-the-art algorithms for detecting commutative factors have no means to tolerate such discrepancies. In this paper, we address this problem by softening the underlying equality requirement, thereby enabling the detection of approximate commutativity and allowing for further compression of FGs.
Previous work. When dealing with noisy distributions, typical approximate techniques control the deviation on the level of the full (global) probability distribution based on classes of prior distributions [1], as done, e.g., by distortion models such as the constant odds ratio model, which bounds the multiplicative deviation from a nominal reference distribution [12]. In contrast, we consider a factorised distribution and bound individual potentials directly via a local constant-odds-ratio-type neighbourhood on the level of a single factor. Structurally, however, the overall global approximation follows the same guarantees as distortion models. There has also been research on robustness in graph learning against false measurements and outliers [6, 14], whereas our approach relaxes exact structural symmetry in factors for lifted inference. The line of work on lifted probabilistic inference goes back to Poole [15], who introduced parametric factor graphs (PFGs) as a representation that interleaves first-order logic with probabilistic modelling and lifted variable elimination (LVE) as an inference algorithm operating on PFGs. A substantial body of subsequent research has refined and extended LVE in various directions [18]. One of these refinements includes the introduction of so-called counting randvars (CRVs) [11], which count over the occurrences of range values in the input of a factor instead of explicitly listing possible combinations of input values, thereby exploiting the commutativity of factors. The current state-of-the-art to construct a lifted representation such as a PFG is the advanced colour passing (ACP) algorithm [7]. A core ingredient of ACP is to determine, for every factor, a maximum sized subset of commutative arguments such that factors can be compressed by using CRVs to count over the commutative arguments. To determine maximum sized subsets of commutative arguments, the detection of commutative factors (DECOR) algorithm [8, 9] is the state-of-the-art. Such lifted model construction techniques have so far focused on approximate factors rather than approximate commutativity [10, 16].
Our contributions. We introduce -commutativity, an approximate variant of commutativity in which output values are allowed to deviate depending on a hyperparameter . On the basis of -commutativity, we show how approximately commutative factors can be compressed by replacing groups of similar values with representative values, thereby simplifying the underlying distribution by giving events of a symmetry set the same value. We further establish a strict bound on the approximation error induced by such a compression, guaranteeing that subsequent inference on the resulting lifted representation remains accurate. Finally, we empirically demonstrate that the approximation error remains well below the theoretical bounds in practice, while the proposed algorithm substantially reduces runtime across a range of parameter settings.
Structure of this paper. The remainder of the paper is organised as follows. We first introduce the necessary background on FGs and commutative factors therein. We then formalise the concept of -commutativity, develop a compression scheme based on -commutative representatives, and prove important properties leading to a strict bound on the resulting approximation error. Afterwards, we embed the compression of -commutative factors into the ACP algorithm for lifted model construction and empirically show that downstream probabilistic inference still produces highly accurate results. Due to space constraints, detailed proofs are relegated to App. A and further experimental results to App. B.
Definition 1 (Factor Graph). An FG is a tuple where is a set of randvars, is a set of factor nodes, and is a set of function definitions (called factors). Each defines a function over the Cartesian product of the ranges of its argument sequence of randvars . The image of consists of non-negative real numbers (potentials), and each factor is non-trivial in the sense that it attains at least one positive value. For each pair of variable node and factor node , there is an edge if . The full joint probability distribution encoded by for an assignment to the randvars in , abbreviated as , is the normalised product over all factors in :
where is a projection of to the argument list of and is the normalisation constant, defined as .
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
Example 1. Fig. 1a shows an FG modelling the interplay between the competences and of two employees Alice and Bob, respectively, and the revenue of the company they work for. The ranges of the randvars are and Fig. 1b shows the function definition of the factor , illustrated as a potential table, i.e., , and so on, such that are non-negative real numbers with for all . We omit the potential tables of and for brevity.

(a)
| ComA | ComB | Rev | |
|---|---|---|---|
| high | high | high | |
| high | high | low | |
| high | low | high | |
| high | low | low | |
| low | high | high | |
| low | high | low | |
| low | low | high | |
| low | low | low |
(b)
Fig. 1: (a) An FG modelling the interplay between the competences of two employees and the revenue of the company they work for. (b) The function definition of , where with for all .
Ex. 1 illustrates that the output of depends only on the number of highly competent employees, not on their identities. For instance, . Thus, permuting and leaves the output unchanged—only the count of competences set to high matters. This invariance under permutations is a key property exploited by lifted inference algorithms and motivates the following formal definition of commutativity.
Definition 2 (Commutative Factor [7]). Let denote a factor and let be a subset of 's arguments with . Then, is commutative with respect to if for all assignments it holds that for all permutations of with for all .
We refer to the arguments in as commutative arguments. Note that arguments can only be commutative if they have the same range because only arguments with identical ranges can be permuted. Thus, when searching for commutative arguments, only subsets with the same range need to be considered. Consider again from Fig. 1b. According to Def. 2, is commutative with respect to . The above definition relies on exact equality of potentials. In practice, however, small estimation errors often break this equality even when the underlying symmetry is still present. The next section therefore introduces approximate commutativity.
3 Approximate Commutativity
So far, the definition of a commutative factor requires strict equality among potentials, which we relax here, introducing the notion of -commutativity based on the idea of -equivalence [10], establish its fundamental properties, and derive the bounds needed for its practical application in lifted model construction.
We begin to introduce the more general notion of -equivalence between two potentials , written as , which holds if
Two factors are -equivalent if there exists a permutation of arguments such that Eq. (1) holds for all pairwise row comparisons of potentials. Combining -equivalence and commutativity naturally leads to the notion of -commutativity.
Definition 3 ( -Commutative Factor). Let denote a factor, let be a subset of its arguments with , and let . Then, is -commutative with respect to if for all assignments and all permutations
where is the symmetric group over , the potentials and are -equivalent, i.e.,
and
We refer to the arguments in as -commutative arguments. Note that, for the choice of , -commutativity reduces to strict commutativity.
As illustrated in Table 1b, the commutativity of a factor can be exploited to obtain a more compact representation of the factor by introducing a CRV that groups the commutative arguments such that the original potentials are replaced by aggregated potentials. Here, ComA and ComB are not listed individually but have been replaced by a CRV that counts the number of employees with a certain competence (i.e., [2,0] stands for two employees with a high competence and none with a low competence, [1,1] stands for one employee with a high competence and one with a low competence, and [0,2] stands for two employees with a low competence and none with a high competence). Given a commutative factor such as from Fig. 1b, all assignments that differ only by a permutation of the range values of the commutative arguments share the same potential, so choosing preserves the semantics exactly. However, for an -commutative factor such as from Table 1a, potentials corresponding to assignments only differ by a permutation on the commutative arguments may deviate by a factor of up to , and hence collapsing them into a single potential inevitably discards information (e.g., must be chosen to represent both and at the same time). We therefore seek to choose such that its deviation from the original potentials is minimised.
Example 2. Consider the factor from Table 1a. Given that and as well as and are -equivalent for some , is -commutative with respect to .
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
| ComA | ComB | Rev | |
|---|---|---|---|
| high | high | high | |
| high | high | low | |
| high | low | high | |
| high | low | low | |
| low | high | high | |
| low | high | low | |
| low | low | high | |
| low | low | low |
(a)
| #E[Com(E)] | Rev | |
|---|---|---|
| [2,0] | high | |
| [2,0] | low | |
| [1,1] | high | |
| [1,1] | low | |
| [0,2] | high | |
| [0,2] | low |
(b)
Table 1: (a) An exemplary factor with -commutative arguments provided that and as well as and are -equivalent. (b) A compressed representation of from (a) using a CRV to represent the -commutative arguments .
In the following, we aim to find an optimal representative factor to compress an -commutative factor such that the underlying semantics is preserved as much as possible. To do so, we need a few theoretical properties induced by the notion of -commutativity. The following lemma, which has been proven only across different factors [10, Lemma 6], establishes a useful consequence of the symmetric definition of -commutativity and serves as a tool to derive subsequent bounds.
Lemma 1. Let denote a factor that is -commutative with respect to a subset of its arguments . Then, for all permutations , it holds that
The proof follows the same structural argument as [10, Lemma 6], using the symmetric definition of -commutativity. Details are given in App. A.
Before we turn our attention to the compression of an -commutative factor, we briefly state two important structural properties of -commutativity, which are algorithmically relevant when it comes to detecting -commutativity of a factor (which needs to be done before the compression can take place). A natural question is whether -commutativity with respect to a set is inherited by its subsets (as it is the case for the exact version of commutativity [9, Prop. 10]).
Proposition 1. Let be -commutative with respect to . Then, is -commutative with respect to every subset satisfying .
Proof. Since, , we have . Hence, by Def. 3, for all and assignments , it holds that
Since , the same relations hold for all .
□
Prop. 1 shows that -commutativity is preserved when moving from a set of randvars to its subsets. Hence, a factor that is commutative with respect to may be -commutative with respect to a strict superset , thereby enabling further compression of the original factor. An important follow-up question is whether local -commutativity of smaller subsets implies this also for their union, which is indeed the case for exact commutativity [9, Theorem 11] and gives rise to an efficient algorithm to compute subsets of commutative arguments [9, Algorithm 2]. The following theorem shows that the corresponding property does not hold for -commutativity, implying that computing subsets of -commutative arguments is more sophisticated than computing subsets of strictly commutative arguments.
Theorem 1. -commutativity is not closed under unions of sets with respect to which a factor is -commutative.
Proof. Let denote any assignment to the randvars . Let be 0.1. The potentials of the factor are given by
| high | medium | low | 1 |
| high | low | medium | 1.1 |
| medium | high | low | 1.1 |
| medium | low | high | 1.21 |
| low | high | medium | 1.21 |
| low | medium | high | 1.1 |
All non-listed assignments are mapped to the potential 1. is -commutative with respect to all individual pairs , , and , but not with respect to the set . Consider the assignment and the permutation , (cycle of two transpositions), which maps (high, medium, low) to . However, is not an element of the interval . Thus, is not -commutative with respect to .
Theorem 1 implies that the algorithm presented in [9, Algorithm 2] to efficiently compute a maximum sized subset of commutative arguments cannot directly be transferred to compute a subset of -commutative arguments instead. We next turn our attention to the compression of an -commutative factor, which is performed by replacing it with a smaller representative factor.
3.1 Replacement of Potentials by Representative
The construction developed in this subsection formalises the aggregation of potentials over symmetry sets induced by permutations of -commutative arguments. We first introduce symmetrised representative factors as weighted representatives over symmetry sets and then study the algebraic structure induced by the permutation group , which partitions the assignment space into equivalence classes of pairwise -equivalent potentials.
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
Definition 4 (Symmetrised Representative Factor). Let be a factor, which is -commutative with respect to . For an assignment , the symmetrised representative factor associated with is defined by
where denotes the symmetry set of under permutations of the -commutative arguments, and where the weights satisfy and .
To better understand why such a construction is possible, we first investigate the structure underlying these symmetry classes. This leads us to examine , which is shown to be closed under composition and inversion in the following.
Lemma 2. For a set , is a subgroup of .
Proof. By definition . If , then for all , resulting in closed group operations . If , then due to . is a group and therefore . This means that for all with it holds that , which means that the inverse is also in .
This subgroup naturally induces a group operation of on the assignment space via for , whose properties are inherited by the corresponding symmetry sets .
Hence, symmetry sets are precisely the orbits of this group operation.
Corollary 1. Let be a factor, which is -commutative with respect to . If , then .
Proof. As , there exists such that . Let . Then, there is such that . Since is a subgroup of , it is closed under composition, hence . Therefore , which shows . The reverse inclusion follows analogously for .
While the previous result describes how -commutativity behaves on the level of argument subsets, the following lemma establishes the induced equivalence on the level of potentials via -equivalence.
Lemma 3. Let be -commutative with respect to . Then, all potentials induced by assignments within the same symmetry set are pairwise -equivalent, i.e., if , , then .
Proof. Let . Then there exist permutations such that and . Since is a subgroup of (Lemma 2), it is closed under composition and taking inverses.
Hence, . Therefore, . Because is -commutative with respect to , it follows from Def. 3 that and . Hence, it holds that \phi(r'_1, \ldots, r'_n) = \varepsilon \phi(r'_1', \ldots, r'_n').
Thus, we can also view as the equivalence class of the equivalence relation on induced by the group operation of via
Consequently, the quotient space is well-defined and can be identified with the set of all symmetry sets. Hence, there exists a representative set containing exactly one element per equivalence class, inducing a bijection
Different symmetry sets (equivalence classes) of the same factor may induce different weighting schemes. Within each equivalence class, however, the weights must be chosen consistently with the quotient structure so that every class contributes exactly once to the representative potential (for the size of the symmetry set, see Section A.1). This raises the question whether replacing potentials by symmetrised representatives preserves -equivalence of factors.
Theorem 2. Let be -commutative with respect to and let be its symmetrised representative factor for . Then, and are -equivalent.
Proof. By Lemma 3, all potentials with are pairwise -equivalent. Hence, by [17, Theorem 15], any weighted mean is also -equivalent to . Applied row-wise to all assignments and potentials relative to their equivalence classes, this yields -equivalent factors.
Choosing the arithmetic mean as the symmetrised representative factor arises as a trivial special case of Thm. 2 by assigning uniform weights on for which holds, yielding .
Corollary 2. Let be -commutative with respect to and let the mean
be defined with weights for for a given . Then is a symmetrised representative factor of and is -equivalent to .
The mean is particularly attractive as it treats all symmetric assignments uniformly avoiding bias towards specific permutations and minimises the squared deviation [10]. It is also optimal with respect to the squared deviation in the sense that, when all values are replaced by the same representative within the group , the resulting deviation from the original factor is minimised. These properties make it a natural choice for the symmetrised representative factor in practical implementations (see Sec. 4 for experiments). However, when prior knowledge indicates a bias toward specific arguments in the underlying data, or when domain expertise is available, the weights assigned to individual arguments of the original factor can always be adapted accordingly.
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
3.2 Asymptotic Bounds
To quantify the approximation error induced by symmetrisation, we next analyse the resulting deviation between the original model and the model obtained by symmetrising -commutative factors. We make use of the following symmetric distance measure, which allows us to bound the change in query results [2, 10].
Definition 5 ([2]). The symmetric distance between two distributions and introduced in [2] (see [10] for details) is defined as
With this measure at hand, we first derive a general bound for arbitrary weighting schemes.
Theorem 3. Let be an with factors , of which with are -commutative with respect to , respectively. Let be the with factors , where -commutative factors of are replaced by their symmetrised representative factors. Further, let and denote the underlying full joint probability distributions encoded by and , respectively. Then, it holds that
Proof. According to Def. 3, every updated potential in differs from its original potential in by at most a factor for , while all remaining factors are left unchanged. Since for any assignment , using Lemma 1 we obtain
Consequently,
where denotes the projection of . Substituting these bounds into Eq. (4) yields .
For the special case of arithmetic averaging, we can sharpen this bound.
Lemma 4. Let be an -commutative factor with respect to , let be a set of disjoint representatives for all disjoint equivalence classes ordered by size such that , and let be the symmetrised representative factor via the mean as in Eq. (2). Then,
Condensed Proof (Longer Version inApp. A). The mean is uniquely determined within each equivalence class . First, observe that for every equivalence class and all , Lemma 3 implies pairwise -equivalence, so the potentials within one equivalence class can be ordered
where and . When the maximum and minimum originate from two different equivalence classes and with , the worst-case assignments are independent. For the maximum choose , while all remaining potentials in the same equivalence class attain their maximal admissible value for all . This yields
For the minimum choose , while all remaining values in the same equivalence class attain their minimal admissible value for all . Consequently,
Observe, that is monotonically increasing in , whereas is monotonically decreasing in . Hence, the largest equivalence classes by size produce the extremal deviations. To determine which class size appear in the numerator and denominator, consider the monotonically decreasing for . Therefore, for it follows:
Consequently, the sharpest bound is obtained by using and . When both extrema originate from the same equivalence class, for
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
all , the quotient is maximised via and , leading to smaller values
Combining the class-wise extremal bounds yields the final global statement for the representative mean-construction, which we show next.
Theorem 4. Let be an with factors , of which with are -commutative with respect to , respectively. Let be the set of disjoint representatives for all equivalence classes ordered by size with . Let be the obtained by by replacing each factor by its mean-based symmetrised representative factor as in Eq. (2). Then, for the induced distributions and and , it holds that
Proof. The statement follows by factorisation of the joint potential, the determination of the extrema on a projected factor-level instead of a global assignment-level, and the class-wise bound from Lemma 4 for the monotonic logarithm.
Even more precisely, the bound is sharp in the general non-trivial case.
Theorem 5. The bound given in Thm. 4 is optimal.
Proof Sketch. Ex. 3 in App. A uses the construction from the proof of Lemma 4 per factor, hits the bound, and is therefore sharp.
Note that the choice of a multiplicative relaxation in Def. 3 is what makes this bound attainable in the first place, as is based on quotients of potentials and only relies on relative sizes. An additive relaxation, requiring permuted potentials differ by at most a constant, would lead to arbitrary large deviations.

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 2: Downstream lifted inference performance, averaged over all generated instances and queries. (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ). (b) Distribution of the per-query quotient between the approximate result and the exact result .
4 Experiments
We complement our theoretical results with an empirical evaluation assessing to what extent -commutativity translates into practical benefits for lifted model construction and downstream inference. In particular, we answer the question of how the trade-off between higher compression and accuracy of query results behaves when compressing -commutative factors. Concretely, we compare the run time of LVE on the compressed model returned by the exact ACP algorithm (which is only able to compress strictly commutative factors) to the run time of LVE on the compressed model returned by its -relaxed variant using the mean as the symmetrised representative factor (denoted as “ACP ” in the following) and measure the deviation of the query results, quantified by the per-query quotient between the query result (i.e., marginal probability) obtained on the ACP -compressed model and the query result obtained on the exact ACP-compressed model. For our experiments, we use the same input FGs as in the original ACP paper [7] and add noise to the potentials of the (strictly) commutative factors to obtain -commutative factors. We only manipulate commutative factors and leave the remaining factors unchanged to investigate the effect of -commutativity on the compression-accuracy trade-off in isolation (the effect of grouping different factors that are approximately equal has been investigated in [10] and hence, we only consider indistinguishability within factors — characterised by -commutativity — and no indistinguishability between factors). Specifically, each input FG contains between and randvars with Boolean range and between and factors, where controls the size of the FGs. Each input FG contains -commutative factors, where . The -commutative factors are obtained by multiplying the potentials of the (strictly) commutative factors by a uniform sample from .
Fig. 2 reports the results averaged over all generated instances and queries. Fig. 2a shows that the compression of -commutative factors substantially accelerates downstream probabilistic inference, where the speedup increases exponen-
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
tially with the domain size. At the same time, Fig. 2b confirms that the query results (i.e., marginal probabilities) remain extremely close to those obtained with exact ACP: The per-query quotient concentrates tightly around the optimal value one across all evaluated configurations (except for very few outliers). In other words, unlocks the speedup of lifted inference at almost no loss of accuracy. To give insights into the influence of and , we provide further experimental results for individual choices in App. B.
5 Conclusion
We have introduced -commutativity, a principled relaxation of commutativity that tolerates the minute numerical deviations that inevitably arise in practice, e.g., when factor potentials are estimated from data. On this basis, we have developed a representative-based compression scheme that collapses -equivalent potentials into a shared value, integrated the relaxation into the state-of-the-art ACP algorithm, and proved a sharp (optimal) bound on the resulting approximation error of probabilistic queries. Our empirical evaluation confirms that the bound is loose in practice: Compressing -commutative factors unlocks substantial lifted inference speedups while the deviation of query results stays well within the theoretical guarantee. As factors are merely non-negative functions, all proposed concepts directly apply to the detection and compact storage of approximately symmetric functions in more general settings.
An interesting direction for future work is to investigate approximate indistinguishability for FGs with continuous variables. Currently, the usage of a CRV restricts the present work to the discrete case and a continuous counterpart of a CRV is required to handle -commutativity in models with continuous variables.
Acknowledgments
This work was partially funded by the Ministry of Culture and Science of the German State of North Rhine-Westphalia.
References
-
Berger, J.O.: Robust Bayesian Analysis: Sensitivity to the Prior. Journal of Statistical Planning and Inference 25, 303–328 (1990)
-
Chan, H., Darwiche, A.: A Distance Measure for Bounding Probabilistic Belief Change. International Journal of Approximate Reasoning 38, 149–174 (2005)
-
Cooper, G.F.: The Computational Complexity of Probabilistic Inference using Bayesian Belief Networks. Artificial Intelligence 42, 393–405 (1990)
-
Frey, B.J., Kschischang, F.R., Loeliger, H.A., Wiberg, N.: Factor Graphs and Algorithms. In: Proceedings of the Thirty-Fifth Annual Allerton Conference on Communication, Control, and Computing. pp. 666–680. Allerton House (1997)
-
Kschischang, F.R., Frey, B.J., Loeliger, H.A.: Factor Graphs and the Sum-Product Algorithm. IEEE Transactions on Information Theory 47, 498–519 (2001)
-
Li, Z., Junna, S., Liao, W.: A Robust Factor Graph Framework for Navigation on PDR/Magnetic Field Integration. Measurement 245, 116509 (2025)
-
Luttermann, M., Braun, T., Möller, R., Gehrke, M.: Colour Passing Revisited: Lifted Model Construction with Commutative Factors. In: Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence (AAAI-2024). pp. 20500–20507. AAAI Press (2024)
-
Luttermann, M., Machemer, J., Gehrke, M.: Efficient Detection of Commutative Factors in Factor Graphs. In: Proceedings of the Twelfth International Conference on Probabilistic Graphical Models (PGM-2024). pp. 38–56. PMLR (2024)
-
Luttermann, M., Möller, R., Gehrke, M.: On the Detection of Commutative Factors in Factor Graphs: Necessary and Sufficient Conditions. arXiv preprint, https://arxiv.org/abs/2605.26908 (2026)
-
Luttermann, M., Speller, J., Gehrke, M., Braun, T., Möller, R., Hartwig, M.: Approximate Lifted Model Construction. In: Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence (IJCAI-2025). pp. 9077–9085. IJCAI Organization (2025)
-
Milch, B., Zettlemoyer, L.S., Kersting, K., Haimes, M., Kaelbling, L.P.: Lifted Probabilistic Inference with Counting Formulas. In: Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence (AAAI-2008). pp. 1062–1068. AAAI Press (2008)
-
Miranda, E., Montes, I., Destercke, S.: A Unifying Frame for Neighbourhood and Distortion Models. In: Proceedings of the Eleventh International Symposium on Imprecise Probabilities: Theories and Applications. pp. 304–313. PMLR (2019)
-
Niepert, M., Van den Broeck, G.: Tractability through Exchangeability: A New Perspective on Efficient Probabilistic Inference. In: Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence (AAAI-2014). pp. 2467–2475. AAAI Press (2014)
-
Pfeifer, T., Weissig, P., Lange, S., Protzel, P.: Robust Factor Graph Optimization – A Comparison for Sensor Fusion Applications. In: Proceedings of the Twenty-First IEEE International Conference on Emerging Technologies and Factory Automation. pp. 1–4. IEEE (2016)
-
Poole, D.: First-Order Probabilistic Inference. In: Proceedings of the Eighteenth International Joint Conference on Artificial Intelligence (IJCAI-2003). pp. 985–991. Morgan Kaufmann Publishers Inc. (2003)
-
Speller, J., Luttermann, M., Gehrke, M., Braun, T.: Compression versus Accuracy: A Hierarchy of Lifted Models. In: Proceedings of the Twenty-Eighth European Conference on Artificial Intelligence (ECAI-2025). pp. 5051–5058. IOS Press (2025)
-
Speller, J., Luttermann, M., Gehrke, M., Braun, T.: Towards Explainability of Approximate Lifted Model Construction: A Geometric Perspective. In: Proceedings of the Eleventh Workshop on Formal and Cognitive Reasoning (FCR-2025). pp. 41–56. CEUR (2025)
-
Taghipour, N.: Lifted Probabilistic Inference by Variable Elimination. Ph.D. thesis, KU Leuven (2013)
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
A Detailed Proofs
Lemma 1. Let denote a factor that is -commutative with respect to a subset of its arguments . Then, for all permutations , it holds that
Proof. The proof follows the same structural argument as [10, Lemma 6]. For any permutation of a given assignment , by definition, the symmetric properties and hold, and therefore also the rearranged inequalities and .
Lemma 4. Let be an -commutative factor with respect to , let be a set of disjoint representatives for all disjoint equivalence classes ordered by size such that , and let be the symmetrised representative factor via the mean as in Eq. (2). Then,
Proof. A direct worst-case analysis requires some care. Although the extrema and are taken independently over the entire assignment space, the mean value is uniquely determined within each equivalence class . Consequently, the extremal configurations cannot always be chosen independently, and we therefore distinguish several cases.
First observe that for every equivalence class and all , Lemma 3 guarantees pairwise -equivalence and Lemma 1 implies and . Hence, the potentials within one equivalence class can be ordered as
where and . This directly affects the class-wise mean
which is constrained to vary only within a restricted range of values. Consider first the case where the assignments attaining the maximum and minimum originate from two different equivalence classes and with . In this situation, the worst-case deviations can be chosen independently.
For the maximum, the denominator should be as small as possible. Hence, choose for the denominator, while all remaining potentials in the same equivalence class attain their maximal admissible value for all to maximise the numerator. This yields
For the minimum, the denominator should instead be as large as possible. Thus, choose , while all remaining values in the same equivalence class attain their minimal admissible value for all . Consequently,
Observe, that is monotonically increasing in , whereas is monotonically decreasing in . Hence, the largest equivalence classes by group size produce the extremal deviations. To determine which class size appear in the outer quotient as the numerator and denominator, respectively, consider . Its derivative equals , which is non-positive for all . Therefore, for it follows:
Consequently, the sharpest bound is obtained by using for the maximum term and for the minimum term. If several equivalence classes with maximal group size exist, then simply .
It remains to analyse the case where both extrema originate from the same equivalence class. Since for all , we obtain
If the equivalence class contains only a single assignment, the quotient equals 1. Otherwise, holds, and the quotient is maximised by choosing
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
and . Hence, for we get
which establishes the bound in all cases.
Theorem 5. The bound given in Thm. 4 is optimal.
For the proof, consider the following example.
Example 3. Let be the FG with factors , of which with are -commutative with respect to disjoint argument sets with finite domains, respectively, each satisfying . Let be the set of disjoint representatives for all disjoint equivalence classes united to ordered by group size with for every -commutative factor with . Let have at least two deviating elements and within a group the same ranges. For define
Thus, the first equivalence class contains exactly one maximal value and otherwise minimal values, whereas the second class contains exactly one minimal value and otherwise maximal ones, following the same construction as in the proof of Lemma 4. All remaining parts are constant and therefore contribute no approximation error.
Proof of Thm. 5. We show that the construction from Ex. 3 attains the bound. Let denote the model obtained from by replacing every -commutative factor by the arithmetic mean as in Eq. (2). Notice that for and all , but also for and and implying . Consequently, all extremal deviation are attained exclusively within the first two equivalence classes. For , the definition results in
and for in
For the maximum becomes
and for it becomes
which is larger than the first one due to .
Analogously, for the minimal quotient inside this class reaches
which is as small as the following one for due to
Using Eq. (4) from the definition of the Chan-Darwiche distance leads to
Since the argument sets are pairwise disjoint, the extrema can be attained independently for every factor. Hence,
Thus, the bound of Thm. 4 is attained exactly and is therefore optimal. ☐
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller
A.1 Additional Result Symmetry Set
Proposition 2 (Cardinality of the Symmetry Set). Let and denote the indices of the commutative arguments. Further, let be the set of distinct values occurring among the commutative arguments, and let denote the multiplicity of value for a fixed assignment . Then the cardinality of the symmetry set is
with , where the upper bound is attained if and only if all commutative arguments have pairwise non- -equivalent values.
Proof. Since permutations in act only on the positions corresponding to -commutative arguments, it holds that .
If all values among the commutative arguments are pairwise distinct, every permutation produces a distinct tuple, and thus .
Now assume that some values coincide. For each distinct value , there are exactly positions among the commutative arguments whose assigned value equals . Permuting these positions among themselves does not change the resulting tuple. Hence, every distinct tuple in the symmetry set is generated exactly times by permutations in . Since there are ! permutations in total, the number of distinct tuples is
B Additional Experimental Results
In addition to the experimental results provided in Sec. 4, we provide further experimental results for individual scenarios in this section.
The averaged results in Fig. 2 aggregate over the number of -commutative factors and the tolerance . To disentangle the influence of these two parameters, Figs. 3 to 11 report the LVE run time and the per-query quotient separately for each combination of and . The run time behaviour is qualitatively consistent across all configurations: The run time of LVE on the -relaxed model stays almost constant in the domain size, whereas exact ACP—which must leave the -commutative factors uncompressed—slows down steeply, so the speedup grows exponentially with the domain size . The speedup is essentially independent of (given that the -deviation in the model is within the chosen -value used when running ACP, which is the case in our experiments), since the structure of the compressed model depends only on the commutativity pattern and not on the magnitude of , while it increases with the number of -commutative factors , as each additional compressed factor widens.

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 3: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 4: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .
the gap between the two models. At the same time, the per-query quotient remains tightly concentrated around the optimal value of one in every scenario. In line with the theoretical bound, increasing from 0.001 to 0.1 slightly widens the spread of the quotient, and increasing the number of -commutative factors admits a few more outliers, since each compressed factor potentially contributes to the overall deviation. Even for the largest tested and for the largest tested , however, the quotient stays well within the theoretical guarantee, confirming that the bound is loose in practice.
A plot showcasing the resulting speedup of online inference (averaged over all choices of k and ) is given in Fig. 12a. It becomes evident that the speedup grows exponentially with the domain size d and eventually reaches a factor of more than 30 for the choice of d = 20. Figure 12b further displays the offline run times of ACP and its -relaxed variant (averaged over all choices of k and ). As expected, the offline run time of the -relaxed variant does not surpass the offline run time of exact ACP, demonstrating that the relaxation does not introduce any
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 5: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 6: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .
overhead at all. In fact, -relaxed ACP even slightly reduces the run time compared to exact ACP, since -relaxed ACP is able to find -commutative factors and hence requires less iterations when searching for subsets of -commutative arguments (ACP needs more iterations as it checks all subsets of arguments until it is able to conclude that no subset of strictly commutative arguments exists).
Finally, we examine the structural reduction achieved by the compression stemming from exact ACP and its -relaxed variant. Figures 13 to 15 show the compression ratio between the compressed model and the original model for at the smallest and largest tolerance (that is, a compression ratio of one means that no compression is achieved at all, whereas a smaller ratio indicates more compression). The -relaxed variant attains a substantially smaller compression ratio than exact ACP, because it is able to compress the -commutative factors that exact ACP cannot compress. For both variants, the compression ratio decreases as the domain size grows, illustrating that larger models offer more indistinguishability to be exploited.

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 7: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 8: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .
Interestingly, as shown in Fig. 16, ACP is not able to obtain any compression at all for some of the input FGs: The input instances are generated from two different classes of FGs—employee and epidemic—which have different structural properties, and exact ACP is only able to achieve compression for the employee instance class, while it fails to achieve any compression for the epidemic instance class. This particular behaviour highlights that even if there is just a single -commutative factor in a given FG, exact ACP may fail to find any compression at all (although there are other parts in the input FG that could be compressed and that do not involve commutativity), which is due to the propagation of information throughout ACP's colour passing procedure.
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 9: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 10: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .

(a) LVE run time (ms).
(b) Query result quotient .
Fig. 11: (a) Run time of LVE on the compressed model returned by ACP and its -relaxed variant (ACP ), and (b) distribution of the per-query quotient between the approximate result and the exact result p for input FGs containing -commutative factors with .

(a) Speedup factor for LVE.
(b) Color passing run times.
Fig. 12: (a) Speedup for online inference run times (i.e., ratio of the run time of LVE on the compressed model returned by ACP and the run time of LVE on the compressed model returned by the -relaxed variant of ACP). (b) Offline run times of ACP and its -relaxed variant (ACP ).

(a) Compression ratio for .
(b) Compression ratio for .
Fig. 13: Compression ratio between the compressed model and the original model for input FGs containing -commutative factors with (a) and (b) .

(a) Compression ratio for .
(b) Compression ratio for .
Fig. 14: Compression ratio between the compressed model and the original model for input FGs containing -commutative factors with (a) and (b) .
M. Luttermann, J. Speller, T. Braun, M. Gehrke, R. Möller

(a) Compression ratio for .
(b) Compression ratio for .
Fig. 15: Compression ratio between the compressed model and the original model for input FGs containing -commutative factors with (a) and (b) .

(a) employee instance class.
(b) epidemic instance class.
Fig. 16: Compression ratio between the compressed model and the original model broken down per instance class, averaged over the number of commutative factors and the tolerance .