AI Glossary / Graphs and symbolic AI / Advanced
Unrolling
Definition
Unrolling a dynamic Bayesian network means expanding its temporal template into an ordinary Bayesian network for a specified sequence of time steps. Each time-indexed variable receives its own node, with dependencies and conditional distributions copied or assigned according to the temporal model. This exposes the joint probability structure across the chosen horizon.
What it means
A dynamic Bayesian network can describe repeated relationships compactly: a machine's current condition depends on its previous condition, and a sensor reading depends on the current condition. Unrolling makes the separate conditions and readings at each time explicit.
The copied nodes represent different random variables, not repeated displays of one unchanged value. Condition at time 1 can differ from condition at time 2 even when both use the same transition model. This entry follows the supplied glossary's Bayesian-network sense, which differs from compiler loop unrolling and unrolled neural-network architectures.
How it works
Start with an initial-state distribution and a temporal dependency template. Create the required time-indexed nodes and connect them according to the model's within-slice and across-time relationships. Attach the appropriate conditional distributions and place each observation at its matching time.
For a simple first-order model with hidden state X and observation E, the joint distribution factors as P(X0) multiplied by P(Xt|Xt−1)P(Et|Xt) for each observed step t. Reusing transition and observation parameters across steps expresses a time-homogeneous model; it does not assert that state values remain constant.
The expanded network can be used with standard inference methods. However, explicitly rebuilding and solving the entire history is not always necessary. Recursive filtering can summarize the past in a current belief state, while other algorithms exploit temporal structure directly. Computational difficulty depends on dependencies, state sizes, and the query, not just the number of visible nodes.
Three practical examples
- A maintenance analyst expands a two-step machine-condition model to inspect whether each sensor reading is connected to the correct time's hidden condition.
- A tracking application represents successive positions and observations as separate nodes. Unrolling helps explain how earlier evidence influences estimates later in the sequence.
- A process-monitoring team inspects a short temporal model before deploying longer-horizon inference. It checks initial conditions, time lags, and shared parameters on the expanded graph.
Think of it this way
A temporal template is like instructions for adding the next frame to a storyboard. Unrolling lays out the required frames side by side, including the links between them. The instructions can repeat even though the events depicted in each frame differ.
Worked example
Consider a fictional machine with a binary fault state Ft and a binary alert At. Set P(F0=true)=0.2. At each step, a fault persists with probability 0.8, while a previously nonfaulty machine becomes faulty with probability 0.1. An alert occurs with probability 0.9 when faulty and 0.2 when not faulty.
Unroll for observations at times 1 and 2. The graph has five nodes: F0, F1, F2, A1, and A2. Its four arrows are F0→F1, F1→F2, F1→A1, and F2→A2. There is no observation at time 0 in this example.
Observe A1=true and A2=false. Before the first observation, P(F1=true)=0.2×0.8+0.8×0.1=0.24. Updating with the alert gives 0.24×0.9 divided by (0.24×0.9+0.76×0.2), or 27/46, approximately 0.587.
Predicting to time 2 gives 0.8×(27/46)+0.1×(19/46)=47/92. The absent alert then gives a fault probability of (47/92×0.1) divided by (47/92×0.1+45/92×0.8)=47/407, approximately 0.1155.
An independent calculation sums the joint probabilities of the eight possible hidden-state histories. The evidence probability is 0.1628, and the probability of that evidence together with F2=true is 0.0188; their ratio is again 47/407. Agreement checks the unrolled factorization against recursive filtering. It does not establish that the fictional parameters fit any actual machine.
Illustrative case study
A fictional equipment team receives one sensor summary per minute. Its temporal model estimates an unobserved operating condition and uses the next minute's observation to update that estimate. During review, analysts unroll a short sequence and discover that one reading has been attached to the preceding minute's state.
They correct the alignment and compare explicit enumeration with their filtering calculation on a small case. They also check whether missing readings are treated as absent evidence or incorrectly encoded as negative readings. These meanings produce different likelihoods.
For long sequences, the team chooses an inference approach that uses the temporal structure rather than assuming it must retain every expanded node in memory. This case illustrates model inspection and validation, not a claim about a real monitoring system's accuracy or operating savings.
Common misconceptions and mistakes
Unrolling does not learn transition probabilities. It expands a model whose structure and distributions must already be specified or estimated elsewhere.
Replicated variables are not independent copies. Their arrows and conditional distributions encode dependencies across and within time slices.
A temporal feedback relationship can remain acyclic after time indices are made explicit. An influence from X at one time to X at the next is not a same-node directed cycle.
A missing observation is not automatically a false observation. It usually leaves that observation unconditioned unless the missingness process is itself modeled.
Business use
Unrolling is useful for explaining and checking temporal models used in operations, tracking, and monitoring. Review the meaning of a time step, the alignment of evidence, the initial distribution, and whether repeated parameters remain appropriate over the modeled period. Use short expanded cases for verification, then assess inference cost on the actual horizon and dependency structure. A clear diagram supports review but does not validate the model's assumptions by itself.
People also ask
Does unrolling make the process static?
It creates a static graph whose distinct nodes still represent different times.
Must inference explicitly unroll the whole history?
No. Algorithms and software can exploit a compact temporal representation.
Are repeated probability tables always identical?
Only when the model specifies shared parameters; time-varying models can use different distributions.
Check your understanding
Why are F1 and F2 separate nodes?
Answer: They represent the machine's condition at different times.
How many hidden histories are enumerated in the example?
Answer: Eight, from three binary hidden-state variables.
Why does the second observation lower the fault estimate?
Answer: Under the model, no alert is more likely when the machine is not faulty.
Related terms
- Dynamic Bayesian network
- Hidden Markov model
- Filtering
- Smoothing
- Transition model
- Variable elimination
- time slice
- observation model
Learn next
Compare filtering, prediction, and smoothing queries on the same short unrolled network. Then inspect how eliminating past variables can preserve the information needed for a current-state query.
More in Graphs and symbolic AI
- Type signature - A type signature specifies the types of inputs and outputs associated with a function or operation.
- UCB1 - UCB1 is a multi-armed bandit algorithm that selects an action using its average observed reward plus an exploration bonus.
- UCT - UCT is a method for guiding Monte Carlo tree search by applying upper-confidence-bound ideas at decision nodes.
- Łukasiewicz logic - Łukasiewicz logic is a family of many-valued logics associated with Jan Łukasiewicz.
- Unary constraint - A unary constraint is a rule that restricts the allowed values of one variable in a constraint satisfaction problem.
- Unbounded cost search - Unbounded-cost search seeks a valid solution without requiring its cost to fall below a specified threshold or within a specified factor of the best...
Sources
Russell and Norvig, AIMA temporal probability model slides, dynamic Bayesian networks and exact inference: https://aima.cs.berkeley.edu/4th-ed/slides-pdf/chapter15a.pdf Bayes Server, Introduction to Dynamic Bayesian Networks, unrolling and temporal evidence: https://www.bayesserver.com/docs/introduction/dynamic-bayesian-networks/ AIMA glossary, unrolling: https://github.com/aimacode/aima-glossary
Previous: Unobserved heterogeneity in duration models Next: Unscented Kalman filter