AI Glossary / Statistics and probability / Advanced
Markov logic network
Definition
A Markov logic network, or MLN, combines first-order logical formulas with numerical weights to define a probabilistic model over relationships and attributes. Given a finite set of domain objects, the formulas generate features in a ground Markov network. Positive weights favor worlds satisfying their associated formulas, while finite weights allow exceptions. The result supports reasoning with uncertain or imperfect relational knowledge instead of requiring every rule to hold without exception.
What it means
A logical formula can express a reusable pattern, such as a relationship between an item's documented status and its eligibility for review. Substituting actual objects for variables creates ground formulas. Their truth values contribute to the probabilities of complete assignments, often called possible worlds.
The weights are not directly the probabilities that individual rules are true. Each rule interacts with other rules, evidence, and the number of relevant groundings. MLNs therefore combine the compactness of relational rules with the dependence structure of an undirected probabilistic graphical model.
How it works
Define predicates, domain objects, and weighted formulas. Ground the predicates and formulas for that domain, conceptually creating binary variables and associated features. For a world x, a common definition is P(x) = exp(sum over i of w_i n_i(x))/Z, where n_i(x) counts true groundings of formula i and Z normalizes over possible worlds.
Condition on known evidence to answer probabilistic queries, or seek a most probable joint assignment for unknown facts. Weights can be specified or learned from relational data. Practical systems often rely on approximate inference because full grounding and exact probability calculations can be computationally demanding.
Decide explicitly which constraints are soft and which are genuinely hard. Domain definitions, evidence treatment, and assumptions about unknown facts affect the model. Adding more objects can change the number of groundings and therefore the influence of a rule, so behavior should be checked when the domain changes.
Three practical examples
- A knowledge-base project combines several imperfect clues when deciding whether records refer to the same organization.
- A document-processing system uses relational rules to jointly infer entity types and links between extracted entities.
- A product-information system models uncertain compatibility relationships while incorporating verified facts and selected hard constraints.
Think of it this way
Think of a panel of advisers, each offering a rule of thumb with a different influence. A proposed explanation receives support from the rules it satisfies, but no ordinary adviser has an absolute veto. The complete pattern of agreement matters. An MLN formalizes such combined preferences over possible worlds, rather than taking a simple vote over isolated claims.
Worked example
Consider an original one-object MLN with two binary predicates: A means a record is verified, and B means it is approved. Include the formula A implies B with weight ln(3), and the formula A with weight ln(2). This tiny example uses no other formulas or evidence.
The four possible worlds are (A,B) = (0,0), (0,1), (1,0), and (1,1). Their unnormalized scores are respectively 3, 3, 2, and 6. When A is false, the implication is true; when A is true and B false, only the formula A is satisfied; when both are true, both factors apply.
The normalizing constant is Z = 3 + 3 + 2 + 6 = 14. Thus P(B = 1) = (3 + 6)/14 = 9/14, approximately 0.643. Conditional on A = 1, P(B = 1 given A = 1) = 6/(2 + 6) = 0.75.
The implication's weight ln(3), approximately 1.099, is plainly not a probability. In this deliberately isolated conditional comparison, it yields odds of three to one. Additional formulas involving B could change the conditional probability. This example describes a probability model, not a safe approval policy.
Illustrative case study
Fictional case: RecordWillow links supplier records from several systems. Exact identifier matches provide strong evidence, while similar names and shared addresses provide weaker clues. The team expresses relationships among these clues using weighted formulas and evaluates the inferred links against independently checked examples.
Some suppliers share an office address without being the same entity, so the address rule remains soft. The analysts inspect false merges, calibration, and behavior when many related records arrive together. Human review remains part of the workflow for consequential merges. The case illustrates how relational consistency can help without making imperfect evidence infallible.
Common misconceptions and mistakes
An MLN is not a Markov chain merely because the names share Markov. It defines a joint distribution through an undirected network; a time-evolving transition process is a different construction.
A logical implication in an MLN does not automatically encode a causal relationship. Finite weights allow exceptions, and contradictory soft rules need not make all worlds impossible. However, inconsistent hard constraints can invalidate the model. Unknown facts are not automatically false unless an explicit evidence or modeling convention makes them so. Finally, readable formulas do not guarantee calibrated probabilities or cheap inference.
Business use
Businesses can consider MLNs when decisions depend on several related entities and when reusable relational rules contain useful but imperfect knowledge. Potential applications include record linkage, knowledge-base completion, and structured information extraction.
Assess the approach against simpler baselines and the available computational budget. Keep a record of predicate meanings, formula changes, weight estimation, evidence sources, and validation results. A model that performs well on one domain size or relation density may behave differently elsewhere because grounding counts and dependencies change. Evaluate both individual predictions and the quality of complete relational structures.
People also ask
Are weights restricted to the range zero to one?
No. They are real-valued parameters in a log-linear model, not direct probabilities.
Can a rule have exceptions?
Yes, when it is represented as a finite-weight soft formula.
Is the most probable assignment the same as individual marginal predictions?
No. Joint optimization and separate marginal probability queries answer different questions.
Check your understanding
In the worked example, why does the world A = 0, B = 0 receive a factor of three from the implication?
Answer: Material implication A implies B is true whenever A is false. The model rewards formula truth, so that world satisfies the implication even though neither predicate is true.
Related terms
- First-order logic
- Markov random field
- Grounding
- Possible world
- Statistical relational learning
- Probabilistic inference
- partition function
- soft constraint
Learn next
Review material implication and undirected graphical models, then compare marginal inference with maximum a posteriori inference. Study how grounding size and approximate inference affect practical MLN implementations.
More in Statistics and probability
- Marginal probability - A marginal probability is the probability of an event or variable value without restricting other variables in a joint probability model to particular values.
- Marginal structural model - A marginal structural model is a model for features of the distribution of potential outcomes under specified interventions or treatment histories.
- Marginal totals - Marginal totals are the sums for the categories of one variable after adding across the categories of another variable in a table.
- Masking - Masking, in comparative-study design, means keeping specified people unaware of which intervention, condition, or treatment a participant receives.
- Master sample - A master sample is a sample selected for use on multiple future survey occasions, rather than drawing a completely new sample independently for every inquiry.
- Matched samples - Matched samples are samples whose observations have a meaningful correspondence across conditions or groups.
Sources
Richardson and Domingos, "Markov Logic Networks," original paper and mathematical definition: https://homes.cs.washington.edu/~pedrod/papers/mlj05.pdf
The two-predicate example is original and all four worlds were independently enumerated. RecordWillow is fictional; no operational approval or identity-resolution accuracy is claimed.
Previous: Markov localization Next: Markov network