StreamMem: Query-Agnostic KV Cache Memory for Streaming Video Understanding

Yanlai Yang, Zhuokai Zhao, Satya Narayan Shukla, Aashu Singh, Shlok Kumar Mishra, Lizhu Zhang, Mengye Ren · DOI

Abstract

StreamMem is a training-free, query-agnostic memory mechanism that enables Multimodal Large Language Models (MLLMs) to process long, streaming videos within a fixed memory budget. By utilizing chat template tokens as "proxy queries" to prune less relevant visual data and merging the remaining tokens into frame-level prototypes, StreamMem maintains a compact yet informative Key-Value (KV) cache. This approach achieves state-of-the-art performance on long-video benchmarks without requiring prior knowledge of user queries, making it ideal for real-time applications in robotics and wearable AI.

Introduction: The Challenge of Streaming Video

As AI moves toward real-time agents in smart glasses and robotics, MLLMs must process video "streaming"—where frames arrive sequentially and the total duration is unknown. The primary bottleneck is the Key-Value (KV) cache, which stores visual tokens for model reference. In long videos, this cache grows linearly, leading to Out-of-Memory (OOM) errors or exceeding the model's context window.

Existing solutions often fall short: offline methods cannot handle real-time streams, query-aware methods require a known question to compress data, and simple eviction (FIFO) strategies lead to the total loss of early video context. StreamMem addresses these issues by providing a fixed-size memory that preserves both fine-grained details and global context.

Methodology: The StreamMem Pipeline

StreamMem introduces a three-stage pipeline designed to keep the KV cache compact and informative without requiring expensive fine-tuning.

  1. Input Frame Filtering: To reduce initial computation, StreamMem calculates the cosine similarity between consecutive frames. Nearly identical frames, common in static scenes, are merged before being processed by the MLLM.
  2. Attention-Based Pruning (The Proxy Query Trick): To identify important visual tokens without a user question, StreamMem uses the model’s own chat template tokens (e.g., <|im_start|>assistant\n) as a proxy. MLLMs naturally assign high attention scores to salient visual features when preparing to generate a response. StreamMem retains only the "top-k" tokens with the highest scores.
  3. Frame-wise KV Merging: To prevent "complete forgetting," tokens not selected during pruning are aggregated into a single "prototype" token per frame via weighted averaging. This ensures a global summary is maintained alongside high-detail pruned tokens.
Overview of the StreamMem architecture (a) and the two-stage KV compression pipeline (b).

Additionally, the system utilizes YaRN (Yet another RoPE extensioN) to extend the model's context window, allowing it to handle the long temporal sequences inherent in streaming video.

Key Insights: Leveraging Internal Model Priorities

The core innovation of StreamMem is the "Proxy Query Trick." By treating chat template tokens as a pseudo-query, the system leverages the model's pre-trained priorities to filter data. This transforms a query-agnostic problem into a manageable selection task.

Heatmaps showing how chat template tokens attend to salient visual features, acting as proxy queries.

This hybrid memory approach—combining "sharp" pruned tokens with "blurry" global prototypes—allows the model to maintain a high-fidelity representation of the video history within a strict memory budget.

Evaluation and Results

The authors evaluated StreamMem across five major benchmarks, including offline reasoning tasks (MLVU, EgoSchema, VideoMME) and streaming-specific tasks (RVS-Ego, RVS-Movie).

  • Memory Efficiency: StreamMem maintains a fixed KV cache of just 6K tokens per layer, a fraction of the 50K+ tokens required by standard full-cache approaches for long videos.
  • State-of-the-Art Performance: On the MLVU benchmark, StreamMem (6K tokens) outperformed InfiniPot-V. In the RVS-Ego streaming benchmark, it achieved 57.6% accuracy, significantly surpassing simple eviction strategies (55.8%).
  • Robustness: The integration of YaRN scaling proved critical; removing it led to a significant drop in performance on holistic video tasks.

Limitations and Future Work

While StreamMem represents a significant advancement, it faces certain trade-offs. Any compression involves potential information loss, and the proxy query may occasionally discard details relevant to highly niche future questions. Future iterations could explore dynamic memory budgets that adjust based on video complexity or hierarchical memory layers for truly infinite video streams lasting hours or days.

Summary updated

BibTeX
@misc{yang2025streammem,
  author = {Yanlai Yang and Zhuokai Zhao and Satya Narayan Shukla and Aashu Singh and Shlok Kumar Mishra and Lizhu Zhang and Mengye Ren},
  title = {{StreamMem: Query-Agnostic KV Cache Memory for Streaming Video Understanding}},
  year = {2025},
  eprint = {2508.15717},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.15717},
}
Figure