betaFeedback

WorksEngineering

Extended Neighborhood Message Passing for Inference in Loopy Factor Graphs

Abstract

Belief propagation (BP) is widely used for inference on probabilistic graphical models but often suffers from non-convergence and poor accuracy on loopy factor graphs, yielding inexact variance estimates in the Gaussian case. Generalized BP (GBP) improves accuracy but relies on manual design or application-specific heuristics for region-graph construction. We propose extended neighborhood message passing (ENMP), which automatically constructs extended neighborhoods of variable nodes from the bipartite factor graph topology, capturing loop-induced correlations without manual region design. The framework applies to general distributions on factor graphs with a tunable accuracy-complexity trade-off. In the exact regime, message updates converge to the unique fixed point of the ENMP equations in finitely many iterations, yielding exact marginals; in the approximate regime, ENMP provides approximate marginals. For Gaussian factor graphs, we derive closed-form update rules enabling exact variance estimation in the exact regime, addressing the long-standing inaccurate variance estimates of loopy Gaussian BP. We evaluate ENMP on densely loopy Gaussian factor graphs from power-grid benchmarks and on a discrete Ising factor graph. Results show accuracy improves with neighborhood size, with exact marginals achieved on several systems in both settings. On larger Gaussian systems, ENMP outperforms regularized Gaussian BP (sGaBP-m) in both mean and variance estimation accuracy.

Introduction

Probabilistic graphical models (PGMs) provide a rigorous mathematical framework for representing statistical dependencies and performing inference under uncertainty in high-dimensional systems [1, 2]. They have found broad applications in state estimation [3, 4], Bayesian inference and learning [5, 6], and system identification [7, 8]. Among PGMs, factor graphs provide a natural representation of the factorization structure of a joint distribution by separating variable nodes from factor nodes, and support message-passing inference through the sum-product algorithm [9, 10]. Factor graphs have been successfully applied to a wide range of inference problems, including robot perception [11], cooperative localization [12], and multitarget tracking [13, 14, 15]. In this paper, we consider marginal inference on loopy factor graphs.

Inference on factor graphs with loops presents significant challenges. Message-passing algorithms, also known as belief propagation (BP) algorithms, effectively leverage local structural information [9]. While BP is theoretically guaranteed to be exact on tree-structured graphs, its performance on factor graphs with loops – often referred to as loopy BP (LBP) – is less reliable. LBP is not guaranteed to converge and may converge to inaccurate fixed points [16, 17, 18]. Meanwhile, for Gaussian variables, BP presents a long-standing challenge: it may fail to converge, and even when it does converge, it often yields inexact variances [19, 20]. These limitations stem from BP treating incoming messages as independent, an assumption that breaks down in the presence of loops, particularly short loops that introduce strong correlations among neighboring nodes [21].

Substantial efforts have been devoted to mitigating loop effects in probabilistic graphical model inference. Classical clustering methods [22 Sec. 4.4.1] address loops by grouping variables into clusters, so that loop-induced correlations are handled locally within each cluster and message passing is performed between clusters. This broad principle is further developed in region-based inference frameworks, most notably generalized belief propagation (GBP) [23, 24], where messages are passed between possibly overlapping regions in a region graph. For GBP, however, the marginal accuracy and computational cost depend on the selected region graph, while a generally optimal and fully automatic region-selection rule is still lacking, and effective region-graph construction typically relies on manual design or application-specific heuristics [25]. This limitation motivates inference schemes in which enlarged neighborhoods are constructed automatically from the topology of the factor graph, rather than from a manually designed region graph.

