When Text Matters: Design Principles for Visual Token Pruning in Vision-Language Models (Paper).
Deferred text-guided visual token pruning (DeFT) prunes visual tokens in two stages. Before the language model, visual attention selects a compact set of candidates while preserving a small reserve. At an intermediate decoder layer, text-to-visual attention selects the final tokens. The method requires no training or token merging.
Python 3.11 and a CUDA-capable GPU are required. See environment details.
pip install -e '.[eval]'For Qwen benchmark evaluation, also install a FlashAttention-2 build compatible with your PyTorch and CUDA versions.
Download a checkpoint from Qwen3-VL-4B, Qwen3-VL-8B, or LLaVA-OneVision-1.5-8B, and pass its local directory as --model-path. The eight benchmark download links and preparation steps are in data setup. We do not redistribute weights or benchmark images.
Run one image and prompt; the answer is printed to the terminal. This quick-start example uses SDPA so it does not require FlashAttention-2.
deft-infer \
--model-path /path/to/Qwen3-VL-8B-Instruct \
--family qwen3 \
--backend sdpa \
--image /path/to/image.jpg \
--prompt 'What is shown in the image?' \
--prune 0.8 --alpha 0.2--prune is the fraction of visual tokens removed. --alpha controls the fraction of otherwise-pruned tokens kept as candidates for the second stage.
Run a benchmark split and save its predictions for scoring. Qwen evaluation defaults to FlashAttention-2; LLaVA-OneVision defaults to SDPA. ChartQA and InfoVQA are fetched automatically; other tasks may require local data preparation.
deft-eval \
--task chartqa \
--family qwen3 \
--model-path /path/to/Qwen3-VL-8B-Instruct \
--prune 0.8 --alpha 0.2 \
--output outputs/chartqa.jsonl@article{kang2026text,
title={When Text Matters: Design Principles for Visual Token Pruning in Vision-Language Model},
author={Kang, Minchan and Park, Kyeonghye and Cho, Seoyoung and Kim, Daeshik and Cho, Yucheol},
journal={arXiv preprint arXiv:2609.34861},
year={2026}
}