I-JEPA: Turning JEPA into a Vision Representation Learner
SOURCE: Assran et al., 2023, Self-Supervised Learning From Images With a Joint-Embedding Predictive Architecture, Figure 3This is the second post in a series on the Joint Embedding Predictive Architecture (JEPA) family of models. The first post introduced the abstract JEPA proposed by Yann LeCun: encode a context $x$ and a target $y$ into representations $s_x$ and $s_y$, and train a predictor to predict $s_y$ from $s_x$, so that prediction happens in representation space rather than in pixel space. This post looks at a concrete instantiation of that idea for images.
The Image-based Joint-Embedding Predictive Architecture (I-JEPA), introduced by Assran et al. in Self-Supervised Learning From Images With a Joint-Embedding Predictive Architecture (CVPR 2023), instantiates the JEPA principle for static images: given only part of an image, the model predicts the representations of other spatially separated regions without reconstructing pixels.
I-JEPA uses a Vision Transformer (ViT) backbone structured into three components: a context encoder operating on visible patches, a target encoder producing representation targets from the complete image, and a lightweight predictor that takes context representations and target spatial coordinates to forecast the target representations in latent space (figure below). The context encoder processes only the visible context patches; the predictor is a narrow ViT that, conditioned on positional tokens (shown in color), predicts the representations of a target block at a specific location; and the target encoder’s weights are an exponential moving average of the context encoder’s weights. Unlike generative masked autoencoders, I-JEPA requires no pixel-level decoder.

Table of Contents
- The I-JEPA Prediction Problem
- Context and Target Masking
- The Three Components
- Target Masking at Encoder Output
- Predictor
- The I-JEPA Loss
- The Complete I-JEPA Training Step
- Prediction versus Pixel Reconstruction
- Why Does I-JEPA Learn Semantic Representations?
- Why the Masking Strategy Is a Learning Constraint
- Training Configuration
- Loss Function: Paper Formulation versus Implementation
- Inference and Representation Extraction
- I-JEPA as a Concrete Solution to the JEPA Challenges
- What I-JEPA Still Does Not Solve
- References
The I-JEPA Prediction Problem
Let an input image be $I \in \mathbb{R}^{H\times W\times C}$. The image is divided into non-overlapping patches of size $P\times P$. If the image dimensions are divisible by $P$, the resulting number of patches is
$$ N = \frac{H}{P} \frac{W}{P}. $$Let the patchified image be represented as
$$ I \longrightarrow \{x_1,x_2,\ldots,x_N\}. $$I-JEPA does not randomly hide individual patches independently. Instead, it constructs two spatially structured sets:
$$ B_x = \text{context patch indices}, $$and
$$ B_1,\ldots,B_M = \text{target-block patch indices}. $$The context encoder processes only visible patches $B_x$, while the target encoder processes the complete image to produce feature representations $\lbrace s_{y_j} \rbrace_{j=1}^N$. For each target block $B_i$, the predictor maps visible context representations $s_x = f_\theta(\lbrace x_j \rbrace_{j\in B_x})$ and target block coordinates to predicted target representations:
$$ \hat{s}_y(i) = g_\phi(s_x, B_i) \approx \{s_{y_j}\}_{j\in B_i}. $$Rather than predicting pixels ($I_{\mathrm{context}} \rightarrow I_{\mathrm{target}}$), I-JEPA predicts latent features ($I_{\mathrm{context}} \rightarrow s_{\mathrm{target}}$).
Context and Target Masking
The masking strategy provides the central inductive bias of I-JEPA. It balances two requirements:
- a context region that is sufficiently large and spatially distributed to contain useful information about the image;
- target regions that are sufficiently large to correspond to meaningful semantic entities rather than isolated local textures.
The default masking configuration samples $M=4$ target blocks. Each target block has a relative area sampled from
$$ \mathrm{scale}_{\mathrm{target}} \sim U(0.15,0.20), $$with aspect ratio sampled from
$$ r_{\mathrm{target}} \sim U(0.75,1.5). $$A single context block is sampled with
$$ \mathrm{scale}_{\mathrm{context}} \sim U(0.85,1.0) $$and unit aspect ratio in the standard configuration.
The target blocks are sampled independently of the context block. Any overlap between the context block and target blocks is then removed from the context. Thus,
$$ B_x \cap \left( \bigcup_{i=1}^{M} B_i \right) = \varnothing. $$The resulting geometry is important. The context is large enough to provide substantial information about the scene, but the target regions are removed from the context encoder’s input. Therefore, the model cannot solve the prediction task by directly observing the pixels belonging to the target. Under this strategy the target blocks tend to be semantic, and the context block is informative yet sparse, which also makes it efficient to process.