A different line of work, without manual region-graph construction, captures short-range loop-induced correlations by enlarging the local neighborhood of each node. Kirkley et al. [21] proposed a self-consistent message-passing framework for Ising models that defines larger neighborhoods to capture short-range correlations, improving accuracy over BP while eliminating the need for manual region decomposition. Building on [21], subsequent work [26] combines tensor networks with alternative neighborhood definitions to further refine approximation accuracy. However, the methods in [21, 26] are developed for discrete pairwise MRFs, and extending them to general bipartite factor graphs is non-trivial due to topological and functional differences. Specifically, these approaches rely on aggregating messages over a larger Markov blanket, which is naturally defined in MRFs where variables are directly connected. In contrast, factor graphs exhibit a strict bipartite structure in which variable nodes never interact directly but are conditionally linked solely through intermediate factor nodes. Mapping these MRF-based neighborhoods to a factor graph does not reflect the alternating variable–factor structure and therefore does not directly yield a message-passing formulation for general bipartite factor graphs, necessitating a distinct formulation of neighborhood expansion and the associated message-passing rules. Moreover, in contrast to the discrete pairwise MRFs considered in [21, 26], the factor graphs considered here may involve continuous variables. Although [21] establishes exactness under its bounded primitive-cycle condition, it does not establish that the message updates converge in a finite number of iterations, nor is this exactness result established for general bipartite factor graphs.

A separate line of work focuses on Gaussian graphical models, where accurate variance estimation poses a long-standing challenge. To improve the accuracy and convergence of Gaussian BP (GaBP) in loopy graphs, several variants of message-passing schemes have been developed, such as feedback message passing [27], and variance-improvement algorithms [20]. Notably, the regularized GaBP algorithm (sGaBP-m) [28, 29], designed for pairwise Markov graphs, employs a regularization parameter to guarantee convergence to the exact marginal means. While sGaBP-m yields exact means upon convergence with sufficient regularization, selecting the regularization parameter remains a heuristic process, and the estimated variances are still approximate without guarantees. Furthermore, the framework of sGaBP-m is tailored for pairwise Markov graphs and may not generalize directly to generic factor graphs [29].

In summary, prior approaches face different limitations. Region-based methods such as GBP depend on the selected region graph, the effective construction of which remains problem-dependent and typically relies on manual design or application-specific heuristics; the neighborhood-expansion method in [21] is formulated for discrete pairwise MRFs and does not directly cover general bipartite factor graphs with continuous variables; and Gaussian-specific variants, such as GaBP and sGaBP-m, still cannot guarantee accurate variance estimates. These limitations motivate the present work, particularly for factor graphs with short loops.

In response, we propose the extended neighborhood message passing (ENMP) method for inference on loopy factor graphs. Unlike region-based methods such as GBP, for which effective region-graph construction remains problem-dependent and typically relies on manual design or application-specific heuristics, ENMP automatically constructs an extended neighborhood directly from the bipartite factor-graph topology to capture loop-induced correlations. A single tunable parameter controls the size of this neighborhood, trading off inference accuracy against computational complexity. We formulate general message-passing update rules for factorized probability models and further specialize them to Gaussian factor graphs, deriving closed-form updates in canonical parameters. We analyze ENMP under two inference regimes. In the exact regime, where the extended neighborhoods are large enough to fully capture the loop-induced correlations in the factor graph, the ENMP message updates converge to a unique fixed point in a finite number of iterations and yield the exact marginals; such exactness and convergence within a finite number of iterations are not established for general bipartite factor graphs in [21]. For Gaussian factor graphs in particular, the exact regime yields not only exact marginal means but also exact marginal variances, addressing the well-known variance inaccuracy of loopy GaBP in this regime [19]. In the approximate regime, ENMP provides approximate marginals. The main contributions of this work are summarized as follows:

  • We propose ENMP, a message-passing framework that automatically constructs extended neighborhoods from the bipartite factor-graph topology to capture loop-induced correlations, without requiring the manual design or application-specific heuristics typically used for region-graph construction in GBP [23, 25]. A single tunable parameter controls

the neighborhood size, providing a tradeoff between inference accuracy and computational complexity. The framework applies to both discrete and continuous variables and admits closed-form updates for Gaussian factor graphs.

  • We show that, in the exact regime, the ENMP message updates converge to a unique fixed point in finitely many iterations, yielding exact marginal beliefs; for Gaussian factor graphs, both the marginal means and variances are exact. In the approximate regime, ENMP provides approximate marginals.

  • We evaluate ENMP on Gaussian factor graphs arising from power-system state estimation over standard IEEE bus test cases, and on a discrete Ising factor graph. The results show that the inference accuracy of ENMP generally improves as the size of the extended neighborhoods increases, and that the method achieves exact marginal inference on several systems in both settings. On the larger Gaussian systems, ENMP also outperforms the tested sGaBP-m configurations in both mean and variance estimation accuracy, while the Ising experiments confirm its applicability to discrete factor graphs.

