AI Glossary / Probabilistic machine learning / Intermediate
Forney factor graph
Definition
A Forney factor graph is a graphical representation of a factorized function in which nodes represent factors and edges represent variables. Also called a Forney-style or normal factor graph, it makes local computations and shared variables explicit. Equality-constraint nodes allow a variable used by several factors to be represented through linked copies.
What it means
Many probabilistic calculations start with a large function written as a product of smaller functions. A graph provides a visual description of which smaller functions depend on which variables. This structure can guide message passing, marginalization and efficient implementation without first expanding the whole joint table.
In an ordinary bipartite factor graph, there are separate variable nodes and factor nodes. In the Forney style, variables sit on edges and all nodes stand for functions or constraints. The change is a representation choice, not a new probability law. The mathematical meaning comes from the factors and the graph's stated conventions.
How it works
Create a node for each local factor and attach the variables on which it depends. An ordinary edge can connect two factors. A dangling edge, or half-edge, connects to one factor and can represent an external variable. If a variable appears in more than two factors, introduce copies and an equality factor enforcing that all copies have the same value.
For discrete variables, an equality factor is one for consistent assignments and zero for inconsistent ones. Summing over the extra copies recovers the original function. In a normal-factor-graph partition-function convention, internal edge variables are summed out, leaving a function of the external variables. Some Forney-style presentations emphasize the unsummed product first, so the intended scope of marginalization should be explicit.
Sum-product messages combine a node's factor with incoming information and sum over variables other than the outgoing one. On suitable trees this gives exact marginal calculations; loops generally require additional analysis or approximation.
Three practical examples
1. Communications: describe code constraints and channel evidence in a modular graph, then implement decoding calculations as messages. The diagram helps expose local dependencies but does not guarantee successful decoding in noise.
2. Sensor fusion: express transitions, measurement models and shared states as connected factors. Teams can review which measurements inform a state and where repeated use of evidence might occur.
3. Probabilistic software: build larger models from reusable factor components with explicit interfaces. A component's exposed variables and internal sums can be checked before it is connected to a larger inference system.
Think of it this way
Think of components joined by labeled cables, where each component applies a local rule and cable labels identify shared quantities. A branching connector can require several cables to carry the same value. The analogy concerns mathematical organization, not electrical behavior: an edge need not carry a physical signal, and a message may be an entire function over possible values.
Worked example
Let binary x appear in three factors a(x), b(x) and c(x). Set a(0) = 0.6, a(1) = 0.4; b(0) = 0.2, b(1) = 0.8; and c(0) = 0.5, c(1) = 0.9.
Introduce copies x_a, x_b and x_c with an equality factor that also connects to external x. Summing over the three copies eliminates every assignment except x_a = x_b = x_c = x. The resulting external function is therefore a(x)b(x)c(x), exactly as before.
For x = 0, the product is 0.6 × 0.2 × 0.5 = 0.06. For x = 1, it is 0.4 × 0.8 × 0.9 = 0.288. Their sum is 0.348, so the normalized probability of x = 1 is 0.288/0.348, approximately 0.8276.
If the equality constraint were omitted, the copies could vary independently and the calculation would describe a different model. The constraint preserves sharing; it does not supply three independent measurements of x. These stipulated numbers illustrate representation and normalization, not a real sensor result.
Illustrative case study
Fictional case: Rowan Instruments reviews a sensor-estimation model that several engineers maintain. A Forney-style diagram reveals where a shared calibration variable enters multiple factors. The team replaces ambiguous branching drawings with explicit equality nodes and documents which variables remain exposed at each component boundary.
It then checks a small discrete version against direct enumeration before scaling the implementation. The graph improves the team's ability to inspect the model, but it does not establish that its calibration assumptions are correct. This fictional example concerns model clarity and verification, not measured accuracy gains.
Common misconceptions and mistakes
An edge is a variable, not merely a dependency arrow. A node may be an equality or deterministic constraint, not only a probability table. Individual factors need not be normalized probabilities, although their product may require normalization to define a distribution.
Normal does not mean Gaussian. Adding equality nodes does not make independent copies of the underlying quantity. Nor does drawing a graph remove difficult integration or guarantee message convergence on loops. Two graph drawings may express the same function while leading to different computational schedules or numerical behavior.
Business use
For a business-facing technical review, ask the model owner to identify the observed quantities, unknown quantities and assumptions attached to each factor. Trace where each evidence source enters and verify that shared parameters are represented consistently.
Use small exact calculations to validate graph transformations and component interfaces. If inference is approximate, document that separately from the representation. A graph is most valuable when it helps teams explain and test the underlying model; an elaborate diagram alone is not evidence that a system's conclusions are reliable.
People also ask
Is this different from a standard factor graph?
The notation differs: variables appear on edges rather than as a separate class of nodes.
Why are equality nodes needed?
They allow several factors to share a variable while keeping each individual edge attached to at most two nodes.
Are all internal variables always summed out?
That is the explicit partition-function convention for normal factor graphs; the intended operation should be stated when reading a Forney-style diagram.
Check your understanding
What would go wrong if the worked example's variable copies were allowed to vary independently?
Answer: The factors would no longer refer to one shared binary quantity. Their product and subsequent sums would represent a different function.
Related terms
- Factor graph
- Marginalization
- Belief propagation
- Probabilistic Graphical Model
- normal factor graph
- sum-product algorithm
- equality constraint
- partition function
Learn next
Translate a small bipartite factor graph into Forney notation, then verify its external function by enumerating all assignments. Next follow a sum-product message through an equality node and a nontrivial factor.
More in Probabilistic machine learning
- Extended Kalman smoother - An extended Kalman smoother estimates past hidden states of a nonlinear dynamic system using observations collected both before and after those states.
- f-divergence - An f-divergence is a measure of difference between probability distributions generated by a chosen convex function f.
- Flow matching - Flow matching is a generative-model training framework that learns a time-dependent vector field for transporting a simple starting distribution toward a...
- Forward filtering backward sampling - Forward filtering backward sampling (FFBS) is a method for drawing complete hidden-state sequences from their posterior distribution given observed data.
- Forward-mode automatic differentiation - Forward-mode automatic differentiation computes derivatives by carrying derivative information alongside values as a program evaluates a function.
- Forward stagewise additive modeling - Forward stagewise additive modeling builds a predictive function by adding one fitted component at a time while leaving previously added components fixed.
Sources
Loeliger, An Introduction to Factor Graphs: https://www.isiweb.ee.ethz.ch/papers/arch/aloe-2004-spmagffg.pdf
Forney and Vontobel, Partition Functions of Normal Factor Graphs: https://arxiv.org/pdf/1102.0316
Independent review consulted Loeliger section 2 and Forney–Vontobel section II on equality copies and internal summation. Original example verified.
Previous: Formation matrix Next: Forward algorithm