Dingjie Song, Wenjun Wang, Shunian Chen, Xidong Wang, Michael Guan, Benyou Wang*
- [2024.11.30] 🎉🎉🎉 TRIM is accepted by COLING25!🎉🎉🎉
- [2024.9.30] 🎉🎉🎉 TRIM is public!🎉🎉🎉
We introduce new approach, Token Reduction using CLIP Metric (TRIM), aimed at improving the efficiency of MLLMs without sacrificing their performance. Inspired by human attention patterns in Visual Question Answering (VQA) tasks, TRIM presents a fresh perspective on the selection and reduction of image tokens. The TRIM method has been extensively tested across 12 datasets, and the results demonstrate a significant reduction in computational overhead while maintaining a consistent level of performance. This research marks a critical stride in efficient MLLM development, promoting greater accessibility and sustainability of high-performing models.
Please refer to LLaVA. 😊
Note that the core of our proposed module is here in the CLIP image encoder.
If you want to reproduce the result of the model trained with TRIM, configure the dataset path, vision_tower path, projecter path and LLM checkpoint path in the training script.
Please set reduce_func
as TRIM
, reduce_func_param
as -1
for automatic selection.
bash scripts/finetune_8gpu_TRIM.sh
If you want to use TRIM without training the model, please download the checkpoints from Huggingface liuhaotian/llava-v1.5-7b or Our fine-tuned 7B model with TRIM or Our fine-tuned 13B model with TRIM.
If you wish to implement TRIM in another model, such as liuhaotian/llava-v1.5-7b in Huggingface, please add the following line to the config.json
file in the model's directory.
"mm_vision_token_reduce_func": "TRIM:-1",
If you want to reproduce the result in our paper, for all benchmark,the evaluation script is:
bash eval_all_benchmarks.sh
For example, the evaluation for TextVQA is:
bash scripts/v1_5/eval/testvqa.sh
For other inference scripts, refer to LLaVA Evaluation.
All software is licensed under the Apache License, Version 2.0 (Apache 2.0). All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY).
- Dingjie Song: [email protected]
- Benyou Wang: [email protected]
If you find this repository helpful, please consider citing it:
@misc{song2024moresimpleeffectivetoken,
title={Less is More: A Simple yet Effective Token Reduction Method for Efficient Multi-modal LLMs},
author={Dingjie Song and Wenjun Wang and Shunian Chen and Xidong Wang and Michael Guan and Benyou Wang},
year={2024},
eprint={2409.10994},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2409.10994},
}