K-frames: Scene-Driven Any-k Keyframe Selection for long video understanding

Yifeng Yao, Yike Yun, Jing Wang, Huishuai Zhang, Dongyan Zhao, Ke Tian, Zhihao Wang, Minghui Qiu, Tao Wang · OpenReview

Abstract

Multimodal Large Language Models (MLLMs) have demonstrated significant capabilities in image understanding, but long-video are constrained by context windows and computational cost. Uniform frame sampling often leads to substantial information loss. Meanwhile existing keyframe selection methods such as text-frame retrieval or RL-based frame optimization typically yield sparse and temporally disjointed frames, overlooking scene continuity and lacking flexibility for multi-scale frame selection. To address these limitations, we introduce K-frames, a novel paradigm for scene-driven keyframe selection that preserves temporal continuity. Instead of selecting individual frames, K-frames predicts semantically coherent, query-relevant clips, which enables any-k keyframes selection to meet diverse user budgets. To achieve this approach, we first introduce PeakClips, a dataset of 200K video highlights conditioned by query. Building on this dataset, K-frames learns clip2frame selection using a three-stage progressive curriculum. It involves two Supervised Fine-Tuning stages for temporal grounding and key-clip perception, followed by a Reinforcement Learning stage that directly optimizes the scene-driven prediction policy for downstream task without further annotations. Extensive experiments on major long-video understanding benchmarks demonstrate that K-frames provides an effective, interpretable, and plug-and-play solution for keyframe selection at various scales. Our dataset and model will be available.

Introduction

Multimodal Large Language Models (MLLMs) excel at processing static images, but their application to long-form video is hindered by the quadratic computational complexity of Transformer architectures and finite context windows. The current standard approach, uniform frame sampling, frequently fails to capture the critical "needle" in a video haystack—the specific moments necessary to answer complex queries.

Existing "smart" selection techniques often rely on text-frame retrieval or Reinforcement Learning to pick isolated frames. However, these methods typically produce disjointed, "stuttering" sequences that lack temporal flow, making it difficult for models to interpret continuous actions or narrative progression. To solve this, we propose K-frames, a "clip-first" paradigm that shifts the focus from individual frames to semantically coherent, query-relevant scenes.

K-frames vs. Uniform Sampling: K-frames identifies semantically coherent clips and provides rationales, leading to correct downstream predictions.

Methodology: The Clip2Frame Approach

K-frames operates on the principle that continuity is essential for video understanding. Instead of asking which frames are important, the model identifies which scenes are relevant and then samples frames from those scenes. This approach, termed clip2frame, ensures that the downstream MLLM receives a sequence of frames that preserve the narrative arc of the action.

The system utilizes a lightweight backbone (Qwen2.5-VL-3B) and is trained through a three-stage progressive curriculum:

  1. Stage 1: Temporal Grounding (SFT): The model learns basic video timekeeping, mapping textual descriptions to specific timestamps.
  2. Stage 2: Key-Clip Perception (SFT): Leveraging the PeakClips dataset, the model learns to identify query-relevant clips and generate textual rationales for its choices.
  3. Stage 3: Downstream Alignment (RL): Using Group Relative Policy Optimization (GRPO), the model is fine-tuned to optimize its selection policy based on the accuracy of a frozen downstream model (e.g., Qwen2.5-VL-7B).
The three-stage training curriculum for K-frames, including temporal grounding, key-clip perception, and RL-based downstream alignment.

The PeakClips Dataset

To support this scene-driven approach, we developed PeakClips, a large-scale dataset containing 200,000 query-conditioned video highlights. The dataset was constructed using a sophisticated pipeline involving scene segmentation, hierarchical captioning (at clip, chapter, and video levels), and relevance scoring guided by Gemini 2.5 Pro. This rich supervision allows K-frames to understand the relationship between high-level queries and specific visual segments.

Experimental Results

K-frames acts as a plug-and-play pre-processor that can be paired with any downstream MLLM. Our experiments across major benchmarks show consistent improvements:

  • Temporal Localization: On the Needle-QA task, using K-frames with Gemini 2.5 Pro (8 frames) increased accuracy from 43.4% (uniform) to 71.6%, a gain of 28.2%.
  • Long Video Benchmarks: On LVBench, K-frames improved GPT-4o's performance by 5.1% and Qwen2.5-VL-7B's by 4.9%.
  • Scalability: K-frames supports Any-k selection, allowing users to adjust the frame budget based on computational constraints. Unlike retrieval methods that often plateau, K-frames demonstrates robust performance gains as the number of sampled frames increases.

Discussion and Limitations

While K-frames significantly improves performance on tasks requiring local detail and temporal localization, it offers less benefit for "Topic Reasoning" or "Information Synopsis" tasks. These tasks require a holistic view of the entire video, where uniform sampling is already effective.

Interestingly, we found that including the selector model's textual rationales in the final prompt to the downstream model sometimes degraded performance, suggesting that the reasoning of the smaller 3B model could distract larger models. Future work will explore better integration of global context and local detail to address a wider range of video understanding tasks.

Summary updated

BibTeX
@misc{yao2025k,
  author = {Yifeng Yao and Yike Yun and Jing Wang and Huishuai Zhang and Dongyan Zhao and Ke Tian and Zhihao Wang and Minghui Qiu and Tao Wang},
  title = {{K-frames: Scene-Driven Any-k Keyframe Selection for long video understanding}},
  year = {2025},
  eprint = {2510.13891},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.13891},
}
Figure