The remainder of this article is organized as follows. § 2 formulates the inference problem on factor graphs. § 3 introduces the ENMP framework, including the automated construction of extended neighborhoods and the resulting message-passing update rules for general and Gaussian distributions. § 4 evaluates ENMP against the tested baselines on Gaussian power-system state estimation benchmarks and on discrete Ising factor graphs. Finally, § 5 concludes the article.

Modeling and Problem Formulation

Consider a joint probability distribution function (PDF) or a probability mass function (PMF) P(x)P(\mathbf{x}) of a random vector x=[x1,x2,…,xnx]T\mathbf{x} = [x_1, x_2, \ldots, x_{n_x}]^\mathsf{T}, where the variables can be either continuous or discrete. Let G=(X,F,E)\mathcal{G} = (\mathcal{X}, \mathcal{F}, \mathcal{E}) be the corresponding factor graph of P(x)P(\mathbf{x}). Here, X={x1,x2,…,xnx}\mathcal{X} = \{x_1, x_2, \ldots, x_{n_x}\} and F={f1,f2,…,fnf}\mathcal{F} = \{f_1, f_2, \ldots, f_{n_f}\} denote the sets of variable nodes and factor nodes, respectively, where nx=∣X∣n_x = |\mathcal{X}| and nf=∣F∣n_f = |\mathcal{F}|; E\mathcal{E} is the set of edges connecting variable nodes and factor nodes.

Each factor node fa∈Ff_a \in\mathcal{F} represents a local function that depends only on a subset of variables xa⊆X\mathbf{x}_a \subseteq\mathcal{X}, i.e., the variable nodes connected to faf_a. Given these definitions, P(x)P(\mathbf{x}) can be decomposed as,

P(x)=1Zψ(x)=1Z∏fa∈Ffa(xa),(1)P(\mathbf{x}) = \frac{1}{Z}\psi(\mathbf{x}) = \frac{1}{Z}\prod_{f_a\in\mathcal{F}} f_a(\mathbf{x}_a), \tag*{(1)}

where ZZ is the partition function.

We aim to infer the marginal PDF of a specific variable xix_i (i=1,2,…,nxi = 1, 2, \ldots, n_x), which can be written as,

P(xi)=∫P(x) dxi=∫1Z∏fa∈Ffa(xa) dxi,(2)P(x_i) = \int P(\mathbf{x})\,d\mathbf{x}^{i} = \int\frac{1}{Z}\prod_{f_a\in\mathcal{F}} f_a(\mathbf{x}_a)\,d\mathbf{x}^{i}, \tag*{(2)}

where xi\mathbf{x}^{i} denotes the vector x\mathbf{x} excluding the component xix_i.

Direct computation of the marginalization in (2) involves high-dimensional integration (or summation), which is generally computationally intractable for large-scale graphs. BP [9] avoids this global marginalization by iteratively passing local messages mi→a(xi)m_{i\to a}(x_i) and ma→i(xi)m_{a\to i}(x_i) between variable node xix_i and factor node faf_a along each edge. The BP updates and the resulting belief bi(xi)b_i(x_i) of xix_i are given by

mi→a(xi)∝∏fb∈Nxi∖{fa}mb→i(xi),m_{i\to a}(x_i) \propto\prod_{f_b\in\mathcal{N}_{x_i}\setminus\{f_a\}} m_{b\to i}(x_i),
ma→i(xi)∝∫fa(xa)∏xj∈Nfa∖{xi}mj→a(xj) dxa∖i,m_{a\to i}(x_i) \propto\int f_a(\mathbf{x}_a)\prod_{x_j\in\mathcal{N}_{f_a}\setminus\{x_i\}}m_{j\to a}(x_j)\,d\mathbf{x}_{a\setminus i},
bi(xi)∝∏fa∈Nxima→i(xi).b_i(x_i) \propto\prod_{f_a\in\mathcal{N}_{x_i}}m_{a\to i}(x_i).

