Predictive Embeddings, JEPA, and Energy-Based Models › Joint-Embedding Predictive Architectures
World Models HandbookAll chapters Predictive Embeddings, JEPA, and Energy-Based Models › Joint-Embedding Predictive ArchitecturesOne section · Sections in this chapter3 / 10 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Yann LeCun introduced JEPA in the 2022 position paper as a broad architecture for prediction in representation space, alongside generative and other joint-embedding architectures. That generic formulation does not prescribe an EMA target or stop-gradient. The concrete recipe developed here follows prominent I-JEPA- and V-JEPA-style implementations: a context encoder, an EMA target encoder, a predictor, and detached target embeddings.
The components are:
- Context encoder : maps the observed part of the input to an embedding and is trained by gradient descent. Which encoder is retained for evaluation is method-dependent; BYOL uses the online representation, while an official V-JEPA frozen-evaluation configuration loads the target encoder.
- Target encoder : processes the target input without gradient updates. In masked I-JEPA, the official training implementation processes the full unmasked image before target locations are selected from its output. Its parameters follow via an exponential moving average.
- Predictor : maps the context embedding (plus optional conditioning, such as an action) to a prediction of the target embedding.
- Stop-gradient: the target embedding is detached from the computation graph before the loss is applied.
For the squared-error instantiation used in this chapter's analysis and toy system, the objective is an embedding-space discrepancy. The loss is not canonical across JEPA implementations: the official I-JEPA training code uses Smooth L1, while the cited official V-JEPA configuration sets loss_exp to , which gives an L1 objective in its training implementation.
where:
- : the stop-gradient operator, which detaches its argument from the computation graph
- : the context (the observed part of the input)
- : the target (the part of the world the model must predict)
- : any conditioning information, such as an action
- : the context encoder, parameterized by
- : the parameters of the context encoder
- : the target encoder, parameterized by
- : the parameters of the target encoder (updated by EMA)
- : the predictor, parameterized by
- : the parameters of the predictor
- : the data distribution
- : the training loss for this chapter's squared-error instantiation
- : the expectation over context-target pairs drawn from the data distribution
- : the squared Euclidean norm
The target parameters follow
where:
- : the target encoder parameters
- : the context encoder parameters
- : the EMA decay rate in , chosen close to one relative to the online-update timescale. Values below one update the target; freezes it. An official I-JEPA configuration, for example, schedules it from toward ; the toy example below uses a fixed value of .
The following details play distinct roles, although related methods show that one mechanism can sometimes substitute for another.
There is no decoder. Nothing in requires to be invertible or decodable. The embedding only has to be predictable and internally consistent. This removes the pixel-rendering burden and, at the same time, removes any external constraint that would keep the embedding from collapsing on its own.
The gradient updates are asymmetric. Gradients flow to and but not to . If you remove the stop-gradient and use the same encoder on both sides, both encoder evaluations can move through the same update toward a constant solution, as we will see in the seeded experiment. Detaching the target prevents that instantaneous gradient cooperation, but does not eliminate constant solutions mathematically.
The predictor is not a formality. In the simplified linear setting below, it can absorb part of the context-to-target regression that would otherwise constrain the encoder. This is an intuition under stated assumptions, not a general guarantee that predictors prevent shrinkage or collapse.
Why the predictor matters
Consider the linear case to see the mechanics cleanly. Assume for this analysis that the context and target inputs have the same dimension and that and are centered, so that and are directly comparable and the second moments below are covariance matrices. Suppose , , and the predictor is the identity. The population loss is
where:
- : the online encoder weight matrix
- : the target encoder weight matrix
- : the context input
- : the target input
- : the population squared-error loss for the online encoder when the predictor is fixed to the identity
- : the expectation over context-target pairs from the data distribution
- : the squared Euclidean norm
Taking the gradient with respect to gives . Setting this to zero and using the definitions of the covariance matrices (assuming is invertible) gives
where:
- : the covariance matrix of the context inputs
- : the cross-covariance matrix between the targets and the contexts
- : the cross-covariance matrix between the contexts and the targets
- : the inverse of the context covariance matrix, which exists when is invertible
- : the online encoder weight matrix
- : the target encoder weight matrix
Write . For the centered variables assumed here, maps each target-encoder direction to the least-squares coefficient vector for predicting that target coordinate from . If the target encoder tracks the online encoder via an EMA and a stationary point also has , then the normal equation reduces to . Thus, the columns of a nonzero stationary must lie in the eigenspace of with eigenvalue one. When that eigenspace is absent, is the only stationary solution satisfying this simplified fixed-point condition. This calculation establishes the availability of a collapsed fixed point under the stated linear assumptions; it does not prove that every nonlinear predictor-free training run converges to collapse. The useful conclusion is that the predictor-free objective does not rule out the trivial stationary point.
Now add a predictor with learnable. The loss becomes
where:
- : the predictor weight matrix
- : the online encoder weight matrix
- : the target encoder weight matrix
- : the context input
- : the target input
- : the population squared-error loss with a learnable linear predictor
- : the expectation over context-target pairs from the data distribution
- : the squared Euclidean norm
The composite map can allocate part of the context-to-target regression to , so the encoder is not required to absorb the entire regression map. In this simplified analysis, that extra degree of freedom permits nonzero stationary solutions that the identity-predictor fixed-point equation can exclude. A sufficiently capable predictor can represent systematic context-to-target mismatch here, so the encoder need not represent the whole regression map itself. This limited result helps explain the predictor in BYOL, SimSiam, and JEPA-style training; normalization, learning rates, regularization, target updates, and data geometry still affect the outcome. Representation-only evaluation may discard the predictor, whereas a latent world model needs a transition predictor to roll forward.
The target encoder is a copy of the context encoder whose weights follow the context encoder by exponential moving average rather than direct gradient descent. With a decay chosen close to one relative to the online-update timescale, it provides a more slowly changing prediction target and prevents instantaneous gradient co-adaptation of the two branches. This asymmetry can stabilize training, but it does not make the constant representation mathematically impossible.
What the target encodes, and why it is a world model
So far we have described JEPA abstractly with inputs and . Spatial masking and temporal or action-conditioned prediction illustrate two different constructions. The choice determines which invariances the encoder can learn and which information it can discard.
Masked spatial prediction. In I-JEPA, the context encoder receives visible image patches. The target encoder processes the full unmasked image, after which embeddings at masked target locations are selected for prediction. The model therefore predicts contextualized hidden-region features from visible surroundings. This encourages representations that support masked-region feature prediction; whether they encode amodal object shape or help track occluded entities requires a separate evaluation.
Temporal and action-conditioned prediction. Original V-JEPA predicts masked tube-like regions whose targets span a clip's temporal dimension; it is not specifically a future-prediction model. In V-JEPA 2-AC, the predictor instead forecasts future frame embeddings from past states and actions. A deterministic action-conditioned model implements a map rather than a full conditional distribution . With sufficiently informative interaction data, conditioning on actions lets it model how transitions vary with the agent's actions; action conditioning alone does not guarantee causal attribution.
The action-conditioned temporal case is the one that connects directly to the rest of this book. The model now has the same interface as the RSSMs of Part V, Ch 1: a latent state, an action input, and a predicted next latent, but with a different objective and no reconstruction term. Planning then requires a cost defined over embeddings, for example the distance from a predicted embedding to an embedding of a goal observation. Sampling-based planners and model predictive control over such learned costs are the subject of Part VII: Planning and Agency. In V-JEPA 2-AC, the planner searches over action sequences while predicted embeddings serve as rollout state and define the objective. The embedding geometry matters directly even though arbitrary embedding vectors are not the optimization variables.
The uncertainty problem
There is an obvious objection. Squared error in embedding space is a point prediction, and point predictions cannot express multimodality. If a pedestrian might go left or right, the optimal point prediction under squared error is the mean embedding, which may correspond to no plausible future at all. We discussed this failure mode in general terms under stochasticity and uncertainty in Part IV: Space, Physics, and Causality, and it is worth restating here because JEPA handles it in a way that is easy to miss.
The target encoder does not solve multimodality. Under squared error, the optimal deterministic prediction is the conditional mean of the target embedding. Learning the embedding can make nuisance variation less prominent, but it does not guarantee that this mean corresponds to any attainable future or remains useful for control. Representing distinct alternatives requires a predictor or objective that can produce or score multiple targets, for example through sets, multiple heads, stochastic outputs, energies, or probabilities. An EMA target encoder is one component of some anti-collapse recipes; it does not address ambiguity in a deterministic point predictor.