Current Video Foundation Models (VFMs) like Sora or Kling can generate breathtaking visuals, but they often stumble when asked to follow complex, multi-part instructions. If you ask for "four pandas munching bamboo" or "a robot and a sorcerer approaching each other," the models frequently lose count of the pandas or fail to coordinate the characters' movements.
A new paper from researchers at the National University of Singapore and other institutions introduces TTOM (Test-Time Optimization and Memorization), a framework that fixes these "compositional" failures during inference—without needing to retrain the massive base models.
TL;DR
TTOM is a training-free framework that improves text-to-video alignment by optimizing lightweight parameters (LoRA) during inference based on LLM-generated layouts. By introducing a "parametric memory" to store and reuse these optimizations, the system becomes more accurate and efficient as it processes a continuous stream of user prompts.
What Problem Does This Paper Address?
While VFMs are visually impressive, they suffer from text-video misalignment in compositional scenarios. This includes:
- Numeracy: Getting the number of objects wrong (e.g., generating three pandas instead of four).
- Spatial Relations: Placing objects in the wrong parts of the frame.
- Complex Motion: Failing to execute specific directional movements or interactions between subjects.
Existing solutions often try to "force" alignment by directly manipulating the model's internal math (latents or attention maps) for every single frame. However, this "brute force" approach often breaks the model's visual "flow," leading to flickering, artifacts, or complete video collapse. Furthermore, these methods are "forgetful"—every time you give the model a new prompt, it starts from scratch, ignoring everything it learned from previous successful generations.
Methods
TTOM introduces a two-pronged approach to solve these issues: Test-Time Optimization (TTO) and Parametric Memory.
- LLM Layout Planning: When a user enters a prompt, an LLM (like GPT-4o) acts as a "director," generating a spatiotemporal layout. This is essentially a set of bounding boxes showing where every object should be at every moment in the video.
- Test-Time Optimization (TTO): Instead of changing the base model's core weights, TTOM injects lightweight LoRA (Low-Rank Adaptation) parameters. During the first few steps of the video generation process, the model optimizes these LoRA weights using a Jensen-Shannon Divergence (JSD) loss. This loss ensures the model's internal "attention" aligns perfectly with the LLM's layout.
- Parametric Memory: This is the framework's "secret sauce." Once a video is successfully generated, the optimized LoRA weights are saved in a key-value memory bank. The "key" is a simplified abstraction of the prompt (e.g., "object moves left to right"), and the "value" is the set of optimized weights.
- Streaming Operations: TTOM treats video generation as a continuous stream. It can Read (reuse weights for similar prompts), Update (refine weights with more optimization), Insert (save new patterns), and Delete (remove old, unused patterns to save space).
Key Insights and Ideas
- Disentangling World Knowledge: One of the most surprising findings was that the optimized weights for a specific motion (like "drifting right to left") are often transferable. Weights optimized for a "red balloon" moving left can be reused to help a "robot vacuum" move left, suggesting the model is learning abstract concepts of motion rather than just memorizing pixels.
- Memory as a "Warm Start": Starting an optimization from a stored memory (a "warm start") is significantly faster and more effective than starting from scratch ("cold start"). It allows the model to achieve high-quality alignment in fewer steps.
- Layer-Specific Sensitivity: The authors found that not all layers in a Diffusion Transformer (DiT) are equally important for layout. By identifying and targeting only the "high-relevance" layers, they improved alignment without sacrificing visual fidelity.
Key Results
TTOM achieved massive performance boosts over state-of-the-art baselines like CogVideoX-5B and Wan2.1-14B on major benchmarks like T2V-CompBench and VBench:
- Overall Improvement: A relative improvement of 34% on CogVideoX and 14% on Wan2.1 for the T2V-CompBench average.
- Motion Mastery: In the "Motion" category, TTOM improved Wan2.1's score by a staggering 82.57%.
- Numeracy and Attributes: It saw a 107% improvement in dynamic attributes and a 15% boost in numeracy (getting the count right).
- Visual Quality: Unlike previous methods that degraded video quality to achieve alignment, TTOM actually improved overall consistency and quality scores on VBench.
Limitations and Future Work
- Inference Latency: While memory reuse helps, the initial optimization (TTO) still adds time to the generation process compared to a standard "one-shot" generation.
- Memory Management: As the memory bank grows, finding the "perfect" match among thousands of entries becomes a retrieval challenge. The authors currently use a "Least Frequently Used" (LFU) deletion policy, but more sophisticated "lifelong learning" strategies could be explored.
- LLM Dependency: The system is only as good as the layout generated by the LLM. If the LLM plans a physically impossible layout, the TTO process may struggle to reconcile it with the video model's internal logic.
Summary updated