Skip to content

Hide most of the video, predict it back: VideoMAE, MaskFeat, V-JEPA

Mask most space-time patches and predict what was hidden: as pixels (VideoMAE), as edge histograms (MaskFeat) or as another encoder's features (V-JEPA). VideoMAE V2 trims the decoder; InternVideo adds text. A low loss isn't the result.

Advanced ~16 min10 steps

What runs in CodeSplash

You will be able to

  • Explain tube masking and why video tolerates very high masking ratios
  • Compare pixel, HOG and feature targets for masked prediction
  • Describe V-JEPA's predictor, stop-gradient target and moving-average target encoder
  • Separate VideoMAE V2's dual masking from the effect of more data and compute
  • Say why a system trained with captions isn't purely unsupervised

Read first

01

Mask tubes, not pixels

Read

A masked autoencoderMasked autoencoderHides most patches of an input, encodes only the visible ones, and is scored on rebuilding the hidden ones. hides most input patches, encodes the visible ones and predicts the hidden ones. Video is very redundant: a patch hidden in one frame is usually visible in the next. So video masking hides the same patch locations across neighboring frames, tube maskingTube maskingHide the same patch locations across neighboring frames, so a model can't fill a hole by copying the next frame., and hides a lot of them.

The encoder sees only the visible tubeletsTubeletA small block of pixels spanning a few frames, flattened and projected into one token for a video transformer., so a high masking ratio also makes pretraining much cheaper.

02

VideoMAE: score only what was hidden

Read
Reference · VID024 · Runs as a notebookVideoMAEMasks a large proportion of video tubelets and reconstructs the missing content from visible tokens. Temporal redundancy makes high masking ratios feasible;

VideoMAE predicts the hidden tubelets' pixels with a light decoder and scores only those:

L=1∣M∣∑i∈M∥D(E(xMˉ),i)−xi∥2.L = \frac{1}{|M|} \sum_{i \in M} \big\lVert D(E(x_{\bar M}), i) - x_i \big\rVert^2 .

In the reference's toy, four tubelets have prediction errors of different sizes, but only the two masked ones count: the loss is 0.10. The large errors on visible tubelets don't enter. After pretraining the decoder is thrown away and the encoder fine-tuned.

03

Why so much masking?

Predict

Predict first

Masked language models hide around one word in seven. Video masked autoencoders often hide nine patches in ten. Why does video need so much more?

Masking that much makes the task impossibleVideo is redundant: with low masking, hidden patches are easy to copy from neighborsHigh masking only saves memory
Reveal

Redundancy. With little masking, a hidden patch can be filled in by copying the same spot from the next frame, which teaches nothing. Hiding most tubes forces the model to use what it knows about objects and motion. Short or rare events may need less masking; it isn't a universal setting.

04

MaskFeat: predict edges instead

Read
Reference · VID026 · Explained hereMasked Feature Prediction (MaskFeat)Learns video representations by predicting features of masked regions, notably histogram-of-oriented-gradient targets.

Predicting raw pixels rewards getting texture and noise right. MaskFeat predicts a fixed description of each hidden region instead: a histogram of oriented gradientsHistogram of oriented gradientsCounts of edge directions in small cells of an image, weighted by edge strength and normalized., counts of edge directions weighted by edge strength.

In the reference's toy, four gradients fall into four direction bins; after normalization the target is 0.756, 0.535, 0.378 and 0. HOG keeps local shape and drops color, which may be exactly what a downstream task needs, or not.

05

V-JEPA: predict features, not pixels

Read
Reference · VID025 · Explained hereV-JEPAPredicts missing video regions in a learned representation space rather than reconstructing pixels. A target encoder supplies latent targets, and a predictor uses visible context to estimate them, aiming to retain…

V-JEPA, a joint-embedding predictive architectureJoint-embedding predictive architecturePredicts the representations of hidden regions, from a slow target encoder, instead of their raw pixels., predicts the hidden regions' features from a target encoder:

L=1∣M∣∑i∈M∥P(E(xMˉ),i)−sg(Etarget(x)i)∥1.L = \frac{1}{|M|}\sum_{i \in M} \big\lVert P(E(x_{\bar M}), i) - \mathrm{sg}\big(E_{\text{target}}(x)_i\big) \big\rVert_1 .