Why Large Target Blocks?
If the target consisted of a single isolated patch, adjacent patches could easily resolve it through low-level texture continuity ($x_{j-1}, x_{j+1} \rightarrow x_j$), encouraging the encoder to model trivial high-frequency pixel statistics. By requiring targets to span $15$–$20\%$ of the image, I-JEPA precludes local interpolation: predicting the block representation requires semantic reasoning about object parts, boundaries, and global scene context.
The Three Components
I-JEPA uses three networks:
$$ f_\theta \qquad f_{\bar{\theta}} \qquad g_\phi. $$They correspond respectively to the context encoder, target encoder, and predictor.
Context Encoder
The context encoder is a Vision Transformer:
$$ s_x = f_\theta(I;B_x). $$Unlike a conventional ViT, the context encoder does not process the entire patch sequence. It processes only the patches in $B_x$. If $|B_x| = N_x$, then the transformer operates on $N_x$ tokens rather than all $N$ image patches.
This has an immediate computational consequence: for self-attention, $\mathcal{O}(N^2d)$ is replaced by approximately $\mathcal{O}(N_x^2d)$, where $d$ is the embedding dimension.
Since the context is only a subset of the image, this is not merely a representation-learning choice: it also reduces the computational cost of the online encoder.
Target Encoder
The target encoder has parameters $\bar{\theta}$ and has the same ViT architecture as the context encoder:
$$ s_y = f_{\bar{\theta}}(I). $$There is one crucial asymmetry:
$$ f_\theta : \text{context-only image} \longrightarrow s_x, $$whereas
$$ f_{\bar{\theta}} : \text{complete image} \longrightarrow s_y. $$The target encoder is not updated using the gradient of the prediction loss. Instead, its parameters are updated through an exponential moving average (EMA) of the context encoder:
$$ \boxed{ \bar{\theta}_{t} = m_t\bar{\theta}_{t-1} + (1-m_t)\theta_t } $$where $m_t\in[0,1]$ is the EMA momentum (in I-JEPA it is increased over training from $0.996$ to $1.0$).
The context encoder and target encoder are initialized with identical parameters:
$$ \bar{\theta}_0 = \theta_0. $$The parameters $\theta$ are updated via gradient descent, while $\bar{\theta}$ tracks them via EMA with stop-gradient ($\nabla_{\bar{\theta}}\mathcal{L}=0$).
Role of the EMA Target Encoder
A JEPA trained only to minimize prediction error in representation space faces the risk of representation collapse: if both encoders map every input to the same constant vector, the prediction error is trivially zero while nothing useful has been learned (the first post discusses this in detail).
Updating the target encoder via EMA rather than gradient descent prevents the target representations from adapting instantaneously to the current gradient step. At a constant momentum $m$, unfolding the EMA update above gives
$$ \bar{\theta}_t = m^t\bar{\theta}_0 + (1-m) \sum_{k=1}^{t} m^{t-k}\theta_k, $$so $\bar{\theta}$ acts as an exponentially weighted moving average over past parameters. This provides a slowly evolving regression target that stabilizes optimization. In I-JEPA, this EMA mechanism serves as an empirical stabilization technique rather than a formal proof against collapse.
Target Masking at Encoder Output
A key design choice in I-JEPA is that the target encoder processes the complete, unmasked image:
$$ s_y = f_{\bar{\theta}}(I) = \{s_{y_1},\ldots,s_{y_N}\}, $$and target blocks $s_y(i) = \lbrace s_{y_j} \rbrace_{j\in B_i}$ are sliced out only after the full forward pass.
Because self-attention integrates information across all patches, each token $s_{y_j}$ incorporates global image context. Masking target patches prior to the target encoder would deprive the target representations of surrounding context. The I-JEPA ablations confirm that masking the target encoder’s output rather than its input produces substantially better representations.
Predictor
The predictor $g_\phi$ receives the context representation and a description of the target location. For target block $B_i$,
$$ \hat{s}_y(i) = g_\phi \left( s_x, \{q_j\}_{j\in B_i} \right), $$where $q_j$ is a learnable mask token augmented with positional information for patch $j$.
The predictor therefore receives two kinds of information:
- content: the representation of the visible context;
- geometry: the locations of the target patches that must be predicted.
The positional information is essential. The predictor cannot simply be asked to generate an unordered collection of target embeddings; it must know where in the image those embeddings belong.
Thus, for each target patch $j$,
$$ q_j = m + p_j, $$where $m$ is a shared learned mask-token vector and $p_j$ is the positional embedding associated with location $j$.
The predictor receives the context representations as its source of visual information and these position-conditioned mask tokens as prediction queries.
Why a Narrow Predictor?
The predictor is deliberately smaller than the backbone encoder. The I-JEPA paper fixes its embedding dimension at $d_{\mathrm{pred}}=384$ and scales the predictor depth with the backbone:
| Backbone | Predictor depth |
|---|---|
| ViT-B/16 | 6 |
| ViT-L/16 | 12 |
| ViT-H/16 | 12 |
| ViT-H/14 | 12 |
| ViT-G/16 | 16 |
while maintaining the same number of attention heads as the backbone.
The bottleneck is conceptually important. The encoder is responsible for producing a high-quality representation ($I \rightarrow s$), while the predictor only has to solve a conditional mapping:
$$ s_x \rightarrow s_y. $$Giving the predictor a full-size copy of the encoder would unnecessarily increase computation and could shift representational capacity away from the encoder. The predictor therefore acts as a relatively lightweight mechanism for performing spatial reasoning in the learned representation space.
The I-JEPA Loss
For each target block $B_i$, the predictor produces
$$ \hat{s}_y(i) = \left\{ \hat{s}_{y_j} \right\}_{j\in B_i}. $$The corresponding target representation is
$$ s_y(i) = \left\{ s_{y_j} \right\}_{j\in B_i}. $$The paper formulates the loss as the average squared Euclidean distance over the $M$ target blocks:
$$ \boxed{ \mathcal{L}_{\mathrm{I\text{-}JEPA}} = \frac{1}{M} \sum_{i=1}^{M} D \bigl( \hat{s}_y(i), s_y(i) \bigr) } $$with
$$ D \bigl( \hat{s}_y(i), s_y(i) \bigr) = \sum_{j\in B_i} \bigl\| \hat{s}_{y_j} - s_{y_j} \bigr\|_2^2. $$Hence,
$$ \boxed{ \mathcal{L}_{\mathrm{I\text{-}JEPA}} = \frac{1}{M} \sum_{i=1}^{M} \sum_{j\in B_i} \bigl\| \hat{s}_{y_j} - s_{y_j} \bigr\|_2^2. } $$Only target patch positions contribute to the loss. Training contains neither a pixel-reconstruction penalty nor a contrastive term built from negative samples (pairs that are pushed apart, as described in the first post); it optimizes strictly by feature regression toward the target representations.
Gradient Flow
Gradients flow through the context encoder $f_\theta$ and predictor $g_\phi$:
$$ \hat{s}_y = g_\phi\bigl(f_\theta(I;B_x), B_i\bigr), $$while the target branch is frozen under a stop-gradient operator:
$$ s_y = \operatorname{sg}\left[f_{\bar{\theta}}(I)\right], \qquad\text{so}\qquad \nabla_{\bar{\theta}}\mathcal{L}=0. $$Consequently, parameter updates decouple into gradient optimization for $(\theta, \phi)$ and exponential moving average updates for $\bar{\theta}$:
$$ \theta \leftarrow \operatorname{OptimizerStep}(\theta, \nabla_\theta\mathcal{L}), \qquad \bar{\theta} \leftarrow m\bar{\theta} + (1-m)\theta. $$The Complete I-JEPA Training Step
A single training iteration can be written precisely as follows. Given an image $I$:
Step 1: Sample masks
Sample
$$ B_x, B_1,\ldots,B_M. $$Ensure
$$ B_x \cap \bigcup_i B_i = \varnothing. $$Step 2: Compute target representations
Run the complete image through the EMA target encoder:
$$ s_y = f_{\bar{\theta}}(I). $$Select the representations corresponding to the target regions:
$$ s_y(i) = \{s_{y_j}\}_{j\in B_i}. $$No gradient is propagated through this operation.
Step 3: Compute context representation
Feed only the context patches through the context encoder:
$$ s_x = f_\theta(I;B_x). $$Step 4: Predict each target block
For every target block $i$,
$$ \hat{s}_y(i) = g_\phi \left( s_x, B_i \right). $$Step 5: Compute latent prediction error
$$ \mathcal{L} = \frac{1}{M} \sum_{i=1}^{M} D \bigl( \hat{s}_y(i), s_y(i) \bigr). $$Step 6: Backpropagate
Update $\theta,\phi$ using the gradient of $\mathcal{L}$.
Step 7: Update the target encoder
Apply
$$ \bar{\theta} \leftarrow m\bar{\theta} + (1-m)\theta. $$This completes one self-supervised training iteration.
Prediction versus Pixel Reconstruction
Masked autoencoders (MAE) reconstruct raw pixel patches with a pixel decoder $h_\phi$,
$$ \hat{I}_{\mathrm{target}} = h_\phi\bigl(f_\theta(I_{\mathrm{visible}})\bigr), $$penalized by a pixel-space $L_2$ error. I-JEPA instead evaluates prediction strictly in representation space, against the EMA target representations $f_{\bar{\theta}}(I)$. Predicting representations rather than pixels frees the model from allocating capacity to unpredictable low-level details (such as high-frequency textures and lighting noise) and focuses learning on scene-level semantic abstractions.
The I-JEPA authors make this visible by training a separate generative model to decode the outputs of a pretrained I-JEPA predictor back into images. In the figure below, the first column of each example is the original image and the second is the context given to the encoder; the green boxes show several samples decoded from the predictor’s output for that location. What the samples share is information contained in the prediction; what varies between them is information the prediction does not contain. The predictor captures positional uncertainty and produces high-level object parts with the correct pose (e.g. the back of the bird, the top of the car), while it discards precise low-level details and background information.

