Beta

Sync to cloud

Uses your current signed-in YoolVi account. A Learn profile is not required.

Upload a snapshot of this browser’s saved lesson work across all subjects, including notes, experiments, journal and review history. Existing guest work is included only when you confirm below. This does not upload account credentials or award XP.

Sync uploads to your private account; it does not automatically merge or replace this device’s work. On another device, download the cloud copy and use My Learning’s backup import. The previous cloud snapshot is retained when a new one replaces it.

Export or import this device’s work

No background uploads. Edits made after a snapshot need another sync. On shared devices, work is bound to the first account observed by cloud sync; another account must use a separate browser profile. Keep your own downloaded backup too.

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Back to World Models and Predictive Planning

World Models and Predictive Planning · Lesson 1 of 2 in this module

Understand latent dynamics

Latent dynamicsFixed teaching example — not your saved experiment.
  1. Starting information

    Observations compressed into a small code

  2. Relationship or operation

    Predict changes in that code

  3. Consequence

    Some action-relevant detail may be lost

A latent dynamics model predicts in a representation. Reconstruction quality alone cannot show that the code preserves what control needs.

The idea in everyday terms

Imagine describing a picture using only two numbers. Which details should survive if you need to predict what a push will change? A model that remembers a static background may be easy to predict but poor at describing movement.

What to watch in the experiment

Train three objectives on the same tiny moving-spot scenes. One learns to reconstruct images as well as predict the next code. One only predicts the next code. The third adds a penalty when codes vary too little or their two coordinates repeat the same pattern. Use the same update budget and compare more than one score.

Load the collapsed control: every image becomes the same two zeros. Prediction error is zero because the next code is also zero, but no scene differences remain. The spread penalty notices this failure through a positive loss. A perfectly symmetric zero model can still have zero gradient, so reset to the seeded model before expecting learning to escape it.

Keep usefulness separate from appearance

A separate diagnostic rule learns to read position and pixels from training codes. It never changes the encoder or action predictor. It checks development examples and predicted next codes using the same fitted rule. Compare its next-position error with keeping the current code unchanged. A poor simple readout does not prove that no other decoder could recover the information.

Add static brightness and texture, then change the probe action without changing the observed picture. Varied codes and low prediction error may still miss useful action information. The image preview clips invalid brightness values only for display and counts them; the numerical evidence keeps them. The code plot has fixed axes.

Keep the evidence in context

These are 48 training pairs and 24 public development pairs from separate short episodes. Nearby frames are correlated. Diagnostic fitting is additional work, not representation training. The neural pixel decoder is trained only by the reconstructive objective. These comparisons do not track hidden states or learn a policy. The worked reference below gives the exact losses and assumptions.

Full worked explanation, calculations and control definitions

Use this reference for the detailed mechanism and control meanings. Derivations explicitly marked optional are enrichment.

Pictures, codes and action predictions

A latent representation is a learned internal description rather than the original measurement. Here an encoder compresses a sixteen-pixel picture into two numbers. A predictor receives those two numbers and an action, then predicts the next picture’s code. A decoder can map a code back to pixels, but predicting a useful code does not inherently require generating a picture.

The generated scene is a soft spot moving horizontally in a 4×4 frame. Actions −1, 0 and +1 move its horizontal position by −0.18, 0 and +0.18 scene units; the position is clipped to ±0.9. Optional brightness and checker texture stay fixed within each episode. They change appearance without changing the motion rule.

Eight six-step training episodes supply 48 pairs. Four separate development episodes supply 24. Whole episodes are assigned before training, and adjacent frames remain correlated. These are tiny authored scenes, not camera data or evidence about arbitrary videos.

zt=Eθ(It),z^t+1=Pϕ(zt,ut),zt+1=Eθ(It+1)z_t=E_\theta(I_t),\qquad \hat z_{t+1}=P_\phi(z_t,u_t),\qquad z_{t+1}=E_\theta(I_{t+1})

I denotes an image, z its two-number code and u the action. The same encoder processes both frames. Gradients from both sides accumulate into its shared weights. The predictor sees neither the future image nor the simulator’s position labels.

Why a low error can mean nothing

Suppose every image becomes [0, 0]. A predictor that always returns [0, 0] perfectly matches every next code, even when the physical object moves. This is representation collapse: different observations lose their distinctions.

Prediction-only training minimizes the mean squared difference between predicted and next-image codes. Both encoder outputs are allowed to change. The loss can decrease by making motion easier to predict, but it can also decrease by making all targets similar. The collapsed control in the lab actually sets all weights to zero; its zero loss is computed, not a fabricated score.

