Views
No views yet
TLDR: To address inefficiency from excessive visual tokens in LVLMs, we propose a unified, bottom-up perspective based on information-flow, revealing dynamic redundancy emergence and introduce FlowCut, making pruning decision aligned with the model's inherent behavior, outperforming all existing approaches.
git clone https://github.com/haotian-liu/LLaVA.git
cd LLaVAconda create -n llava python=3.10 -y
conda activate llava
pip install --upgrade pip
pip install -e .
pip install flash-attn --no-build-isolationpip install flowcutgit clone https://github.com/TungChintao/FlowCut
cd flowcut
pip install -e .├── LLaVA-main
├── flowcut
├── llava
├── playground
├── script1from llava.model.builder import load_pretrained_model
2from llava.mm_utils import get_model_name_from_path
3from llava.eval.run_llava import eval_model
4from flowcut import flowcut
5model_path = "liuhaotian/llava-v1.5-7b"
6
7tokenizer, model, image_processor, context_len = load_pretrained_model(
8 model_path=model_path,
9 model_base=None,
10 model_name=get_model_name_from_path(model_path)
11)
12## FlowCut retains 64 visual tokens
13model = flowcut(model, target_num=64)1## Load LLaVA Model (code from llava.eval.model_vqa_loader)
2tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, args.model_base, model_name)
3## add FlowCut
4from flowcut import flowcut
5model = flowcut(model, target_num=64)bash scripts/v1_5/eval/[Benchmark].shCUDA_VISIBLE_DEVICES=0 bash scripts/v1_5/eval/mme.shCUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash scripts/v1_5/eval/vqav2.sh1## Load LLaVA Model (code from llava.train)
2code of loading model...
3## add FlowCut
4from flowcut import flowcut
5model = flowcut(model, target_num=64)
6## training
7trainer = LLaVATrainer(model=model,
8 tokenizer=tokenizer,
9 args=training_args,
10 **data_module)1@article{tong2025flowcut,
2 title={FlowCut: Rethinking Redundancy via Information Flow for Efficient Vision-Language Models},
3 author={Tong, Jintao and Jin, Wenwei and Qin, Pengda and Li, Anqi and Zou, Yixiong and Li, Yuhong and Li, Yuhua and Li, Ruixuan},
4 journal={arXiv preprint arXiv:2505.19536},
5 year={2025}
6}