logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·01.11.26
← Back to news

The Annotated JEPA

Original article
elonlit.com|26 points|2 comments|by surprisetalk|Jul 10, 2026

The Annotated JEPA

By Elon Litman | January 27, 2026 | Filed under: Deep Learning

This guide serves as a comprehensive, from-scratch, annotated walkthrough of Joint Embedding Predictive Architectures (JEPAs).

The objective here is to mirror the impact of The Annotated Transformer by meticulously constructing the architecture, clarifying every internal mechanism, and concluding with a functional training loop.

The Core Philosophy

JEPA represents Yann LeCun's strategic response to a pivotal challenge in self-supervised learning (SSL): How can a model acquire a deep understanding of the world without human-provided labels, while avoiding the "collapse" into trivial solutions and ignoring useless noise?

The solution is as elegant as it is nuanced: perform prediction within the representation (latent) space rather than the input space.

Why Visuals over Text?

While many models focus on LLMs, JEPA emphasizes images and video. The reasoning is as follows:

  • Language is already a discrete, highly compressed abstraction of knowledge. Predicting the next token is more about modeling human communication than physical reality.
  • Visuals require a model to grasp concepts like persistence, occlusion, and physical dynamics.

Pixel-level reconstruction is viewed as a waste of computational capacity because it forces the model to obsess over irrelevant high-frequency details.


Roadmap of the Implementation

  • Build the foundational I-JEPA architecture.
  • Explore extensions to video via V-JEPA and V-JEPA 2.
  • Analyze LeJEPA's distributional regularizers.
  • Implement the final training loop.

Evolution of the Architecture

ModelFocusKey ContributionReference
I-JEPAImagesSemantic representations via masked region prediction(2023)
V-JEPAVideoLatent video prediction for representation learning(2024)
V-JEPA 2VideoAdvanced understanding, prediction, and planning(2025)
LeJEPAGeneralReplacing heuristics with distributional regularizers(2025)

Note on Implementation: To keep the mathematics transparent, this walkthrough omits production-level engineering such as FlashAttention, mixed-precision training, gradient checkpointing, and complex batching strategies.


The Fundamental Problem

The central struggle of self-supervised representation learning is finding an objective function that captures meaningful structure without labels. JEPA solves this by predicting representations.

The Intuition

Imagine you are presented with a partial image (the context xxx) and must predict a hidden region (the target yyy).

  1. A Predictor takes the encoding of the context and guesses the representation s^y\hat{s}_ys^y​.
  2. The system only succeeds if the context encoding sxs_xsx​ contains enough semantic information to constrain the possibilities of sys_ysy​.

Examples of Semantic Necessity:

  • If you see a car's hood, you can only predict the wheels if your encoder understands the concept: "This is a car."
  • If you see a face, predicting the hair requires an understanding of identity, pose, and lighting.

Because the predictor cannot "hallucinate" details missing from the context, the encoder is forced to ignore pixel-level noise and focus on structural features (object identity, spatial constraints, etc.).

Theoretical Framework

LeCun frames this within an Energy-Based Model (EBM) context, viewing JEPA as the bedrock for "World Models" that can plan within a latent space.


The JEPA Template

A JEPA operates on paired, semantically linked views of the world. Generally, these are triples (x,y,z)(x, y, z)(x,y,z):

  • xxx: The observed context.
  • yyy: The target to be predicted.
  • zzz: An optional latent variable used to handle multimodality (when one xxx could lead to multiple valid yyy outcomes).

Application Domains

  • Images: xxx = visible patches →\rightarrow→ yyy = masked patches.
  • Video: xxx = clip prefix →\rightarrow→ yyy = future continuation.
  • Cross-Modal: xxx = audio →\rightarrow→ yyy = corresponding video.

The Mathematical Formulation

Both observations are mapped into a shared latent space:

sx=fθ(x),sy=fθˉ(y)s_x = f_\theta(x), \quad s_y = f_{\bar\theta}(y)sx​=fθ​(x),sy​=fθˉ​(y)

Where fθf_\thetafθ​ and fθˉf_{\bar\theta}fθˉ​ are the encoders. These may share parameters or utilize different architectures depending on the specific implementation.

Conceptual Code Structure

def jepa_loss(context, target):
    # Encode both views
    s_x = context_encoder(context)
    s_y = target_encoder(target)
    
    # Predict target representation from context
    s_y_hat = predictor(s_x)
    
    # Calculate distance (Energy) in latent space
    loss = distance_function(s_y_hat, s_y)
    return loss

Elements of a Vector Space Elements of a Vector Space