Compare three concrete objectives

Let L be mean squared next-code error across pairs and both code dimensions. Let R be mean squared reconstruction error across both images in each pair and all sixteen pixels. Reconstruction-plus-prediction trains the encoder, predictor and sigmoid pixel decoder to minimize L + 10R. The factor ten is an authored scale choice for these small normalized images, not a universal recipe.

Prediction-only minimizes L and leaves the decoder inactive. The third mode adds explicit terms that discourage constant codes and redundant coordinates. It also leaves the pixel decoder inactive.

Lreconstruct=L+10R,Lpredict=L,Lspread=L+5V+C\mathcal L_{\rm reconstruct}=L+10R,\qquad \mathcal L_{\rm predict}=L,\qquad \mathcal L_{\rm spread}=L+5V+C

To calculate V, pool the 96 source/target training encodings. For each coordinate, find its average, average the squared distances from that average, add 0.0001 and take the square root. This is the displayed regularized spread. Penalize the squared amount by which it falls below 0.3, then average over the two coordinates. A perfectly constant code therefore reports 0.01 rather than zero because of the added number.

C is the square of the off-diagonal population covariance: average the product of the two centered coordinates, then square it. It discourages the two coordinates from varying together. Low covariance alone does not establish independence or useful task information.

sj=1M∑i(zij−zˉj)2+10−4,V=12∑j=12max⁡(0,0.3−sj)2,C=[1M∑i(zi1−zˉ1)(zi2−zˉ2)]2s_j=\sqrt{\frac1M\sum_i(z_{ij}-\bar z_j)^2+10^{-4}},\quad V=\frac12\sum_{j=1}^2\max(0,0.3-s_j)^2,\quad C=\left[\frac1M\sum_i(z_{i1}-\bar z_1)(z_{i2}-\bar z_2)\right]^2

Here M = 96 during training. All moments use divisor M. This is an action-conditioned teaching experiment inspired by variance/covariance regularization, not a replication of the VICReg paper. It uses squared shortfall, pooled temporal views and a learned action predictor with its own specified weights and limits.

A penalty is not a guarantee

The exact zero control has L = 0, V = 0.29² and C = 0. The spread objective is therefore positive. Yet every centered code is zero, so the corresponding gradients at that perfectly symmetric point are zero too. Reset to a nonconstant seeded initialization to explore learning. The objective discourages collapse without guaranteeing escape from every initialization.

Even varied codes can encode the wrong thing. Static texture is easy to predict because it stays unchanged. With two coordinates and several sources of variation, the model can trade motion information for appearance information. Healthy spread, low prediction error and visually plausible reconstruction are not interchangeable evidence.

Inspect information without leaking it into training

A separate diagnostic readout asks what a simple affine rule can recover from the frozen codes. It fits position and pixels on the 96 training encodings only, with ridge 0.0001 on its two slopes and no penalty on its intercept. Position labels never update the encoder or predictor. Re-fitting this readout after a checkpoint is diagnostic work, not an additional representation-training step.

The same readout evaluates development encodings and predicted next codes. Compare current pixel error with a training-mean image; current-position error with next-position error; and action-conditioned next-position error with keeping the current code. A limited affine readout can miss information that a more flexible decoder could recover, so its error is not proof that all information is absent.

The neural pixel decoder’s error is reported separately and only in reconstruction mode. Its absence in the other modes must not be mistaken for a failed trained decoder. Image previews from the diagnostic readout clip brightness to 0–1, count clipped values, and preserve exact unclipped values in metrics and exports. Codes use fixed ±1 plot axes; latent coordinates are not physical coordinates.

Make a controlled comparison

Use the same initialization and update budget across objectives. Add distractors as a separate intervention. Change the probe action while holding the observed frame fixed, and inspect the true next frame, predicted code and position readout. These counterfactual probes never train the representation.

The encoder has 34 parameters, the action predictor eight and the decoder 48. Simultaneous full-batch SGD uses rate 0.3, at most 25 updates per worker batch and 1,000 total. Larger requests commit complete batches and can be cancelled. One direct CPU update remains available. Six temporary captures retain settings, weights, diagnostics and bounded notes; reload clears them unless exported.

This lesson studies one-step representations. It does not estimate hidden state across occlusion or train a policy in imagined trajectories. The fixed development examples and diagnostic labels are public practice.