You do not need all of the paper's mathematics to follow LoopWM. These equation groups cover every formal mechanism used by the visuals and controls below.
Equation 3 · one world-model step
Encode, update the hidden world, then decode
ek = ℰϕ(ok), uk = 𝒜ψ(ak), hk = ℒθ(hk−1, ek, uk),
(ôk+1, r̂k, ĉk) = 𝒟ξ(hk).
Read it as: compress what the agent sees and does, update the internal world state, then predict the next observation, reward, and whether the episode continues.
ok, ak
Current observation and action
ek, uk
Encoded observation and action
hk−1
Internal world state from the previous environment step
hk
Updated internal world state
ô, r̂, ĉ
Predicted observation, reward, continuation
ℰϕ
Calligraphic observation encoder; ϕ denotes its learned parameters
𝒜ψ
Calligraphic action embedder; ψ denotes its learned parameters
ℒθ
Calligraphic looped dynamics function; θ denotes its learned parameters
𝒟ξ
Calligraphic prediction decoder; ξ denotes its learned parameters
k, k+1
Current and next environment-step indices
=
Defines each encoded, updated, or predicted value
( ), comma
Function arguments and their separator
hat accent
Marks a model prediction rather than an observed value
terminal period
Ends Equation 3 in the source
Door example: ok says the door is closed, ak says “open door,” and hk−1 carries prior room context; the outputs predict the next scene, reward, and continuation.
Visual link: the mechanism diagram uses blue for ℰϕ, purple for 𝒜ψ, gold for the repeated dynamics block inside ℒθ, and the final prediction-head box for 𝒟ξ.
Source: Section 3.1, Equation 3.
Equation 4 · prepare the joint input
Combine prior state, observation embedding, and action embedding
e = LN(𝒫([hk−1; ek; uk])) ∈ ℝd,
Read it as: concatenate three simultaneous inputs, process them with the prelude, then normalize the resulting conditioning signal.
e
Conditioning signal used by the repeated update
LN( )
Layer normalization rescales the projected components to a stable, normalized range
𝒫
Calligraphic prelude block
hk−1
Latent state from the preceding environment step
ek
Current observation embedding
uk
Current action embedding
k, k−1
Current and preceding environment-step indices
[ ; ; ]
Concatenation of the three joint inputs
ℝd
d-dimensional real-valued space
d
Width of the conditioning signal
=, ∈
Equality and set membership
( )
Function argument grouping
terminal comma
Ends Equation 4 before the source continues
Door example: prior room memory, the current closed-door observation embedding, and the “open door” action embedding converge as joint inputs to one prepared signal.
Visual link: the mechanism diagram draws three separate arrows into Prelude 𝒫; none of the inputs is caused by another.
Source: Section 3.2, Equation 4.
Equation 5 · the shared inner loop
Refine the same hidden state repeatedly
h(t+1) = Āh(t) + B̄e + ℛ̄(h(t), e),
Read it as: keep some previous state, inject the current conditioning signal, and add a nonlinear transformer refinement. Apply the same learned ℛ̄ at every inner iteration.
h(t)
State before refinement t
h(t+1)
State after the next refinement
t
Inner-loop iteration index
Ā
Discrete matrix that retains old information
e
Prelude context built from hk−1, observation, and action
B̄
Matrix that injects the conditioning context e
ℛ̄(h(t), e)
Barred calligraphic shared nonlinear transformer update
bar accents
Paper notation for the discrete or transformed update terms
=, +
Defines the next state and adds three contributions
adjacent products
Āh and B̄e are matrix-vector multiplications
( ), commas
Parentheses group function arguments; the inner comma separates them, and the terminal comma ends Equation 5
Door example: each pass can refine the prediction from “the agent touched the door” toward “the door is now open.”
Visual link: this is the gold recurrent-block box and its loop-back arrow in the mechanism diagram.
Source: Section 3.2, Equation 5.
Equations 6–7 · stability
Make retained state shrink rather than explode
A := diag(−exp(𝐚)), 𝐚 ∈ ℝd (learnable),
Ā = exp(Δ · A), Δ ∈ ℝd>0 (learnable).
Read it as: the retained-state multiplier is constructed to stay between zero and one, so repeatedly applying the loop does not make that linear part grow without bound.
𝐚 ∈ ℝd
Bold learned d-dimensional vector used to create negative rates
Δ
Learned positive step-size vector
ℝd>0
Positive d-dimensional real vectors
d
Hidden-state width
A
Negative diagonal continuous-time matrix
Ā
Discrete retention matrix; retention means how much prior hidden state is carried into the next update
diag(·)
Builds a matrix with values only on its diagonal
exp(·)
Applies the exponential function
:=, =
Definition and equality
−, ·
Negation and multiplication
∈
Set membership
learnable
Training adjusts the vector
( ), commas, period
Parentheses group functions; commas separate clauses and terminate Equation 6; the period terminates Equation 7
Door example: requesting more passes for an ambiguous doorway does not let the linear retained-state path grow merely because the loop runs longer.
Visual link: this equation governs the retained-state path entering each repeated gold-block update.
Source: Section 3.2, Equations 6–7. The paper states the consequence ρ(Ā) < 1: the spectral radius, the largest absolute eigenvalue of Ā, stays below one, so repeated linear retention contracts rather than grows.
Equation 8 · coda projection
Turn the final inner-loop state into the next carried state
hk = 𝒞(C h(T)),
Read it as: after T shared-block refinements, apply a learned projection and the separately parameterized coda to produce the state carried by the outer environment step.
hk
Latent state produced for environment step k
𝒞( )
Calligraphic coda with separate, non-shared parameters
C
Ordinary capital C: learned projection matrix
h(T)
Hidden state after the final inner iteration
k
Environment-step index
T
Total inner-loop iterations
=
Defines the carried state
juxtaposition
C h means matrix-vector multiplication
( )
Coda input and parenthesized iteration index
terminal comma
Terminates Equation 8 before the source continues
Door example: after the shared block finishes refining the “open door” transition, the coda projects that final hidden estimate into the state carried forward.
Visual link: this is the pink Coda 𝒞 box between the recurrent block and prediction heads.
Source: Section 3.2, Equation 8.
Equation 12 · adaptive early exit
Stop refining when the gate is confident
g(t) = σ(𝐰g⊤h(t) + bg),
Read it as: a small learned gate converts the current hidden state into a readiness score. The paper then says to stop at the first iteration whose score is strictly greater than τ; if none crosses, use the maximum allowed loops.
g(t)
Readiness score from 0 to 1
h(t)
Current hidden state at inner iteration t
𝐰g⊤h(t)
Learned weighted summary of the hidden state
𝐰g, bg
Bold learned gate vector and scalar bias
σ
Sigmoid squashing function
τ
Exit threshold from the stopping rule stated immediately after Equation 12
t
Inner-loop iteration index
⊤
Transpose used to form the weighted scalar score
=, +
Defines the gate and adds its bias
( )
Arguments to the sigmoid and indexed quantities
>
Strict comparison used by the stopping rule stated after the numbered equation
terminal comma
Terminates Equation 12 before the explanatory prose
Door example: a clear, unlocked door may cross τ after few passes; an obstructed or ambiguous doorway can use more passes.
Visual link: the simulator below illustrates only the threshold stopping rule with invented readiness scores; it does not compute σ, 𝐰g, h(t), or bg from Equation 12.
Source: Section 3.4, Equation 12 for the gate score; the strict threshold stopping rule is stated in the prose immediately after the equation.
Equations 13–15 · standard per-step decoding
Advance one action, then decode immediately
uk = 𝒜ψ(ak),
hk+1 = ℒθ(hk, uk),
(ôk+1, r̂k, ĉk) = 𝒟ξ(hk+1),
Read it as: embed one action, advance the latent state through the full dynamics core, and call the decoder after that action; repeat for every step.
k, k+1
Current and following action-step indices
ak
Action at step k
𝒜ψ, uk
Calligraphic action embedder and its output; ψ is learned
hk, hk+1
Latent states before and after the action
ℒθ
Full calligraphic looped dynamics core with learned parameters θ
𝒟ξ
Calligraphic decoder with learned parameters ξ
ôk+1
Predicted observation after the action
r̂k, ĉk
Predicted reward and continuation at the step
=, +
Equality and index increment
( ), commas
Parentheses group functions and tuple outputs; separators appear inside them, and a terminal comma ends each of Equations 13, 14, and 15
hat accents
Mark model predictions
three lines
Action embedding, state transition, then immediate decoding
Door example: standard decoding emits a predicted result after “walk to door,” again after “open door,” and again after “enter room.”
Visual link: the standard-mode control draws one decoder below every action-conditioned state.
Source: Section 3.5.2, Equations 13–15.
Equations 16–18 · deferred decoding
Advance K latent steps, decode once
uk = 𝒜ψ(ak), k = 0, 1, …, K−1,
hk+1 = ℒθcore(hk, uk), k = 0, 1, …, K−1,
(ôK, r̂K, ĉK) = 𝒟ξ(hK).
Read it as: apply a sequence of planned actions entirely inside the compact latent state, then call the expensive decoder only for the terminal prediction.
K
Number of planned action steps
k, ak
Action-step index and action at that step
𝒜ψ, uk
Calligraphic action embedder and encoded action; ψ denotes learned parameters
ℒθcore
Calligraphic decode-free latent transition with learned parameters θ
hk, hk+1
Current and next latent rollout states
hK
Terminal latent state
𝒟ξ
Calligraphic decoder with learned parameters ξ, called once at the end
ôK, r̂K, ĉK
Terminal observation, reward, and continuation predictions
0…K−1
Range of action-step indices
=
Defines encoded actions, next states, and predictions
( ), commas, period
Parentheses group functions and tuple outputs; terminal commas end Equations 16 and 17, and a terminal period ends Equation 18
hat accent
Marks terminal predictions
Door example: “walk to door → open door → enter room” can advance through latent states for all three actions and decode the final room state once.
Visual link: the deferred-decoding buttons below switch between five per-step decoder boxes and one terminal decoder box.
Source: Section 3.5.2, Equations 16–18.