Streaming Video Understanding through Sparsity

20 min read

Tags: Multimodal | Streaming Video | Visual Sparsity

当前, 多模态大语言模型 (MLLM) 在应用于流视频理解时, 通常面临两个核心问题: (I) 如何主动响应实时交互需求; (II) 如何高效处理视频流中大量冗余的视觉信息。针对第一个问题, 现有方法通常构造包含主动交互行为的训练数据, 使模型能够在视频播放过程中判断何时需要主动发起对话或输出回答。针对第二个问题, 许多方法仍主要依赖关键帧采样, 但这种粗粒度策略容易遗漏持续时间较长的宏观事件以及短暂出现的局部细节。因此, 本文主要围绕第二个问题, 介绍流视频理解中的视觉信息压缩方向及其代表性工作。

Visual Token Compression

使用 vision encoder 对视频帧进行编码后, 模型会得到大量 visual patch tokens。由于相邻视频帧之间通常存在显著的时间冗余, 同一帧内部也包含大量空间冗余, 因此可以在尽量保留重要视觉信息的前提下, 对冗余 token 进行筛除或压缩。从压缩发生的位置来看, 现有方法大致分为两类: (I) KV-cache compression; (II) visual embedding compression。两类方法的本质都是估计视觉 token 的重要性, 并据此减少流视频不断累积的视觉上下文。区别在于, 前者在视觉 token 已经进入 LLM 并被转化为逐层 KV-cache 后进行压缩, 而后者直接在视觉 embedding 进入 LLM 之前去除冗余。

KV-Cache Compression

在 KV-cache 层进行压缩, 可以直接复用 LLM 已经计算得到的 key 和 value, 从而较为方便地评估不同视觉 token 与当前文本上下文之间的相关性。此外, 由于不同 Transformer 层维护各自独立的 KV-cache, 这类方法可以让每一层根据自身的表示特征, 独立选择最适合保留或检索的视觉信息。

ReKV (Di et al., 2025) 并不直接进行压缩, 而是进行检索。它首先完整保留当前视频中所有 visual tokens 对应的 KV-cache, 这一过程被称为 internal retrieval。当模型开始回答问题时, 每一层根据当前层的 hidden states \(X\), 从该层保存的 visual KV-cache 中检索 Top-\(K\) 个最相关的视觉 token, 并将其作为额外上下文参与注意力计算:

\[O = \operatorname{Attn}\left( W_QX, \, [L_K, W_KX], \, [L_V, W_VX] \right).\]
ReKV framework for in-context video KV-cache retrieval
Figure 1: ReKV retrieves query-relevant visual KV-cache for streaming video question answering.
(Image source: Di et al. 2025)

除了将 KV-cache 作为可检索的外部记忆, 也可以直接对其进行持续压缩。LiveVLM (Ning et al., 2025) 观察到 visual tokens 中存在类似 attention sink 的现象, 即大量视觉 token 会将较高的注意力分配给少数 sink visual tokens。因此, LiveVLM 使用 vision-to-vision attention score, 而不是 text-to-vision attention score, 计算每层 visual token 的重要性, 并在时间分桶的约束下选择需要保留的 token。该策略既维持了视频内容在时间维度上的覆盖, 又能够优先保留注意力得分较高的视觉信息。InfiniPot-V (Kim et al., 2025) 提出了一种受预算约束的持续 KV-cache 压缩机制。当缓存长度达到预设上限 \(M\) 时, 每一层的 KV-cache 会被压缩至长度 \(C\), 其中 \(C \ll M\)。具体而言, InfiniPot-V 首先沿时间维度执行稀疏化操作: 如果当前帧某一位置的 key 与历史帧相同位置的 key 具有较高相似度, 则认为该 token 包含重复信息并将其移除。随后, 方法沿空间维度执行稀疏化操作: 优先保留 value norm 较大的 token。作者发现, value norm 较大的 token 通常具有更高的表示熵, 因此可能包含更丰富的信息。HERMES (Zhang et al., 2026) 则进一步研究了不同深度的 LLM 层对视觉信息的注意力模式。其分析表明, 浅层具有明显的近因偏好, 即模型更倾向于关注距离当前 token 较近的视觉 token; 随着网络深度增加, 这种近因偏好逐渐减弱。因此, HERMES 针对 shallow, middle 和 deep layers 分别设计了不同的 visual KV-cache 重要性评估规则, 并将 KV-cache 组织为 hierarchical memory, 以匹配不同层的注意力特性。此外, HERMES 提出了 M-RoPE 的位置重索引策略, 使压缩后保留下来的 token 在 M-RoPE 的三个坐标维度上重新保持连续。需要注意的是, 对于压缩后 token 的位置编码是否应当重索引, 目前不同工作采用了不同策略: 部分方法保留 token 的原始位置坐标, 另一些方法则重新构造连续的位置索引。