where Nv\mathcal{N}_v denotes the set of immediate neighbors of node vv, and xa∖i\mathbf{x}_{a\setminus i} denotes xa\mathbf{x}_a excluding xix_i.

BP performs exact inference on trees but struggles in loopy graphs because it treats incoming messages as independent. This assumption breaks down in the presence of short loops, which introduce strong correlations and cause message feedback. Consequently, BP often fails to distinguish new information from recirculated beliefs, leading to oscillation and inaccurate variance estimates [20, 21]. To overcome these challenges and achieve accurate inference in such densely loopy factor graphs, we propose the ENMP method in the following section.

The ENMP Method

In this section, we propose the ENMP method for inference in loopy factor graphs and establish its update rules for both general and Gaussian distributions.

Extended neighborhood modeling

Inspired by [21], we propose an extended neighborhood for each variable node to account for loop-induced correlations among larger groups of neighboring nodes. Different from [21], which defines larger neighborhoods over MRFs where variables interact directly, our formulation is tailored to the bipartite topology of factor graphs and applies to both discrete and continuous variable domains. Specifically, if a variable node xix_i and its neighborhood nodes are contained in a loop of length less than a given value, then all other nodes within this loop are considered as extended neighbors.

To formalize these concepts, we introduce the following definitions of walks, paths, and loops. For two nodes uu and vv in G\mathcal{G}, a walk from uu to vv is a node sequence w=(v0,v1,…,vℓ)w=(v_0,v_1,\ldots,v_\ell) such that v0=uv_0=u, vℓ=vv_\ell=v, and vk−1v_{k-1} and vkv_k are adjacent in G\mathcal{G} for every k=1,2,…,ℓk=1,2,\ldots,\ell. The length of ww is defined as ℓ(w)=ℓ\ell(w)=\ell. A path from uu to vv is a walk p=(v0,v1,…,vℓ)p=(v_0,v_1,\ldots,v_\ell) in which the nodes v0,v1,…,vℓv_0,v_1,\ldots,v_\ell are pairwise distinct. Let Path⁡(u,v)\operatorname{Path}(u,v) denote the set of all such paths from uu to vv in G\mathcal{G}. More generally, for a subgraph H\mathcal{H} of G\mathcal{G} and two nodes uu and vv in H\mathcal{H}, Path⁡H(u,v)\operatorname{Path}_{\mathcal{H}}(u,v) denotes the set of all paths from uu to vv in H\mathcal{H}. For a path p=(v0,v1,…,vℓ)p=(v_0,v_1,\ldots,v_\ell), its length is ℓ(p)=ℓ\ell(p)=\ell. A loop in G\mathcal{G} is a closed walk C=(v0,v1,…,vℓ)C=(v_0,v_1,\ldots,v_\ell) with ℓ≥3\ell\ge3 such that vℓ=v0v_\ell=v_0 and the nodes v0,v1,…,vℓ−1v_0,v_1,\ldots,v_{\ell-1} are pairwise distinct. Its length is ∣C∣=ℓ\lvert C\rvert=\ell.

For any node set S⊆X∪F\mathcal{S}\subseteq\mathcal{X}\cup\mathcal{F}, let G[S]\mathcal{G}[\mathcal{S}] denote the subgraph of G\mathcal{G} that retains the node set S\mathcal{S} together with all edges of G\mathcal{G} connecting any two nodes in S\mathcal{S}. For a subgraph H\mathcal{H}, a walk ww, a path pp, and a loop CC, let V(H)V(\mathcal{H}), V(w)V(w), V(p)V(p), and V(C)V(C) denote their corresponding node sets. The length of the longest loop in G\mathcal{G} is denoted by Lmax⁡\mathcal{L}_{\max}.

