Skip to content

Video understanding, tracking, generation, and world models · Video-language learning · VID045 · Model

X-CLIP

Expands language-image pretraining for video recognition through cross-frame communication and video-conditioned language prompting.

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Expands language-image pretraining for video recognition through cross-frame communication and video-conditioned language prompting. It adapts both temporal evidence and text representations to the specific video, rather than relying solely on independently pooled image features.

Question / objective

Align video evidence with language for retrieval, recognition, captioning or grounded answers. This is a learning or inference objective, not a test of a statistical null hypothesis.

Method type and supervision

model · Video-language learning. Weak paired video/text pretraining and/or supervised instruction learning, depending on the entry.

Architecture / computational structure

Cross-frame visual communication plus a video-conditioned text prompting mechanism.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. Class wording changes predictions. Video-conditioned prompts can exploit training classes and may not transfer equally to truly novel labels; zero-shot protocol must exclude label-specific fitting.

Formula / computational definition

p(c∣V)∝exp⁡(s(v(V),t(c;V))/τ)p(c\mid V)\propto\exp(s(v(V),t(c;V))/\tau) compares a video embedding with class-text embeddings conditioned on that video. Cross-frame attention contributes temporal information to v(V)v(V).

Parameters and notation

Learned/estimated quantities: Modality encoders, connectors, projections and language-model weights may be learned or frozen according to the stated stage; token IDs and timestamps are inputs. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Frame count, cross-frame module, prompt configuration, class-name templates, temperature and tuning scope are important.

Fitting, fine-tuning, and adaptation

Tune prompt and temporal modules before unfreezing the image-language backbone. Freeze class templates during final testing; new-class evaluation requires genuine separation from tuning labels. Use a separate adaptation validation split, monitor the target metric and retention of previously useful behavior, and save the exact preprocessing and training configuration.

How to use and calibrate

Fix the input protocol and target before fitting; choose design settings on held-out source videos, then freeze the evaluation procedure. Report standard and zero-shot action accuracy with exact label templates and split definitions; include temporal-module ablations.

Example application

Classify a video by comparing it with text descriptions of actions.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Report standard and zero-shot action accuracy with exact label templates and split definitions; include temporal-module ablations. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Condition class-text vectors on a toy video context. Dependencies: NumPy in Python; base R in R; run the shared setup above. Python component: executed successfully. R component: unexecuted. No complete model training or pretrained inference was executed.

Full implementation route — Python: Reproduce the paper's cross-frame and prompt modules around a compatible image-text backbone. R: Compute class similarities and prompt sensitivity in R; use reticulate for the adapted visual-language network.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — Condition class-text vectors on a toy video context.

Shared setup for this chapter
import numpy as np

def softmax(x):
    z = np.asarray(x, dtype=float)
    e = np.exp(z - z.max())
    return e / e.sum()
video = np.array([.8,.2]); class_text = np.array([[1.,0.],[0.,1.]])
prompt_delta = np.array([[.1,-.1],[-.1,.1]])*video
conditioned = class_text+prompt_delta
conditioned /= np.linalg.norm(conditioned,axis=1,keepdims=True)
print("conditioned similarities",conditioned@video)
# Toy adapter arithmetic, not the published cross-frame/prompt network.
R

Component demo, not a trained model — Condition class-text vectors on a toy video context.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
video <- c(.8,.2); class_text <- diag(2)
delta <- sweep(rbind(c(.1,-.1),c(-.1,.1)),2,video,"*")
conditioned <- class_text+delta
conditioned <- conditioned/sqrt(rowSums(conditioned^2))
print(conditioned%*%video) # toy video-conditioned text adapter

Sources

From the CodeSplash reference, entry VID045.