Welcome to this course on video diffusion models. We begin with the objectives and structure that will carry you from denoising fundamentals to training and conditioning a latent video transformer.
First, we fix the learning outcomes. You should leave able to explain the core architectures, from the diffusion backbone to the variational autoencoder, and to reason rigorously about practical video synthesis.
Central to the course is the LTX architecture, a latent diffusion transformer for video. We will study how iterative denoising in a compressed spatiotemporal latent space yields efficient, high-fidelity generation.
We also treat shot composition and motion control as first-class modeling concerns, since temporal conditioning and camera trajectories decide whether generated footage reads as coherent cinema or flickering noise.
By the end of this session you will hold a map of the territory: latent diffusion, transformer backbones, and controllable generation, the conceptual foundation for every module that follows.
Equations, code and original cards
Video Diffusion Models: Course Introduction & Objectives
Course Goals & Structure
• Specify measurable learning outcomes • Module progression: theory to deployment • Emphasize applied generative modeling
LTX Architecture
• Latent diffusion transformer backbone • Compressed spatiotemporal latent space • Iterative denoising for temporal coherence
Shot Composition & Motion
• Visual framing as a conditioning signal • Camera and motion control techniques • Direct impact on perceptual video quality
Moment 02 / 13
Fundamentals of LTX Architecture
LTX is a latent video diffusion system built around a transformer backbone: patchified spacetime tokens are denoised under a learned score objective, with efficiency as a first-order design constraint.
The backbone is DiT-like: self-attention and feed-forward blocks operate over latent tokens that encode space and time jointly, so temporal coherence is modeled inside the residual stream rather than appended afterward.
A single network is conditioned for text-to-video and image-to-video: language embeddings steer semantics, while a reference image constrains appearance, motion initialization, and the effective receptive field of early frames.
Training these tasks jointly shares attention parameters across conditioning signals, improving sample efficiency and exposing the model to paired textual, visual, and temporal structure instead of three disjoint datasets.
The operating point is set by clip duration, spatial resolution, and latency; attention cost grows roughly quadratically in token count, so longer or sharper videos demand fewer tokens, caching, or approximate attention.
The design lesson is that quality per compute matters more than peak quality: gradient noise, tokenization, and scheduler choices can dominate a nominally larger transformer at fixed latency.
In short, LTX couples a DiT-style spatiotemporal transformer with shared multimodal conditioning, then tunes token count, resolution, and denoising steps to meet a practical latency budget.
Equations, code and original cards
LTX Architecture: Latent Video Transformer
• DiT-style backbone over spacetime latent tokens
• Shared conditioning for text-to-video & image-to-video
• Operating point: duration, resolution, latency under quadratic attention cost
Moment 03 / 13
Mathematical Formulations I: Matrix Operations
We open with the matrix algebra underlying transformer computation, centering on the multi-head attention mechanism of Vaswani et al. 2017.
The input X is right-multiplied by three learned projection matrices, yielding queries, keys, and values of reduced dimension d-k. These projections carry every parameter; the attention core is parameter-free.
Attention is softmax of Q K transpose over the square root of d-k, times V. Scaling by root d-k keeps the pre-softmax logits near unit variance, preventing saturation and vanishing gradients.
Each head applies its own projections and computes attention independently, so the h heads occupy distinct representation subspaces rather than redundant copies of one.
The head outputs are concatenated and passed through the output projection W O, mixing information across subspaces; total compute stays order n-squared d, dominated by the pairwise score matrix.
In short, multi-head attention is a differentiable routing mechanism: content-based, permutation-equivariant, and parallel across heads, precisely the inductive bias that replaced recurrence.
Equations, code and original cards
Mathematical Formulations I: Attention as Matrix Algebra
Multi-Head Attention: Structure
• h parallel heads, concatenation, then output projection
• All expressivity from learned linear maps
Query, Key, Value Derivation
• Q = XWQ, K = XWK, V = XWV
• Learnable parameter matrices
• Dimensionality: dmodel → dk / dv
\mathrm{Attention}(Q,K,V) = \mathrm{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right) V
Moment 04 / 13
Mathematical Formulations II: Gradient Derivations & Loss Functions
We continue our treatment of the mathematics, turning now to gradient derivations and the loss objectives used to train video diffusion models in the denoising diffusion framework of Ho and colleagues.
First, the losses. The core signal is the noise-prediction objective, the expected squared error between true and predicted noise, augmented by perceptual and temporal coherence terms that suppress flicker across frames.
Next, gradient derivations. Backpropagation through attention requires the row-wise softmax Jacobian, and the chain rule through each feed-forward sublayer; monitoring gradient norms here is what keeps optimization stable.
We then turn to the optimization objective: expected denoising loss minimized with AdamW, whose decoupled weight decay avoids distorting the adaptive gradient scaling, alongside gradient clipping for stability.
Finally, the worked derivations: we compute the softmax Jacobian, output i with respect to logit j, and chain it through the attention weights, whiteboard style.
To summarize: loss design and gradient computation are inseparable. The denoising objective, a reweighted variational bound, is differentiable end to end, so backpropagation through attention, feed-forward, and normalization layers delivers the gradients that drive training. These derivations are the mathematical backbone of every video diffusion system.
Equations, code and original cards
Mathematical Formulations II: Gradient Derivations & Loss Functions
Let's dissect multi-head self-attention through this simulation. Begin by observing how residual stream embeddings are projected into queries, keys, and values, and how those projections shape the attention logits before softmax normalization.
Next, vary the query, key, and value projections and observe the effect. Attention logits are Q K transpose over the square root of d-k, so rescaling these matrices sharpens or flattens the softmax distribution over positions.
Now apply the gradient preset to visualize backpropagation through attention. Track how the loss gradient flows backward through the softmax, through the value-weighted sum, and into the query, key, and value projections via the chain rule.
Finally, sweep each slider independently and observe the effect on attention weights and gradient magnitudes. Note how perturbations propagate through the Jacobian of the softmax and reshape the effective receptive field of each head.
Equations, code and original cards
Moment 06 / 13
Shot Composition Principles
Today we examine shot composition in video diffusion models, focusing on how prompt language and pacing priors shape the temporal structure of generated sequences.
First, distinguish prompt-driven pacing from render settings. Prompt-driven pacing lets the text condition shot timing through the denoising trajectory, whereas render settings impose fixed parameters independent of the conditioning signal.
Notice the shot types listed here: establishing shots, cuts, and pans. These are the fundamental primitives of narrative flow, and the model must allocate temporal receptive fields across them.
It is essential to script shot descriptions formatively before generation, because precise conditioning language steers the sampler toward the desired camera trajectories and framing distributions.
Pay special attention to how the coupling between prompt tokens and shot motion determines the dynamism of the resulting video; vague conditioning yields high-variance, incoherent motion.
In summary, by carefully engineering prompt language and understanding pacing controls, we can bias video diffusion models toward coherent, purposeful shot sequences rather than unstructured motion.
Equations, code and original cards
Shot Composition Principles
• Prompt-driven pacing vs fixed render settings
• Shot primitives: establishing shots, cuts, pans
• Script shot descriptions before sampling
• Prompt conditioning shapes shot motion dynamics
Moment 07 / 13
Motion Control Techniques
Today we examine motion control in LTX-Video: how camera trajectories are specified as conditioning signals and injected into the diffusion backbone alongside text embeddings.
Start with the canonical motion specifiers. A static camera fixes the extrinsic matrix; a slow dolly applies smooth longitudinal translation along the optical axis; an orbit rotates the camera around a focal point, varying azimuth while holding radius constant.
Trajectory conditioning generalizes these primitives: cubic Bezier curves in three-dimensional space parameterize the camera path, and the control points give smooth, differentiable transitions between keyframes.
Integrating these controls into the LTX-Video pipeline bridges cinematographic grammar with learned synthesis, conditioning the denoising process so motion remains coherent across frames rather than emerging stochastically.
Consider an example prompt where motion directives are embedded directly in the instruction, steering camera behavior during generation without any explicit trajectory tensor.
The takeaway: camera specifiers and trajectory conditioning are the control interface between directorial intent and the generative model, and mastering them is prerequisite for coherent visual narrative.
Equations, code and original cards
Motion Control Techniques
Camera trajectory conditioning in the LTX-Video diffusion pipeline
• Canonical motion specifiers:
- Static camera (fixed extrinsics)
- Slow dolly (longitudinal translation)
- Orbit (azimuth sweep, fixed radius)
• Trajectory inputs: 3D cubic Bezier control points
• Conditioning the denoising pipeline on motion signals
• Prompt-embedded motion directives
Moment 08 / 13
Advanced Techniques & Optimizations (2024-2026)
We turn to the frontier: scaling and optimization of video diffusion transformers as it stands through 2024 and into 2026. The agenda is compute-optimal scaling, memory and throughput engineering, and temporal-consistency alignment.
First, scaling laws. The Chinchilla finding, roughly twenty tokens per parameter, transfers to video only after accounting for patchified spacetime tokens; a one-second clip at moderate resolution already yields tens of thousands of tokens, so attention cost grows quadratically and capacity must grow with it.
Second, efficiency engineering. Video diffusion transformers run attention over space and time jointly, so practitioners adopt FlashAttention-style exact attention with tiling, grouped-query attention to shrink the key-value cache, and activation checkpointing, which trades roughly a third more compute for an order-of-magnitude VRAM reduction.
Third, temporal alignment. Naive frame-independent sampling flickers because each frame is an independent draw from the marginals. The fix is joint modeling: causal or full attention across the time axis, temporal layers in the denoiser, and flow-matching objectives that couple consecutive latent frames.
The synthesis is clear: compute-optimal scaling, memory-aware kernels, and explicit temporal coupling are converging into a single recipe, yielding video diffusion models that scale parameters and context length without losing frame-to-frame coherence.
Consider the consequence: once temporal consistency and VRAM ceilings are engineering problems rather than research problems, the bottleneck for AI video shifts to data quality and evaluation, which is where the next generation of systems will be decided.
Equations, code and original cards
Advanced Techniques & Optimizations (2024-2026)
• Compute-optimal scaling for video DiTs: spacetime patch tokens, Chinchilla-style ratios
• Open frontier: data quality and evaluation as the new bottleneck
Video diffusion at the frontier: compute-optimal scaling, memory-aware kernels, and temporal coupling
Moment 09 / 13
Implementation Details: Python & PyTorch Snippets
We now turn to the implementation layer, working directly in Python and PyTorch. These snippets expose the mechanics behind attention, the training objective, motion conditioning, and throughput optimization.
We begin with scaled dot-product attention, the core operation from Vaswani et al. It forms softmax weights over query-key similarities so each position aggregates value vectors from the relevant context.
This function computes logits as Q K transpose scaled by one over the square root of d-k, applies the causal mask by filling disallowed positions with negative infinity, then normalizes with softmax before the weighted sum.
The objective is cross-entropy over the vocabulary, the negative log likelihood of the correct token under the softmax distribution. PyTorch's CrossEntropyLoss fuses log-softmax with that loss for numerical stability.
The loop is standard: forward pass to logits, loss, backward to populate gradients, then an optimizer step. What you actually monitor is the gradient norm and its stability across steps.
Motion conditioning injects temporal control into the generative process. The encoder maps motion signals into an embedding that biases the latent dynamics, sharpening sensitivity to trajectory and timing.
Here the motion embedding is concatenated with the latent code along the feature axis, so the decoder conditions every generated frame on both content and dynamics.
For throughput, use automatic mixed precision to run matrix multiplies in half precision while keeping softmax and layer normalization in full precision, and cache static tensors to avoid redundant work.
The takeaway: attention routes information, cross-entropy shapes the logits, conditioning steers generation, and systems choices like mixed precision decide whether training is economically feasible.
• Mixed precision: half-precision matmuls, full-precision softmax and norms
• Cache static tensors; never recompute constants per step
• Warm up the learning rate; ramp batch size for stability
• Prefetch and pin memory to keep the GPU saturated
Moment 10 / 13
Production Realities & Practical Usage
Let's examine the production realities of video diffusion models: what is achievable today, and which failure modes dominate when these systems are deployed in real pipelines rather than benchmark demos.
Generated clips remain limited to a few seconds. Longer horizons suffer autoregressive error accumulation and drifting temporal coherence, which caps subject complexity and narrative depth, but this is a workable starting point.
Stylized aesthetics are feasible and stable. Photorealistic faces and accurate lip-sync remain hard: the model must capture sub-pixel facial dynamics, and small errors around the mouth are perceptually glaring.
Studios exploit the model's strengths while engineering around its gaps, biasing pipelines toward stylized effects and covering realism failures with hybrid workflows, manual refinement, and domain-specific fine-tuning.
Research now targets coherent narratives beyond one minute: longer temporal context, persistent identity, and memory-augmented attention. Success here would unlock genuinely new modes of AI-driven storytelling.
In summary, today's video diffusion supports short, stylized clips while the field pushes toward longer, semantically coherent narratives. Knowing where the models fail is what lets you deploy them where they succeed.
Equations, code and original cards
Production Realities & Practical Usage
• Clip length limited to seconds-scale horizons
• Complex multi-subject scenes remain challenging
• Tradeoff: temporal coherence vs. per-frame fidelity
Let's examine frontier variants and open problems in AI video diffusion: latent diffusion backbones, diffusion Transformers, and the evaluation gaps that still block reliable long-form synthesis.
First, emerging architectures couple denoising with stronger sequence models: diffusion Transformers replace convolutional U-Nets, while latent diffusion keeps computation tractable by modeling compressed video tokens.
Multi-character consistency remains unresolved: identity embeddings must persist under occlusion, viewpoint drift, and stochastic sampling, so attention needs entity-level memory rather than frame-wise appearance cues.
Lip-sync and dialogue demand audiovisual alignment: phoneme-conditioned latents, cross-attention to speech features, and perceptual losses must reduce mouth jitter without over-smoothing expression.
Progress also depends on community infrastructure: shared datasets, leakage-resistant benchmarks, ablation protocols, and reproducible metrics for temporal coherence, identity drift, and sample efficiency.
In short, the field is moving toward hybrid latent and Transformer designs, entity-aware consistency, and tighter audiovisual grounding; mastering these open problems positions you to contribute credibly.
Equations, code and original cards
Frontier Variants & Open Problems in Video Diffusion
DiT, Latent Video Diffusion, Consistency, and Audiovisual Grounding
• Hybrid backbones: DiT-style attention with latent diffusion and temporal causal masking
• Open problem: entity-level identity memory under occlusion, viewpoint drift, and sampling noise
• Needed infrastructure: leakage-resistant benchmarks, ablations, temporal and identity metrics
Moment 12 / 13
Challenging Knowledge Quiz
Now let's probe your grasp of the material we just covered. Work through each question carefully and independently; these target the key mechanisms, not surface recall.
Once you've submitted your answers, we'll walk through them together, diagnose any misconceptions, and consolidate your understanding.
Equations, code and original cards
Moment 13 / 13
Course Summary & Further Reading
Let's consolidate the LTX architecture: a latent video diffusion transformer that factorizes shot composition into spatial and temporal attention blocks. Operating in a compressed VAE latent space, it achieves efficient synthesis while preserving flexible conditioning control.
For primary sources, start with the LTX-Video repository from Lightricks and OpenAI's Sora technical report. Together they give you a reference implementation and the systems-level context behind large-scale video diffusion.
Beyond that, work through Ho et al. on denoising diffusion, Rombach et al. on latent diffusion, and Peebles and Xie on diffusion transformers. These papers anchor the theory underlying modern video synthesis.
Looking ahead, the next modules tackle controllable and real-time video diffusion, then multimodal conditioning. Each builds directly on the latent-space formulation and transformer backbone we established today.
To recap: you now have the architecture, the primary sources, and the roadmap. Treat the linked repository and papers as required reading, since the assignments assume you can reproduce and ablate these pipelines rather than merely describe them.
Equations, code and original cards
Course Summary & Further Reading
Summary of LTX Architecture
• DiT backbone with factorized spatial-temporal attention • Video VAE latent space for compute-efficient synthesis • Cross-attention conditioning for text and image control
Key References
• LTX-Video repository, Lightricks • OpenAI Sora technical report • API documentation and reproducible demos
Recommended Reading
• Ho et al. 2020, Denoising Diffusion Probabilistic Models • Rombach et al. 2022, Latent Diffusion Models • Peebles & Xie 2023, Diffusion Transformers
Next Modules Preview
• Controllable and real-time video diffusion • Guidance, distillation, and efficient sampling • Multimodal conditioning and joint generation
MAKE IT YOURS
Explain the change.
References, scope & corrections
Research snapshots in the source material are not a claim of current state of the art. The reference review corrects identified errors; it is not exhaustive certification of every historical statement. Source code snippets are examples, not a tested production training system.