SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.10742 · ICCV · 2025

Keyframe-oriented Vision Token Pruning: Enhancing Efficiency of Large Vision Language Models on Long-Form Video Processing

Yiran Chen, Ming Yin, Jingyang Zhang, Hai Li, Jingwei Sun, Jianyi Zhang, Yudong Liu, Qinsi Wang, Yueqian Lin

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2503.10742.json · badge: /api/ran/2503.10742.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
1999Lyd/KVTP canonical (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
complement_idx Ran
ran; our contract draft was wrong, not the code
1999Lyd/KVTP/llava/model/llava_arch.py
code served (permissive licence) · get_code("e3bf22708b14ee58")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family int, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes idx (a tensor of indices) and dim (an integer representing the dimension size)
# Looking at the function:
# - idx is a tensor that contains indices
# - dim is the total dimension size
# - The function creates a range from 0 to dim-1
# - It scatters 0s at positions specified by idx
# - Returns the complement indices (those not in idx)

# Let's create a simple example:
# - dim = 6 (total dimension size)
# - idx should be a tensor of indices, e.g., shape (2, 3) meaning 2 samples, each with 3 indices
# The complement would be the remaining indices not selected

dim = 6
idx = torch.tensor([[0, 2, 4], [1, 3, 5]])  # Shape (2, 3) - 2 samples, 3 indices each

ARGS = {
    'idx': idx,
    'dim': dim
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family int, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_patches Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
1999Lyd/KVTP/llava/mm_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from HumanMLLM/LLaVA-Scissor, is pointer only (licence: NONE) · get_code("b0a851cae92754ff")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HumanMLLM/LLaVA-Scissor, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_chunk Ran
ran; our contract draft was wrong, not the code
1999Lyd/KVTP/llava/eval/model_vqa.py
code served (permissive licence) · get_code("42a46570620cd9fa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def split_list(lst, n):
    """Split a list into n (roughly) equal-sized chunks"""
    chunk_size = math.ceil(len(lst) / n)
    return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]

def get_chunk(lst, n, k):
    chunks = split_list(lst, n)
    return chunks[k]

# Setup code
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3
k = 1

ARGS = {
    "lst": lst,
    "n": n,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_json Ran
ran on a synthesized input
1999Lyd/KVTP/llava/combine.py
code served (permissive licence) · get_code("f89aea892269a576")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import os
import tempfile

# Create a temporary directory and a test JSON file
temp_dir = tempfile.mkdtemp()
test_json_path = os.path.join(temp_dir, "test.json")

# Write a valid JSON file
test_data = {"key": "value", "number": 42, "list": [1, 2, 3]}
with open(test_json_path, 'w') as f:
    json.dump(test_data, f)

# Define ARGS with the json_path parameter
ARGS = {
    "json_path": test_json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
outlier_dectection Ran
ran; our contract draft was wrong, not the code
1999Lyd/KVTP/llava/model/llava_arch.py
code served (permissive licence) · get_code("bce1bfc997cf14f9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small attention tensor
# The function expects a tensor that can be converted to float32, moved to CPU, 
# converted to numpy, and flattened
# Let's create a 2D attention matrix (e.g., from a transformer attention head)
attn = torch.randn(2, 4)

ARGS = {
    'attn': attn
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_list Ran
ran; our contract draft was wrong, not the code
1999Lyd/KVTP/llava/eval/model_vqa.py
code served (permissive licence) · get_code("076c252c52cbb161")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def split_list(lst, n):
    """Split a list into n (roughly) equal-sized chunks"""
    chunk_size = math.ceil(len(lst) / n)
    return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]

# Setup code
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3

ARGS = {
    "lst": lst,
    "n": n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unpad_image Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
1999Lyd/KVTP/llava/model/llava_arch.py
code served (permissive licence) · get_code("7606525af238fb64")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family float, shape (3, 8, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a padded image tensor in CxHxW format
# C=3 (RGB), H=8 (current height), W=6 (current width)
tensor = torch.randn(3, 8, 6)

# Original size as (width, height)
# Using different dimensions to be distinct: width=4, height=5
original_size = (4, 5)

ARGS = {
    "tensor": tensor,
    "original_size": original_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 8, 6) — shape (3, 8, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
auto_pad_images Not yet run
unverified (harvested, no recorded run)
1999Lyd/KVTP/llava/mm_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from HumanMLLM/LLaVA-Scissor, is pointer only (licence: NONE) · get_code("3c8823948724e269")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HumanMLLM/LLaVA-Scissor, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

resize_and_center_crop Not yet run
unverified (harvested, no recorded run)
1999Lyd/KVTP/llava/mm_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from HumanMLLM/LLaVA-Scissor, is pointer only (licence: NONE) · get_code("c80358dff96c25ce")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HumanMLLM/LLaVA-Scissor, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

safe_load_tokenizer Not yet run
unverified (harvested, no recorded run)
1999Lyd/KVTP/llava/conversation.py
code served (permissive licence) · get_code("b20705b0dfd77ffc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 7 the same month, 7 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
split_list 197 other papers
159 dated earlier, 3 the same month, 27 later, 7 same year, order not determinable, 1 undated
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 194 more not named here
get_chunk 189 other papers
153 dated earlier, 3 the same month, 26 later, 7 same year, order not determinable
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 186 more not named here
unpad_image 69 other papers
45 dated earlier, 5 the same month, 14 later, 5 same year, order not determinable · 5 only as an assembly brick
2304.08485 (2023-04)
Visual Instruction Tuning
2309.09958 (2023-09)
An Empirical Study of Scaling Instruct-Tuned Large Multimodal Models
2310.03744 (2023-10)
Improved Baselines with Visual Instruction Tuning
and 66 more not named here
extract_patches 20 other papers
9 dated earlier, 1 the same month, 8 later, 2 same year, order not determinable
2411.10332 (2024-11)
Number it: Temporal Grounding Videos like Flipping Manga
2411.11360 (2024-11)
CCExpert: Advancing MLLM Capability in Remote Sensing Change Captioning with Difference-Aware Integration and a Foundational Dataset
2411.14432 (2024-11)
Insight-V: Exploring Long-Chain Visual Reasoning with Multimodal Large Language Models
and 17 more not named here
auto_pad_images 19 other papers
8 dated earlier, 1 the same month, 8 later, 2 same year, order not determinable
2411.10332 (2024-11)
Number it: Temporal Grounding Videos like Flipping Manga
2411.11360 (2024-11)
CCExpert: Advancing MLLM Capability in Remote Sensing Change Captioning with Difference-Aware Integration and a Foundational Dataset
2411.14432 (2024-11)
Insight-V: Exploring Long-Chain Visual Reasoning with Multimodal Large Language Models
and 16 more not named here
resize_and_center_crop 18 other papers
8 dated earlier, 1 the same month, 7 later, 2 same year, order not determinable
2411.10332 (2024-11)
Number it: Temporal Grounding Videos like Flipping Manga
2411.11360 (2024-11)
CCExpert: Advancing MLLM Capability in Remote Sensing Change Captioning with Difference-Aware Integration and a Foundational Dataset
2411.14432 (2024-11)
Insight-V: Exploring Long-Chain Visual Reasoning with Multimodal Large Language Models
and 15 more not named here
safe_load_tokenizer 12 other papers
4 dated earlier, 1 the same month, 5 later, 2 same year, order not determinable
2411.15024 (2024-11)
DyCoke: Dynamic Compression of Tokens for Fast Video Large Language Models
2412.03248 (2024-12)
AIM: Adaptive Inference of Multi-Modal LLMs via Token Merging and Pruning
2412.07689 (2024-12)
RoboTron-Drive: All-in-One Large Multimodal Model for Autonomous Driving
and 9 more not named here
outlier_dectection 2 other papers
2 dated earlier
2403.15388 (2024-03)
LLaVA-PruMerge: Adaptive Token Reduction for Efficient Large Multimodal Models
2412.05819 (2024-12)
[CLS] Token Tells Everything Needed for Training-free Efficient MLLMs
complement_idx 1 other paper
1 dated earlier
2403.15388 (2024-03)
LLaVA-PruMerge: Adaptive Token Reduction for Efficient Large Multimodal Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Vision language models (VLMs) demonstrate strong capabilities in jointly processing visual and textual data. However, they often incur substantial computational overhead due to redundant visual information, particularly in longform video scenarios. Existing approaches predominantly focus on either vision token pruning, which may overlook spatio-temporal dependencies, or keyframe selection, which identifies informative frames but discards others, thus disrupting contextual continuity. In this work, we propose KVTP (Keyframe-oriented Vision Token Pruning), a novel framework that overcomes the drawbacks of token pruning and keyframe selection. By adaptively assigning pruning rates based on frame relevance to the query, KVTP effectively retains essential contextual information while significantly reducing redundant computation. To thoroughly evaluate the long-form video understanding capacities of VLMs, we curated and reorganized subsets from seven datasets into a unified benchmark that highlights real-world scenarios with sparse but crucial events. Our experiments with VLMs of various scales show that KVTP can reduce token usage by 80% without compromising spatiotemporal and contextual consistency, significantly cutting computation while maintaining the performance. These results demonstrate our approach's effectiveness in efficient long-video processing, facilitating more scalable VLM deployment. The code for this paper is available at GitHub.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2503.10742")
get_code_for_paper("2503.10742")
have("2503.10742")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2503.10742.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2503.10742.svg)](https://syntology.ai/paper/2503.10742)

Connect an agent — have() is free.