InfiniPot-V memory-constrained KV-cache compression framework
Figure 2: InfiniPot-V removes temporal redundancy and preserves informative values under a fixed memory budget.
(Image source: Kim et al. 2025)
HERMES hierarchical KV-cache memory framework
Figure 3: HERMES organizes visual KV-cache as hierarchical memory for layers with different attention patterns.
(Image source: Zhang et al. 2026)

Visual Embedding Compression

Visual embedding compression 通常从时间和空间两个维度去除冗余的 visual patch tokens。相比于在 KV-cache 层压缩已经经过多层计算和语义混合的内部状态, visual embedding compression 能够在视觉信息进入 LLM 之前, 直接利用视频本身的时空结构过滤重复内容, 从源头减少 LLM prefill, 后续各层计算以及 KV-cache 增长所带来的计算与显存开销。

TimeChat-Online (Yao et al., 2025) 根据相邻两帧相同空间位置上的 visual embeddings 之间的余弦相似度, 判断对应 token 是否冗余。当相似度超过预设阈值时, 当前帧中的对应 token 会被删除。该工作也探索了基于 pixel-level difference 的冗余判断方式, 但由于像素差异容易受到光照变化, 编码噪声等因素影响, 其效果不如 feature-level similarity。对于保留下来的 token, TimeChat-Online 继续使用其原始 M-RoPE 坐标, 以避免删除 token 后重新排列位置所导致的空间错位。此外, TimeChat-Online 还利用被删除 token 的数量估计当前场景的变化程度, 并将该指标作为第一层门控信号, 用于判断是否需要将当前场景交给 backbone LLM, 从而触发模型的主动输出行为。

TimeChat-Online differential token dropping framework
Figure 4: TimeChat-Online removes temporally redundant visual tokens through differential token dropping.
(Image source: Yao et al. 2025)

FluxMem (Xie et al., 2026) 进一步将 visual memory 划分为 short-term memory, mid-term memory 和 long-term memory, 并针对不同时间尺度的记忆采用不同的压缩策略。Short-term memory 不进行压缩, 以完整保留最近的视觉信息。Mid-term memory 采用与 TimeChat-Online 类似的时间冗余判断方式, 通过比较相邻帧对应位置上的 visual embeddings 来筛除重复 token。相比 TimeChat-Online, FluxMem 主要进行了两点改进: (1) 不再仅比较完全相同位置上的 token, 而是在 \(3 \times 3\) 的局部窗口中计算相似度; (2) 使用 Otsu 自适应阈值法 (see Appendix for more details) 确定冗余判断阈值, 而不是采用人工设定的固定阈值。Long-term memory 则进一步处理单帧内部的空间冗余。FluxMem 计算同一帧内不同 visual embeddings 之间的相似度, 并将相似度高于阈值的 token 连接起来。在完成整帧 token 的相似关系构建后, 每个连通分量中的 visual patch embeddings 会被聚合为其均值, 并以该均值作为新的 visual embedding。通过这种方式, 多个语义相近或空间冗余的 patch tokens 可以被合并为单个 token, 从而显著减少长期记忆中的 token 数量。

FluxMem adaptive hierarchical visual memory framework
Figure 5: FluxMem compresses streaming visual memory across short-, mid-, and long-term timescales.
(Image source: Xie et al. 2026)

StreamingTOM (Chen et al., 2025) 将 visual token compression 与 KV-cache retrieval 结合起来。首先, 方法在 visual embedding 层去除视频中的冗余视觉信息; 随后, 将压缩后的 visual embeddings 输入 LLM, 通过 prefill 转化为 KV-cache, 并以量化形式存储。当模型需要回答问题时, 再根据当前查询动态检索 Top-\(K\) 个最相关的 frame-level KV-cache, 并将其作为视觉上下文提供给模型。因此, StreamingTOM 实际上结合了两类方法的优势: visual embedding compression 用于减少进入 LLM 的冗余 token, 而 KV-cache retrieval 则用于在回答阶段动态访问与当前问题相关的历史视觉信息。

StreamingTOM token compression and KV-cache retrieval framework
Figure 6: StreamingTOM combines pre-LLM visual token compression with query-dependent KV-cache retrieval.
(Image source: Chen et al. 2025)

Sparse Vision Encoder

