无需训练即可实现流式视频问答,响应更快更省资源。
Streaming Video Question-Answering with In-context Video KV-Cache Retrieval
- 用滑动窗口注意力减少计算量,边看视频边处理
- 缓存关键帧信息并按需调用,避免重复编码
- 适合长视频实时问答,尤其适合部署在多设备场景
我们提出 ReKV,一种无需训练的新型方法,可实现高效的流式视频问答(StreamingVQA),无缝集成于现有视频大语言模型(Video-LLMs)。传统 VideoQA 系统在处理长视频时需完整读取视频后才能回答问题,且每次提问都要重复处理。ReKV 采用流式分析方式,在用户提问时即可立即响应。基于通用 Video-LLM,我们引入滑动窗口注意力机制,使输入帧仅关注有限数量的前序帧,显著降低计算开销。为防止信息丢失,我们将已处理视频的键值缓存(KV-Caches)存储于内存和磁盘,按需加载回 GPU 内存。同时,我们设计了一种检索方法,通过外部检索器或模型参数提取与问题相关的 KV-Cache,确保问答效率与准确性。ReKV 实现了视频编码与问答任务在不同进程和 GPU 上的分离,极大提升 StreamingVQA 的效率。大量实验验证了该方法的有效性与实用性,显著优于现有 VideoQA 模型。
原文摘要 · Abstract (English)
We propose ReKV, a novel training-free approach that enables efficient streaming video question-answering (StreamingVQA), by seamlessly integrating with existing Video Large Language Models (Video-LLMs). Traditional VideoQA systems struggle with long videos, as they must process entire videos before responding to queries, and repeat this process for each new question. In contrast, our approach analyzes long videos in a streaming manner, allowing for prompt responses as soon as user queries are received. Building on a common Video-LLM, we first incorporate a sliding-window attention mechanism, ensuring that input frames attend to a limited number of preceding frames, thereby reducing computational overhead. To prevent information loss, we store processed video key-value caches (KV-Caches) in RAM and disk, reloading them into GPU memory as needed. Additionally, we introduce a retrieval method that leverages an external retriever or the parameters within Video-LLMs to retrieve only query-relevant KV-Caches, ensuring both efficiency and accuracy in question answering. ReKV enables the separation of video encoding and question-answering across different processes and GPUs, significantly enhancing the efficiency of StreamingVQA. Through comprehensive experimentation, we validate the efficacy and practicality of our approach, which significantly boosts efficiency and enhances applicability over existing VideoQA models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。