Why Does I-JEPA Learn Semantic Representations?
The desired semantic behavior is not obtained from a separate classification objective. It emerges from the interaction of four design choices:
- target representations are learned by an encoder rather than defined directly in pixel space;
- target blocks are spatially large;
- the context is large enough to establish scene-level relationships;
- the target regions are removed from the context.
Consider an image containing a dog. If the target is a sufficiently large region containing the dog’s head and body, the predictor cannot determine its representation by copying the target pixels. It must infer the missing representation from the surrounding context.
The useful information therefore tends to be information such as
$$ \{\text{shape}, \text{object identity}, \text{pose}, \text{spatial relationships}, \text{scene context}\}, $$rather than exact pixel-level texture.
This does not mean that I-JEPA explicitly discards low-level information. Rather, the training objective creates no requirement to preserve information that does not help solve the representation-prediction task.
The same decoding experiment applied to the target encoder supports this. In the figure below, the first column is the original image and the other columns are samples decoded from the average-pooled output of a pretrained I-JEPA target encoder. The samples agree on the objects and their poses, but vary in the precise low-level details and the background.

Why the Masking Strategy Is a Learning Constraint
The masking design can be interpreted as defining the conditional dependency the model must learn. Let
$$ s_x = f_\theta(I_{B_x}), $$where $I_{B_x}$ denotes the visible context. The desired mapping is
$$ g_\phi : (s_x,B_i) \rightarrow s_y(i). $$Changing $B_x$ and $B_i$ changes the set of visual dependencies available to the predictor. This creates several qualitatively different learning problems:
| Masking scheme | Prediction difficulty | Likely inductive bias |
|---|---|---|
| Random individual patches | Mostly local | Texture / local statistics |
| Single small target | Local interpolation | Low-level structure |
| Large contiguous target | Global context needed | Semantic structure |
| Multiple large targets | Multiple spatial relations | Scene-level structure |
The authors’ masking ablations support this interpretation: the proposed multi-block strategy was substantially more effective than several simpler masking schemes for learning semantic representations.
Training Configuration
For the main ImageNet-1K ViT-H/14 configuration in the official implementation, the model uses:
| Parameter | Value |
|---|---|
| Input resolution | $224\times224$ |
| Patch size | $14\times14$ |
| Backbone | ViT-Huge |
| Predictor dimension | $384$ |
| Predictor depth | $12$ |
| Target blocks | $4$ |
| Target scale | $(0.15,0.20)$ |
| Context scale | $(0.85,1.0)$ |
| Target aspect ratio | $(0.75,1.5)$ |
| Epochs | $300$ |
| Initial learning rate | $2\times10^{-4}$ |
| Peak learning rate | $10^{-3}$ |
| Final learning rate | $10^{-6}$ |
| Weight decay | $0.04\rightarrow0.4$ |
| EMA momentum | $0.996\rightarrow1.0$ |
| Precision | bfloat16 |
The official reproduction setup uses an effective batch size of $2048$ over 16 A100 80GB GPUs.
Notably, the pretraining recipe disables several commonly used image augmentations:
$$ \text{color jitter}=0, \qquad \text{Gaussian blur}=0, \qquad \text{horizontal flip}=0. $$The principal source of view variation is therefore the masking process rather than a collection of manually designed appearance transformations.
Loss Function: Paper Formulation versus Implementation
While the paper presents the target-prediction objective using squared $L_2$ distance:
$$ \mathcal{L}_{\mathrm{paper}} = \frac{1}{M} \sum_{i=1}^{M} \sum_{j\in B_i} \bigl\| \hat{s}_{y_j} - s_{y_j} \bigr\|_2^2, $$the official reference implementation optimizes a Smooth $L_1$ loss over LayerNorm-normalized targets:
$$ \mathcal{L}_{\mathrm{code}} = \operatorname{SmoothL1} \bigl( \hat{s}_y, \operatorname{LN}(s_y) \bigr). $$Layer-normalizing target representations feature-wise prevents scale explosion and stabilizes gradient magnitudes during early pretraining.
Inference and Representation Extraction
I-JEPA is principally a representation-learning system rather than a standalone image-generation model. After self-supervised pretraining, the encoder can be reused for downstream tasks. For a new image $I$,
$$ I \xrightarrow{\;f_{\bar{\theta}}\;} \{s_1,\ldots,s_N\}. $$A global representation can be obtained by average pooling:
$$ s_{\mathrm{global}} = \frac{1}{N} \sum_{j=1}^{N}s_j. $$A downstream linear probe then learns
$$ \hat{y} = W s_{\mathrm{global}}+b $$without modifying the pretrained representation. Alternatively, the encoder can be fine-tuned end-to-end for a downstream task.
The important point is that the pretrained model has learned a representation that can be consumed by a separate task-specific head.
I-JEPA as a Concrete Solution to the JEPA Challenges
The first post described the abstract JEPA and the problems any practical instantiation has to solve. We can now map those problems to the specific I-JEPA mechanisms.
| Challenge | I-JEPA mechanism |
|---|---|
| Pixel-level prediction is unnecessarily difficult | Predict representations rather than pixels. |
| Representation collapse | Use a slowly evolving EMA target encoder and asymmetric online/target optimization. |
| Trivial local interpolation | Predict relatively large target blocks rather than isolated patches. |
| Insufficient contextual information | Use a large spatially distributed context block. |
| Shortcut through direct access to target pixels | Remove all target regions from the context encoder’s input. |
| Ambiguous prediction location | Provide target-specific mask tokens with positional embeddings. |
| Excessive predictor computation | Use a narrow predictor rather than a second full-size ViT. |
| Need for multiple negative examples | Use direct target-representation regression rather than contrastive training. |
The result is a practical instantiation of the abstract JEPA:
$$ \boxed{ \begin{aligned} I &\xrightarrow{\;f_\theta,\;B_x\;} s_x \\ I &\xrightarrow{\;f_{\bar{\theta}}\;} s_y \\ (s_x,B_i) &\xrightarrow{\;g_\phi\;} \hat{s}_y(i) \\ \hat{s}_y(i),s_y(i) &\xrightarrow{\;D\;} \mathcal{L}. \end{aligned}} $$The target encoder is updated through
$$ \bar{\theta} \leftarrow m\bar{\theta} +(1-m)\theta, $$and the optimization is therefore
$$ \boxed{ \min_{\theta,\phi} \mathcal{L} \qquad \text{subject to} \qquad \bar{\theta} \leftarrow \operatorname{EMA}(\theta). } $$What I-JEPA Still Does Not Solve
I-JEPA solves the problem of learning semantic representations from static images, but it does not yet provide a temporal world model. Its prediction relationship is spatial:
$$ \text{visible region} \rightarrow \text{missing region}. $$The target and context belong to the same image and therefore the model is not explicitly asked to learn
$$ s_{t} \rightarrow s_{t+1}. $$Likewise, there is no action variable $a_t$ in the I-JEPA objective, as there would be in an action-conditioned predictor
$$ s_{t+1} = P(s_t,a_t). $$Thus I-JEPA learns a rich semantic image representation, but does not model temporal state evolution ($s_t \rightarrow s_{t+1}$) or action conditioning ($s_{t+1} = P(s_t, a_t)$). Moving from spatial image masking to spatiotemporal video introduces new challenges of temporal redundancy, motion estimation, and 3D masking. The next post in this series turns to V-JEPA, which takes on exactly these challenges.
References
- Assran, M., Duval, Q., Misra, I., Bojanowski, P., Vincent, P., Rabbat, M., LeCun, Y., & Ballas, N. (2023). Self-Supervised Learning From Images With a Joint-Embedding Predictive Architecture. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 15619–15629.
- Official I-JEPA implementation: facebookresearch/ijepa (GitHub).