Deep learning scales best when its architecture aligns with the fundamental structure of the data。除了在 vision encoder 输出 visual patch tokens 后进行压缩, 还可以直接调整 encoder 的架构, 使其利用视频数据本身的稀疏性, 从编码阶段便生成更少的 visual tokens。

OneVision-Encoder (Tang et al., 2026) 将 video codec 的编码结构引入稀疏视觉建模。它首先使用 HEVC (see Appendix for more details) 编码视频, 完整保留每个 I-frame 的 RGB 数据, 同时提取每个 P-frame 的 motion vector \(\tau_t\) 和 residual signal \(R_t\)。对于 P-frame 中的每个 patch, OneVision-Encoder 将对应的 motion magnitude 与 residual energy 相加, 得到一个标量显著性分数。随后, 方法根据该分数对所有 patch 排序, 仅保留 Top-\(K\) 个最显著的 patch 并送入 vision encoder 中, 从而避免对变化较小的区域进行冗余编码。为了预训练该 encoder, OneVision-Encoder 还提出 image and video clustering。该方法分别对训练集中的 image 和 video 表征进行聚类, 并在训练过程中拉近样本表征与所属聚类中心的距离, 同时推远其与其他聚类中心的距离。通过这种多类别对比学习目标, vision encoder 能够学习适合图像和视频输入的视觉表征。

OneVision-Encoder codec-aligned sparse vision encoder
Figure 7: OneVision-Encoder uses codec-derived motion and residual signals to select informative video patches.
(Image source: Tang et al. 2026)

CoPE-VideoLM (Sarkar et al., 2026) 同样借鉴了 HEVC, 但不再要求 vision encoder 为 P-frame 生成稠密的 patch embeddings。它引入额外的 \(\delta\)-encoder, 将 P-frame 的 motion vectors 和 residual signals 分别编码为固定数量的 motion tokens 与 residual tokens, 从而直接以紧凑表征描述帧间变化。

CoPE-VideoLM codec-primitive video language model
Figure 8: CoPE-VideoLM represents inter-frame changes with compact motion and residual tokens.
(Image source: Sarkar et al. 2026)

为了使 \(\delta\)-encoder 生成的 tokens 与标准 vision encoder 的 visual embedding space 对齐, CoPE-VideoLM 设计了一个 self-reconstruction simulation 框架。该框架在预训练阶段引入 reference Transformer 和 warped Transformer, 并在特征空间中模拟 HEVC 的帧间解码过程。首先, reference Transformer 根据参考 I-frame \(I_{t-s}\) 和 motion tokens \(\tau_{\mathrm{tok},t}\) 生成运动补偿后的参考特征 \(\tilde{P}_{\mathrm{ref},t} = \theta_{\mathrm{ref}}(I_{t-s}, \tau_{\mathrm{tok},t})\)。随后, warped Transformer 融合 residual tokens \(R_{\mathrm{tok},t}\), 重建当前 P-frame 的视觉特征 \(\tilde{P}_t = \theta_{\mathrm{warped}}(\tilde{P}_{\mathrm{ref},t}, R_{\mathrm{tok},t})\)。最后, 方法计算重建特征 \(\tilde{P}_t\) 与标准 vision encoder 输出 \(\hat{P}_t\) 之间的 reconstruction loss。由于两个 Transformer 只能依赖 \(\delta\)-encoder 提供的压缩信息完成重建, 该目标会迫使 \(\delta\)-encoder 学会在有限 token 预算下准确表征 motion vectors 和 residual signals。

CoPE-VideoLM delta-encoder self-reconstruction simulation
Figure 9: Self-reconstruction simulation aligns compact codec tokens with the visual embedding space.
(Image source: Sarkar et al. 2026)

References

[1] Linli Yao, et al. “TimeChat-Online: 80% Visual Tokens are Naturally Redundant in Streaming Videos.” Proceedings of the 33rd ACM International Conference on Multimedia (2025).

[2] Shangzhe Di, et al. “Streaming Video Question-Answering with In-Context Video KV-Cache Retrieval.” ICLR 2025.

[3] Zhenyu Ning, et al. “LiveVLM: Efficient Online Video Understanding via Streaming-Oriented KV Cache and Retrieval.” arXiv preprint arXiv:2505.15269 (2025).

[4] Minsoo Kim, et al. “InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video Understanding.” Advances in Neural Information Processing Systems 38 (2025).

[5] Haowei Zhang, et al. “HERMES: KV Cache as Hierarchical Memory for Efficient Streaming Video Understanding.” arXiv preprint arXiv:2601.14724 (2026).