sg\mathrm{sg} stops gradients into the target, and the target encoder is a moving averageWeight averaging (EMA and SWA)Uses an average of the weights seen during training instead of the last ones; averages often generalize better. of the context encoder. In the reference's toy, predicted and target features differ by a mean absolute 0.10. Predicting features lets the model ignore unpredictable detail; it isn't a forecast of the future with calibrated uncertainty.

06

VideoMAE V2 and InternVideo

Read
Reference · VID027 · Explained hereVideoMAE V2Extends video masked autoencoding with dual masking: the encoder sees a sparse visible subset, and the decoder processes a selected subset rather than every possible token.

VideoMAE V2 masks the decoder too: the encoder sees a sparse visible set and the decoder reconstructs only a chosen subset of hidden tubes. In the reference's toy, the encoder sees tokens 0, 4 and 8; the decoder targets 1, 3, 6 and 10, with no overlap.

Reference · VID028 · Explained hereInternVideoCombines complementary generative and discriminative video-learning objectives to build broadly useful video representations.

InternVideo combines a masked-video loss with contrastive alignment to text. In the reference's toy the two terms are 0.01 and 0.170. Captions make it weakly supervisedWeak supervisionTraining with imperfect labels: coarse, indirect, noisy or written by rules. More of them doesn't remove a shared bias., not label-free.

07

A low loss isn't the result

Read
  • Report transfer: action recognition with the encoder frozen and fine-tuned. Reconstruction error alone says how well pixels were copied.
  • Ablate the parts: masking ratio, target type, dual masking, against matched data and compute. VideoMAE V2 is more than a bigger VideoMAE, so separate its design from its scale.
  • Check overlap between pretraining videos (and captions) and the test sets.
  • Name the supervision: pixels or features (self-supervised) versus captions (weak labels).
08

What runs here

Read
EntryIn CodeSplash
VID024 · VideoMAERuns as a notebook (the reference program; no method)
VID025 · V-JEPAExplained here
VID026 · Masked Feature Prediction (MaskFeat)Explained here
VID027 · VideoMAE V2Explained here
VID028 · InternVideoExplained here
09

Check: masked video modeling

Checkpoint

Check yourself

Which tubelets does VideoMAE's loss score?

Show the answer

Answer: b

The model is graded on what it couldn't see; errors on visible tubelets don't count.

Check yourself

Why does VideoMAE hide the same patch location across neighboring frames?

Show the answer

Answer: a

Tube masking removes the easy copy-from-neighbor shortcut.

Check yourself

A VideoMAE run reports a very low reconstruction error. What should you ask for next?

Show the answer

Answer: b

Reconstruction measures copying. Transfer measures usefulness.

Check yourself

What does V-JEPA predict for hidden regions?

Show the answer

Answer: b

Feature targets let the model skip unpredictable texture. The stop-gradient and moving average keep the target stable.

Check yourself

V-JEPA predicts features of masked future regions. Is it a calibrated forecaster of what will happen?

Show the answer

Answer: b

Latent prediction isn't a distribution over outcomes. Evaluate it with probes and transfer.

Check yourself

What does MaskFeat predict for each masked region?

Show the answer

Answer: a

A fixed, hand-designed target that keeps local shape and drops color and fine texture.

Check yourself

How would you show HOG targets beat pixel targets?

Show the answer

Answer: b

Losses on different targets aren't comparable. Downstream results at matched budgets are.

Check yourself

What does VideoMAE V2's dual masking add?

Show the answer

Answer: b

The encoder sees few visible tubes and the decoder reconstructs a selected subset, so memory drops.

Check yourself

VideoMAE V2 beats VideoMAE after training on more data with more compute. What do you need before crediting dual masking?

Show the answer

Answer: a

Design and scale changed together. Only an ablation tells them apart.

Check yourself

InternVideo combines masked-video and video–text contrastive training. How should its supervision be described?

Show the answer

Answer: b

Captions are labels of a kind, noisy and cheap. Say which data and modules each result uses.

Check yourself

InternVideo reports one combined loss falling during training. What should you look at before trusting it?

Show the answer

Answer: b

A total can fall while one term worsens, and not every stage trains both terms. Report which data and modules each result uses.

10

Recap

Recap
  • Video tolerates heavy masking; tube masking stops copying from neighboring frames.
  • Targets differ: pixels (VideoMAE), HOG (MaskFeat), target-encoder features (V-JEPA).
  • VideoMAE V2 masks the decoder too; InternVideo adds text, so it is weakly supervised.
  • Judge by transfer and ablations at matched compute, not by reconstruction error.

Concepts in this lesson