Programmatic multimodal memory reads long videos using code
Programmatic Multimodal Memory: Learning to Read Long Videos with Code
Computer Vision and Pattern Recognition
Summary
Watching very long videos to find small answers is hard for current AI because they have to pick what to remember before seeing the question. The authors made a system called PMM that stores everything in an organized way without losing details, then uses a special AI that writes and runs code to find the exact information needed. Their method looks back at data many times, checking captions, transcripts, and video frames as needed. By teaching the AI with example answers and rewards, their system works better than others on questions about very long videos.
What this means in practice
- •For video analytics engineers: Build systems that extract precise evidence from days-long videos by programmatically querying multi-scale memory without pre-consolidating data.
- •For personal assistant developers: Develop AI assistants that answer detailed questions about extensive personal video recordings by interactively reading captions, transcripts, and frames.$Commercial implications: Enables advanced AI personal assistants capable of efficient long-term video search, improving user interaction with personal media archives.
Authors
Xuanming Shang, Yuhang Han, Yan Shu, Dingning Liu, Li Ding, Tao Qiang, Zhiqi Shao, Zequn Yang, Yanfeng Wang
Abstract
Answering questions about hours- or days-long videos requires finding a few seconds of evidence in recordings far longer than any model can read at once. Most memory systems decide what matters at write time. Before any question arrives, they consolidate the video into compressed memory banks or structured graphs and lose details that later questions need. We instead defer this decision to read time. Programmatic Multimodal Memory (PMM) writes a multi-scale temporal memory of timestamped captions and transcripts once, without consolidation, and keeps it aligned with the raw video. Single-round retrieval misses much of the evidence, so a Root model reads this memory with code over multiple turns in a persistent Python REPL. Its programs filter records across days, query a frozen submodel in batches, and inspect raw frames on demand. The Root now decides what matters, yet small open-weight models struggle zero-shot to coordinate code search and frame inspection. We therefore train Qwen3.5-9B as the Root in this REPL with evidence-grounded supervised fine-tuning and outcome-reward reinforcement learning. The resulting PMM-9B gains 12.1 points over its zero-shot version and outperforms every open-source model and agent baseline on all five personal-memory and long-video benchmarks. It also beats standalone GPT-5 and Gemini 2.5 Pro on average, and by nearly 20 points on week-long EgoLifeQA. Open-source baselines that use more input tokens per question than PMM-9B are all less accurate, and those that use fewer score at least 16.6 points lower. Project page: https://shadow-weave.github.io/PMM/.