[6] Yiweng Xie, et al. “FluxMem: Adaptive Hierarchical Memory for Streaming Video Understanding.” arXiv preprint arXiv:2603.02096 (2026).

[7] Xueyi Chen, et al. “StreamingTOM: Streaming Token Compression for Efficient Video Understanding.” arXiv preprint arXiv:2510.18269 (2025).

[8] Feilong Tang, et al. “OneVision-Encoder: Codec-Aligned Sparsity as a Foundational Principle for Multimodal Intelligence.” arXiv preprint arXiv:2602.08683 (2026).

[9] Sayan Deb Sarkar, et al. “CoPE-VideoLM: Leveraging Codec Primitives for Efficient Video Language Modeling.” arXiv preprint arXiv:2602.13191 (2026).

Appendix

Otsu’s Method

Otsu’s method 是一种自适应阈值分割算法, 可以将灰度图或连续 score map 划分为两类。例如, 在视频变化检测中, 两类可以分别对应静态区域和动态区域。该方法无需手动指定阈值, 而是从数据分布中寻找使两类区分度最大的阈值 \(t\)。设 score 被离散为 \(L\) 个区间, \(P(i)\) 表示第 \(i\) 个区间的归一化频率, 则候选阈值 \(t\) 两侧的样本比例与均值分别为:

\[\begin{aligned} \omega_0(t) &= \sum_{i=0}^{t} P(i), & \omega_1(t) &= \sum_{i=t+1}^{L-1} P(i), \\ \mu_0(t) &= \frac{\sum_{i=0}^{t} iP(i)}{\omega_0(t)}, & \mu_1(t) &= \frac{\sum_{i=t+1}^{L-1} iP(i)}{\omega_1(t)}. \end{aligned}\]

Otsu’s method 使用两类的比例与均值计算类间方差, 并选择使其最大化的阈值。由于最大化类间方差等价于最小化类内方差, 该阈值能够使分割后的两类在统计意义上尽可能分离:

\[\sigma_b^2(t) = \omega_0(t)\omega_1(t) \left(\mu_0(t) - \mu_1(t)\right)^2, \qquad t^* = \underset{t}{\operatorname{arg\,max}}\; \sigma_b^2(t).\]
Otsu's method separates a distribution into two classes with an adaptive threshold
Figure 10: Otsu's method 通过最大化类间方差确定自适应分割阈值。

HEVC

HEVC/H.265 使用 I-frame, P-frame 和 B-frame 等不同类型的视频帧。I-frame 可以独立解码, 而 P-frame 和 B-frame 则利用帧间预测减少时间冗余。其中, P-frame 主要通过 motion vector 和 residual signal 描述当前帧相对于参考帧的变化。FFmpeg 可以将 H.264 等编码格式的视频转码为 HEVC/H.265, 同时继续使用 .mp4 作为容器格式。这里使用 OneVision-Encoder 提供的 HEVC decoder, 从视频中提取 motion vector 和 residual signal, 分别对应 Figure 11(e) 和 Figure 11(f)。

以 P-frame 的亮度分量 \(Y\) 为例, 解码过程可以简化为两个步骤。首先, motion compensation 根据参考帧 \(\hat{F}_{\pi(t),Y}\) 和 motion vector \(v_t\) 预测当前帧 (Figure 11(c))。随后, decoder 将 residual signal \(R_{t,Y}\) 加到预测结果上, 得到重建后的 P-frame (Figure 11(d)):

\[\begin{aligned} \tilde{F}_{t,Y}^{P}(x,y) &= \operatorname{MC}\left(\hat{F}_{\pi(t),Y}, v_t\right)(x,y), \\ \hat{F}_{t,Y}^{P}(x,y) &= \tilde{F}_{t,Y}^{P}(x,y) + R_{t,Y}(x,y). \end{aligned}\]

在获得 motion vector 和 residual signal 后, 我们按照 OneVision-Encoder 的方式, 分别计算 motion magnitude 和 residual energy, 对二者进行 min-max normalization, 再将其加权和作为每个 patch 的显著性分数。原方法按照预设 ratio 保留得分最高的 patches, 如 Figure 11(g) 所示。我们还尝试使用 Otsu’s method 对 patch score 进行自适应二分类, 如 Figure 11(h) 所示。与固定 ratio 相比, 该方法能够根据每段视频的 score 分布动态调整 token 数量, 减少保留过多或遗漏重要 patches 的风险。

HEVC decoding signals and fixed-budget versus Otsu-based adaptive patch selection
Figure 11: HEVC 帧间解码过程, codec signals, 以及 fixed-budget 与 Otsu-based patch selection 的对比。