SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.01818 · 2024

Beyond Text-Visual Attention: Exploiting Visual Cues for Effective Token Pruning in VLMs

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 9 functions out of this paper's own repositories and ran 7 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
theia-4869/fastervlm canonical 7 of 8
theia-4869/vispruner canonical 0 of 1
FunctionStatusWhere it lives
collate_fn Ran theia-4869/fastervlm/llava/eval/model_vqa_loader.py
code served (permissive licence) · get_code("20e4f665698a3d18")
divide_to_patches Ran theia-4869/fastervlm/llava/mm_utils.py
code served (permissive licence) · get_code("7e03b180fa317c9a")
get_chunk Ran theia-4869/fastervlm/llava/eval/model_vqa.py
code served (permissive licence) · get_code("42a46570620cd9fa")
is_none Ran theia-4869/fastervlm/llava/eval/model_vqa_mmbench.py
code served (permissive licence) · get_code("bae18947b56f2be1")
resize_and_pad_image Ran theia-4869/fastervlm/llava/mm_utils.py
code served (permissive licence) · get_code("468eedeba67f1b00")
split_list Ran theia-4869/fastervlm/llava/eval/model_vqa.py
code served (permissive licence) · get_code("076c252c52cbb161")
unpad_image Ran theia-4869/fastervlm/llava/model/llava_arch.py
code served (permissive licence) · get_code("55c32993da87759b")
select_best_resolution Not yet run theia-4869/fastervlm/llava/mm_utils.py
code served (permissive licence) · get_code("30113c28bc9b982c")
select_best_resolution Not yet run theia-4869/vispruner/llava/mm_utils.py
code served (permissive licence) · get_code("3ee0f92602576a06")

Repositories linked to this paper

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

Abstract

Large vision-language models (LVLMs) generally contain significantly more visual tokens than their textual counterparts, resulting in a considerable computational burden. Recent efforts have been made to tackle this issue by pruning visual tokens early within the language model. Most existing works use attention scores between text and visual tokens to assess the importance of visual tokens. However, in this study, we first analyze the text-visual attention in the language model and find that this score is not an ideal indicator for token pruning. Based on the analysis, We propose VisPruner, a plug-and-play method that utilizes visual cues for more effective token pruning in LVLMs. Specifically, we first use visual attention to select a limited number of significant tokens. Then, we remove duplicate tokens from the remaining ones based on their similarity. By retaining diverse tokens alongside the initially selected important tokens, we maximally preserve the visual information of the input image. Experimental results demonstrate that our VisPruner sustains strong performance across various VLM architectures and reduction ratios, significantly outperforming existing methods based on text-visual attention. Notably, without any training, VisPruner can reduce the FLOPs of LLaVA-1.5-7B by 91% and inference latency by 75%, while maintaining comparable performance. Our code is available at https://github.com/Theia-4869/VisPruner.

For agents

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

get_harvested_code_for_paper("2412.01818")
get_code_for_paper("2412.01818")
have("2412.01818")

Connect an agent — have() is free.