Efficient Frame Selection for Long Videos at Test Time with Attention-Based MLLM Selectors

Yilin Wang, Xiangxi Zheng, Dongxing Mao, Linjie Li, Zhengyuan Yang, Ping Yu, Rui Yan, Yuan Yao, Alex Jinpeng WangarXiv 2026

TL;DR

Long video understanding in Multimodal Large Language Models (MLLMs) is severely bottlenecked by context windows, creating a catch-22: you need to understand a video to select its most important frames, but you can't process the video without downsampling it first. This paper introduces DAFS, a training-free framework that repurposes the internal cross-modal attention of a lightweight, 2B-parameter MLLM to rapidly rank and select query-relevant frames in a single forward pass. Combined with a dynamic programming approach to balance frame counts and token budgets, DAFS significantly boosts long-video question-answering accuracy without the heavy computational overhead of text generation.

What Problem Does This Paper Address?

As video lengths grow from seconds to hours, MLLMs face an input explosion. Feeding every single frame into a model quickly overflows its visual token budget and context window, making dense processing computationally impossible.

To cope, current systems must select a sparse subset of frames. However, existing selection paradigms face a harsh trade-off between semantic depth and computational cost:

  • Uniform Sampling: Cheap and fast, but entirely content-blind. It frequently misses brief, decisive events scattered across a long video.
  • CLIP-based Matching: Scores frames based on text-image similarity, but treats each frame in isolation, completely ignoring the overarching temporal context.
  • MLLM Autoregressive Selectors: Use an MLLM to explicitly output the timestamps or IDs of important frames. While semantically rich, this requires expensive additional training and introduces massive latency during inference due to token-by-token text generation.

The authors target this exact gap, seeking a frame selection method that is query-conditioned, aware of cross-frame context, entirely training-free, and computationally lightweight.

Figure 2: Comparison of text-guided frame selection paradigms for long video understanding. CLIP-based methods score frames independently with weak query conditioning. MLLM-based autoregressive selectors achieve strong query conditioning but require additional training. Our method extracts cross-modal attention from a small MLLM in a single forward pass for training-free, query-conditioned selection.

Methods

The authors introduce DAFS (Dynamic Attention-based Budget-aware Frame Selection). The core realization driving DAFS is that we don't need an MLLM to generate an explicit textual answer telling us which frames matter; the model's internal cross-modal attention maps at intermediate layers already reveal exactly which visual tokens align with the text query before any text is even generated.

The DAFS pipeline operates in three main phases:

  1. Query-Aware Frame Scoring: Candidate frames and the text query are fed into a small MLLM selector (e.g., a 2B model). DAFS extracts the text-to-vision attention matrix from a validation-selected intermediate layer. It aggregates these weights across the visual tokens of each frame and applies max-pooling over semantically critical query tokens (such as answer options or key entities extracted via a lightweight LLM rule) to compute a final relevance score for each frame.
  2. Budget-Aware Token Compression: To prevent the small selector model from exceeding its own context window when evaluating long videos, candidate frames are spatially downsampled using non-overlapping average pooling into a smaller grid of visual tokens.
  3. Dynamic Programming (DP) for Policy Calibration: There is an inherent trade-off between temporal coverage (sampling more frames) and spatial detail (allocating more tokens per frame). DAFS models this as a discrete optimization sequence. Using a small calibration dataset, it uses dynamic programming to map video durations to an optimal configuration of frame count $F(d)$ and per-frame tokens $P(d)$ that maximizes downstream accuracy under a strict total token budget.

Crucially, this aggressive token compression only happens on the selector side. Once the top-$K$ frames are identified, they are passed to the primary, larger answerer MLLM in their original, uncompressed high resolution.

Figure 3: Overview of DAFS. Candidate frames are compressed via dynamic pooling and scored by a small MLLM using validation-selected cross-modal attention. The top-K query-relevant frames are then fed to the backbone model for prediction.

Datasets

  • Layer Selection & Validation: Charades-STA and NExT-GQA were utilized to analyze layer-wise attention behaviors and isolate the optimal extraction layers.
  • Policy Calibration: A separate, held-out set of 1,000 out-of-domain videos compiled from CG-Bench, NExT-QA, LongVideo-Reason, and LLaVA-Video.
  • Evaluation Benchmarks: The method was rigorously tested on Video-MME (without subtitles), MLVU (including its Needle-QA temporal grounding task), LongVideoBench (LVB), and MMBench-Video.

Key Insights and Ideas

  • The Attention "Sweet Spot": The authors discovered that cross-modal attention acts as a highly effective evidence retriever specifically at mid-depth layers (e.g., layer 12 in InternVL3.5-2B). In early layers, features haven't fused enough to understand the query context; in late layers, deep cross-modal fusion abstracts the representations, obscuring frame-level visual details.
  • Max-Pooling Over Key Tokens Eliminates Noise: Rather than averaging attention across an entire prompt—which introduces substantial noise from frequent, non-informative words like "the" or "is"—max-pooling over query-critical tokens isolates the true semantic alignment between specific entities and visual evidence.
  • Decoupled Resolution Works: You can aggressively compress a frame's spatial resolution to determine if it is relevant to a query, but you must feed the uncompressed original frame to the final answering model to preserve the fine-grained details needed to answer the question accurately.

Key Results

  • Substantial Accuracy Gains: Under a strict 32-frame budget, DAFS paired with a Qwen2.5-VL-7B answerer outperformed uniform sampling by up to 6.4 percentage points on Video-MME and up to 11.5 points on MLVU.
  • Drastic Latency Reduction: DAFS is highly efficient. Compared to ViaRL (a state-of-the-art training-based autoregressive selector), DAFS cut the frame selection step latency from 8.00 seconds down to just 0.47 seconds on a single NVIDIA A100 GPU, while achieving superior final accuracy.
  • Excellent Cross-Model Generalization: Because the selector relies on fundamental cross-modal attention mechanics, a frame selection pattern generated by a tiny 2B selector can be plugged directly into completely different, much larger answerer models (like LLaVA-Video-72B or Qwen2.5-VL-72B) and still yield massive performance leaps.
Figure 1: Performance–efficiency overview. Our selector improves long-video understanding while keeping the selec- tion stage lightweight, illustrating the accuracy–cost trade-off targeted by this work.

Limitations and Future Work

While DAFS completely bypasses the need to train a selector model, it still requires a brief, one-time offline calibration phase to identify the optimal attention layer and compute the DP lookup table for frame/token allocation. This calibration assumes access to a representative development set, though the authors demonstrated strong out-of-domain transferability.

For future work, the authors suggest exploring adaptive layer selection that shifts dynamically based on query complexity, as well as expanding the attention-aggregation mechanism to handle multi-modal inputs that include dense audio tracks.

Summary updated

BibTeX
@misc{wang2026efficient,
  author = {Yilin Wang and Xiangxi Zheng and Dongxing Mao and Linjie Li and Zhengyuan Yang and Ping Yu and Rui Yan and Yuan Yao and Alex Jinpeng Wang},
  title = {{Efficient Frame Selection for Long Videos at Test Time with Attention-Based MLLM Selectors}},
  year = {2026},
  eprint = {2607.15689},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.15689},
}
Figure