Introduction
Extracting optical flow—the precise pixel-level motion between video frames—remains a foundational challenge in computer vision. Researchers from Stanford University have introduced KL-tracing, a novel zero-shot method that extracts high-quality optical flow from frozen generative video models without any fine-tuning. By injecting a tiny "tracer" perturbation into a frame and measuring the Kullback–Leibler (KL) divergence of the model's predicted distributions, KL-tracing can track motion through complex, real-world scenarios where traditional methods often fail.
The Optical Flow Dilemma
Current approaches to optical flow generally face a "pick your poison" dilemma:
- Supervised Models: Because human-annotated, real-world optical flow data is nearly impossible to obtain at scale, these models are typically trained on synthetic datasets. This creates a "sim-to-real gap," causing models to struggle with real-world complexities.
- Self-Supervised Models: These methods rely on heuristics like "photometric consistency," assuming a pixel's color remains constant as it moves. These heuristics easily break down during lighting changes, occlusions, or when tracking textureless regions.
Motivated by the recent success of large, general-purpose models, the authors ask: Can we leverage the "world knowledge" embedded inside massive generative video models? Since these models are trained on millions of real-world videos to predict future frames, they must implicitly understand the physics of how objects move.
Methodology: KL-Tracing
To extract this implicit knowledge, the authors developed KL-tracing, building on the "perturb-and-track" concept from the Counterfactual World Model (CWM) paradigm. The inference procedure works in three steps:
- Inject a Tracer: A tiny, white Gaussian perturbation (a "dot") is added to a specific query point in the first frame ($F_1$).
- Dual Rollout: Both the original "clean" $F_1$ and the "perturbed" $\tilde{F}_1$ are fed into a frozen video model. The model predicts the next frame, conditioned on patches from the actual second frame ($F_2$).
- KL-Divergence Comparison: Instead of comparing the visual difference in the resulting RGB images—which can be noisy due to generative sampling—the method compares the logits (raw probability distributions) predicted for each patch. By calculating the KL-divergence between the clean and perturbed distributions, the model pinpoints exactly where the tracer moved.
The "Goldilocks" Architecture: LRAS
The researchers discovered that successful zero-shot flow extraction requires three specific model properties:
- Distributional Prediction: The model must predict a probability distribution of future frames to avoid blurry or noisy average outputs.
- Local Tokenization (Factorized Latents): Each spatio-temporal patch must be treated independently so a localized edit doesn't unpredictably alter the entire image.
- Random-Access Decoding: The model must be able to condition its predictions on any arbitrary subset of future pixels.
The recently introduced Local Random Access Sequence (LRAS) architecture uniquely meets all three criteria, significantly outperforming other popular models like Stable Video Diffusion (SVD).
Experimental Setup and Key Findings
The method was evaluated on the real-world TAP-Vid DAVIS benchmark (featuring human-annotated point tracks and occlusions), the synthetic TAP-Vid Kubric dataset, and various in-the-wild internet clips.
- Logit Space over RGB Space: Comparing probability distributions via KL-divergence proved far more robust than comparing generated pixels. It effectively bypasses the "sampling noise" inherent in generative models, focusing instead on the model's underlying intent.
- Physics over Appearance: Because LRAS acts as a "world model," it resolves motion based on physical reasoning rather than mere appearance. For instance, in a Newton’s Cradle video where all balls look identical, KL-tracing correctly tracks momentum transfer, whereas appearance-based models fail.
- Competitive Zero-Shot Performance: On the TAP-Vid DAVIS benchmark, LRAS with KL-tracing achieved an Average Jaccard (AJ) of 44.16, significantly outperforming the original CWM (15.00) and surpassing specialized unsupervised models like SMURF (30.64).
- Error Reduction: When measuring Endpoint Error (EPE) on a subset of DAVIS, KL-tracing achieved a remarkable 5.07, compared to 74.79 for Stable Video Diffusion, underscoring the importance of the base architecture.
Limitations and Future Directions
While KL-tracing proves that zero-shot flow extraction is viable without specialized "flow heads" or fine-tuning, it currently faces computational bottlenecks. The process requires propagating interventions point-by-point, making it too slow for real-time applications. Furthermore, the technique relies heavily on the specific properties of the LRAS architecture and is not yet a plug-and-play solution for all video generators.
Looking forward, the authors suggest that the high-quality flow extracted via KL-tracing could serve as "pseudo-labels" to train smaller, faster, specialized flow models—potentially bridging the sim-to-real gap. Additionally, this "perturb-and-track" approach could be extended to extract other physical properties, such as object segmentation, depth, or movement affordances.
Summary updated