Video understanding, tracking, generation, and world models · Video generation · VID055 · Model
Phenaki
Combines a causal video tokenizer with masked token generation to support variable-length, text-conditioned video, including changing text over time.
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
Combines a causal video tokenizer with masked token generation to support variable-length, text-conditioned video, including changing text over time. Token compression and iterative token prediction make longer sequences more tractable.
Question / objective
Learn a conditional distribution over videos, with useful visual quality, temporal coherence and controllability. This is a learning or inference objective, not a test of a statistical null hypothesis.
Method type and supervision
model · Video generation. Generative distribution learning, commonly with text/image conditioning; adversarial and token objectives differ.
Architecture / computational structure
Causal video tokenizer with iterative masked-token generation and continuation conditioning.
Assumptions
Inputs must satisfy the temporal, modality and annotation protocol described below. Extending duration can accumulate identity and scene drift. Causal tokenization alone does not guarantee causal generation, stable physical dynamics or fidelity to every prompt transition.
Formula / computational definition
predicts masked video codes, while a causal tokenizer represents frame history. Iterative sampling fills masked positions according to a chosen schedule.
Parameters and notation
Learned/estimated quantities: Tokenizer, denoiser/generator, temporal and conditioning weights are learned as applicable; sampled latents are random variables rather than fitted model weights. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Tokenizer compression, mask schedule, conditioning changes, context carried between segments and sampling temperature affect results.
Fitting, fine-tuning, and adaptation
Adapt token generation with a fixed tokenizer first; changing tokenizer semantics requires coordinated retraining. Validate longer continuations, not just the short clips used for tuning. 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. Evaluate long-range coherence, transition adherence, diversity and failure rate as duration increases, alongside short-clip quality.
Example application
Generate a sequence whose text conditioning changes across scenes.
Interpretation / pitfalls
Watch out
An optimized training objective or a favorable example does not establish generalization. Evaluate long-range coherence, transition adherence, diversity and failure rate as duration increases, alongside short-clip quality. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.
Python and R code examples
Component: Select confident masked tokens in an iterative filling step. 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 causal tokenizer and masked-token generator as separate components; document continuation context. R: Prototype masked categorical prediction and scheduled unmasking in R; bridge neural tokenization and generation when available.
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.
Component demo, not a trained model — Select confident masked tokens in an iterative filling step.
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()
tokens = np.array([1,-1,-1,0]); mask = tokens<0
probabilities = np.array([[.1,.8,.1],[.5,.3,.2]])
confidence = probabilities.max(axis=1)
chosen = confidence.argmax(); positions = np.flatnonzero(mask)
tokens[positions[chosen]] = probabilities[chosen].argmax()
print("partially filled sequence",tokens)
Component demo, not a trained model — Select confident masked tokens in an iterative filling step.
Shared setup for this chapter
softmax <- function(x) {
e <- exp(x - max(x))
e / sum(e)
}
tokens <- c(1L,-1L,-1L,0L); positions <- which(tokens<0)
probabilities <- rbind(c(.1,.8,.1),c(.5,.3,.2))
chosen <- which.max(apply(probabilities,1,max))
tokens[positions[chosen]] <- which.max(probabilities[chosen,])-1L
print(tokens)
Sources
- Source 1arxiv.org
From the CodeSplash reference, entry VID055.