To formulate ENMP on a bipartite factor graph, we introduce three types of neighborhoods: the preliminary rr-neighborhood, the extended rr-neighborhood, and the residual rr-neighborhood. Their formal definitions are given below.

References

  1. [1]Daphne Koller and Nir Friedman. Probabilistic graphical models: Principles and techniques. MIT Press, 2009.
  2. [2]Pedro Larrañaga and Serafín Moral. Probabilistic graphical models in artificial intelligence. Appl. Soft Comput., 11(2):1511–1528, 2011.
  3. [3]Fabio Pasqualetti, Ruggero Carli, and Francesco Bullo. Distributed estimation via iterative projections with application to power network monitoring. Automatica, 48(5):747–758, 2012.arxiv.org/abs/1103.0579
  4. [4]Damián Edgardo Marelli and Minyue Fu. Distributed weighted least-squares estimation with fast convergence for large-scale systems. Automatica, 51:27–39, 2015.pubmed.ncbi.nlm.nih.gov/25641976
  5. [5]Mattia Zorzi. Autoregressive identification of kronecker graphical models. Automatica, 119:109053, 2020.arxiv.org/abs/2004.14199
  6. [6]Karl Berntorp. Online bayesian inference and learning of gaussian-process state-space models. Automatica, 129:109613, 2021.
  7. [7]Hongpeng Zhou, Chahine Ibrahim, Wei Xing Zheng, and Wei Pan. Sparse bayesian deep learning for dynamic system identification. Automatica, 144:110489, 2022.arxiv.org/abs/2107.12910
  8. [8]Pietro Boni, Mirko Mazzoleni, Matteo Scandella, and Fabio Previati. A graph learning approach for kernel-based system identification with manifold regularization. J. Franklin Inst., 362(12):107793, 2025.
  9. [9]F.R. Kschischang, B.J. Frey, and H.-A. Loeliger. Factor graphs and the sum-product algorithm. IEEE Trans. Inf. Theory, 47(2):498–519, 2001.DOI
  10. [10]H.-A. Loeliger. An introduction to factor graphs. IEEE Signal Process. Mag., 21(1):28–41, 2004.DOI
  11. [11]Frank Dellaert and Michael Kaess. Factor graphs for robot perception. Found. Trends Robot., 6(1–2):1–139, 2017.
  12. [12]Henk Wymeersch, Jaime Lien, and Moe Z. Win. Cooperative localization in wireless networks. Proc. IEEE, 97(2):427–450, 2009.
  13. [13]Hua Lan, Zengfu Wang, Xianglong Bai, Quan Pan, and Kun Lu. Measurement-level target tracking fusion for over-the-horizon radar network using message passing. IEEE Trans. Aerosp. Electron. Syst., 57(3):1600–1623, 2021.DOI
  14. [14]Xianglong Bai, Hua Lan, Zengfu Wang, Quan Pan, Yuhang Hao, and Can Li. Robust multitarget tracking in interference environments: A message-passing approach. IEEE Trans. Aerosp. Electron. Syst., 60(1):360–386, 2024.
  15. [15]Zengfu Wang, Dengliang Qi, Haotian Meng, and Hua Lan. Message passing-based distributed track-level fusion tracking for space-based radar networks with time-varying topology. IEEE Trans. Aerosp. Electron. Syst., 61(2):2149–2167, 2025.
  16. [16]Kevin P. Murphy, Yair Weiss, and Michael I. Jordan. Loopy belief propagation for approximate inference: An empirical study. In Proc. 15th Conf. Uncertainty Artif. Intell., pages 467–475, San Francisco, CA, USA, 1999. Morgan Kaufmann Publishers Inc.
  17. [17]Yair Weiss. Correctness of local probability propagation in graphical models with loops. Neural Comput., 12(1):1–41, 2000.
  18. [18]Alexander T Ihler, John W Fisher III, Alan S Willsky, and David Maxwell Chickering. Loopy belief propagation: Convergence and effects of message errors. J. Mach. Learn. Res., 6:905–936, 2005.
  19. [19]Yair Weiss and William T. Freeman. Correctness of belief propagation in Gaussian graphical models of arbitrary topology. Neural Comput., 13(10):2173–2200, 2001.
  20. [20]Qinliang Su and Yik-Chung Wu. Distributed estimation of variance in Gaussian graphical model via belief propagation: Accuracy analysis and improvement. IEEE Trans. Signal Process., 63(23):6258–6271, 2015.DOI
  21. [21]Alec Kirkley, George T. Cantwell, and M. E. J. Newman. Belief propagation for networks with loops. Sci. Adv., 7(17):eabf1211, 2021.DOI
  22. [22]Judea Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, San Mateo, CA, 1988.
  23. [23]Jonathan S. Yedidia, William T. Freeman, and Yair Weiss. Generalized belief propagation. In Proc. 13th Int. Conf. Neural Inf. Process. Syst., pages 668–674. MIT Press, 2000.
  24. [24]J.S. Yedidia, W.T. Freeman, and Y. Weiss. Constructing free-energy approximations and generalized belief propagation algorithms. IEEE Trans. Inf. Theory, 51(7):2282–2312, 2005.DOI
  25. [25]Max Welling. On the choice of regions for generalized belief propagation. In Proc. 20th Conf. Uncertainty Artif. Intell., UAI ’04, pages 585–592. AUAI Press, 2004.
  26. [26]Yijia Wang, Yuwen Ebony Zhang, Feng Pan, and Pan Zhang. Tensor network message passing. Phys. Rev. Lett., 132(11):117401, Mar 2024.DOI
  27. [27]Ying Liu, Venkat Chandrasekaran, Animashree Anandakumar, and Alan S. Willsky. Feedback message passing for inference in Gaussian graphical models. IEEE Trans. Signal Process., 60(8):4135–4150, 2012.
  28. [28]Francois Kamper, Sarel J. Steel, and Johan A. du Preez. On the convergence of Gaussian belief propagation with nodes of arbitrary size. J. Mach. Learn. Res., 20(165):1–37, 2019.
  29. [29]Francois Kamper, Sarel J. Steel, and Johan A. du Preez. Regularized Gaussian belief propagation with nodes of arbitrary size. J. Mach. Learn. Res., 21(101):1–42, 2020.
  30. [30]Robert Tarjan. Depth-first search and linear graph algorithms. SIAM J. Comput., 1(2):146–160, 1972.
  31. [31]Peter E. Hart, Nils J. Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE Trans. Syst. Sci. Cybern., 4(2):100–107, 1968.DOI
  32. [32]Michael Evans and Tim Swartz. Methods for approximating integrals in statistics with special emphasis on Bayesian integration problems. Stat. Sci., pages 254–272, 1995.DOI
  33. [33]Diane Valérie Ouellette. Schur complements and statistics. Linear Algebra Appl., 36:187–295, 1981.
  34. [34]Ruben V Pulgar, Luiz A Zanetta, and Jose C Vieira. Fast real-time DC state estimation in electric power systems using belief propagation. IEEE Trans. Smart Grid, 9(4):3737–3745, 2018.
  35. [35]Phani Chavali and Arye Nehorai. Distributed power system state estimation using factor graphs. IEEE Trans. Signal Process., 63(11):2864–2876, 2015.DOI
  36. [36]Ray Daniel Zimmerman, Carlos Edmundo Murillo-Sánchez, and Robert John Thomas. MATPOWER: Steady-state operations, planning, and analysis tools for power systems research and education. IEEE Trans. Power Syst., 26(1):12–19, 2011.DOI
  37. [37]George Karypis and Vipin Kumar. A fast and high quality multilevel scheme for partitioning irregular graphs. SIAM J. Sci. Comput., 20(1):359–392, 1998.DOI
  38. [38]S. L. Lauritzen and D. J. Spiegelhalter. Local computations with probabilities on graphical structures and their application to expert systems. J. R. Stat. Soc. Ser. B Methodol., 50(2):157–224, 1988.DOI

Paper details

vlnc:W_6wseayca
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Engineering

Not recorded for this paper

View statement
Looking for related papers…
Contents