Within-Shot Memory Re-Injection for Immediate Attribute Updates
A method that dynamically re-injects updated memory states mid-shot once a prompt arrives, ensuring instant reflection of newly stated persistent changes rather than waiting for subsequent shots.
Time
Compute level
Resources
What the paper used
Prerequisites
Scope
The Gap
The memory is built and prefilled before the prompt of the current shot arrives due to real-time constraints (C1), which means a persistent change stated for the first time in the current prompt cannot be rendered into the memory images until the following shot.
“A persistent change that the current prompt states for the first time, such as a character shaving, is not yet in the memory images of that shot, which can keep the earlier look until the agent has drawn the change for the following shots.”
Limitation
Because memory images are generated prior to the prompt arrival, newly introduced persistent changes (such as a character starting to shave or changing clothes) are missing in the current shot's memory sink, causing a one-shot lag in visual state representation.
Proposed Solution
Design an auxiliary real-time adapter or fast in-context key-value patching mechanism that injects updated entity cards or partial visual edits into the active generation stream immediately after prompt parsing, bypassing full pre-generation pipelines.
The paper’s authors list this direction as future work, so they may already be pursuing it.
Why This Matters
This is expected to eliminate temporal state lag for sudden plot twists and actions, raising fine-grained narrative consistency.
How to Get Started
How to test it: Test whether dynamic prompt-time KV updates reduce state error rates on sudden attribute changes in LongStory-Hard compared to the pre-baked memory baseline, measuring state accuracy via the VLM judge.
- Clone the released codebase and reproduce baseline metrics on LongStory-Online.
- Implement a script that intercepts prompt tokens upon arrival to identify newly declared entity changes.
- Construct a fast, lightweight attention-sink patching function to append text/visual tokens mid-generation.
- Benchmark the latency overhead against the strict real-time budget limits.
Code linked to this paper on Hugging Face: github.com/NVlabs/LongLive
Suggested by AI. Adapt it to your setup.
Has This Been Done?
Works like Models Take Notes at Prefill: KV Cache Can Be Editable and Composable and Matrix-Game 3.5: Enhancing Real-Time Streaming Interactive World Models with Patch Memory explore editable KV caches and patch memories for real-time generation streams. However, they do not specifically target immediate attribute updates via auxiliary real-time adapters or fast in-context key-value patching for entity cards as proposed.
- Models Take Notes at Prefill: KV Cache Can Be Editable and Composable · 2026 · 10 citations
- Matrix-Game 3.5: Enhancing Real-Time Streaming Interactive World Models with Patch Memory · 2026 · 30 citations
We searched OpenAlex and arXiv for “real-time KV cache patching diffusion model memory injection” and “Within-Shot Memory Re-Injection for Immediate Attribute Updates” and an AI compared the idea with the top 10 results. A small search can miss relevant work.
Source Paper
Agentic LongLive: Asynchronous Agentic Memory for Long Video GenerationShaoteng Liu, Shuai Yang, Wei Huang +3 more · 2026
The paper introduces Agentic LongLive, an asynchronous agentic memory framework that enables real-time autoregressive video generators to maintain long-term consistency across people, objects, and places without slowing down generation. It employs a separate memory agent running on dedicated GPUs to process revealed prompts ahead of time, committing text states and evolving entity images that are prefilled as attention sinks into the frozen generator. Evaluated on a new benchmark called LongStory-Online, the system significantly improves persistent state accuracy, protagonist identity, and location consistency while streaming faster than real time.
Related Ideas
- Text-Guided Multimodal Memory RetrievalStoryMem: Multi-shot Long Video Storytelling with Memory🟠Medium
- Persistent Identity Memory ModuleStable Video Infinity: Infinite-Length Video Generation with Error Recycling🟡Fairly easy
- Entity-Disentangled Memory via SegmentationStoryMem: Multi-shot Long Video Storytelling with Memory🔴Hard
- Motion-Adaptive Frame Sampling and Hierarchical Memory for Long-Horizon Egocentric CaptioningEgoCaptioner: Towards Comprehensive and Fine-Grained Egocentric Video Captioning🔴Hard
- Sliding-Window Attention with Global Context for Long-Form SynthesisLTX-2: Efficient Joint Audio-Visual Foundation Model🟠Medium