🌐 Homepage | 📖 arXiv | 💻 GitHub | 🤗 Model | 🌟 Demo
BIMBA: Selective-Scan Compression for Long-Range Video Question Answering
Md Mohaiminul Islam, Tushar Nagarajan, Huiyu Wang, Gedas Bertasius, and Lorenzo Torresani
Accepted by CVPR 2025
Mar 20, 2025: BIMBA-LLaVA-Qwen2-7B model weigts are released on HuggingFace 🤗
Mar 20, 2025: Released the training and evaluation code.
Feb 27, 2025: BIMBA is accepted by CVPR 2025! 🔥🔥
BIMBA is a multimodal large language model (MLLM) capable of efficiently processing long-range videos. Our model leverages the selective scan mechanism of Mamba to effectively select critical information from high-dimensional video and transform it into a reduced token sequence for efficient LLM processing. Extensive experiments demonstrate that BIMBA achieves state-of-the-art accuracy on multiple long-form VQA benchmarks, including PerceptionTest, NExT-QA, EgoSchema, VNBench, LongVideoBench, Video-MME, and MLVU.
Please use the following commands to install the required packages:
cd BIMBA-LLaVA-NeXT
conda create --name bimba python=3.10
conda activate bimba
pip install -r requirements.txt
This codebase is built on LLaVA-NeXT and mamba codebases.
We provide a demo notebook on how to use selective-scan/mamba-based token compression method for long-range videos introduced in our paper. Following this notebook, you can easily utilize this compression technique to reduce the input video tokens of your model.
Download the model from HuggingFace 🤗
cd BIMBA-LLaVA-NeXT/checkpoints
git clone https://huggingface.co/mmiemon/BIMBA-LLaVA-Qwen2-7B
Use the following script to make inference on any video.
cd BIMBA-LLaVA-NeXT
python inference.py
cd BIMBA-LLaVA-NeXT
bash scripts/video/train/Train_BIMBA_LLaVA_Qwen2_7B.sh
BIMBA-LLaVA-NeXT/DATAS/eval folder. You can format a new dataset using the script.cd BIMBA-LLaVA-NeXT
python llava/eval/format_eval_data.py
cd BIMBA-LLaVA-NeXT
model_path = "checkpoints/BIMBA-LLaVA-Qwen2-7B"
model_base = "lmms-lab/LLaVA-Video-7B-Qwen2"
model_name = "llava_qwen_lora"
results_dir=results/BIMBA-LLaVA-Qwen2-7B
dataset_name=VideoMME
python llava/eval/infer.py \
--model_path $model_path \
--model_base $model_base \
--model_name $model_name \
--results_dir ${results_dir}/${dataset_name} \
--max_frames_num 64 \
--dataset_name $dataset_name \
--video_root "path_to_video_folder" \
--data_path DATAS/eval/VideoMME/formatted_dataset.json \
--cals_acc
cd BIMBA-LLaVA-NeXT
bash scripts/video/eval/Eval_BIMBA_LLaVA_Qwen2_7B.sh
python llava/eval/submit_ego_schema.py
Then, you can either submit directly to the kaggle competition page or use the script for submission and evaluation.
kaggle competitions submit -c egoschema-public -f results/BIMBA-LLaVA-Qwen2-7B/EgoSchema/es_submission.csv -m "BIMBA-LLaVA-Qwen2-7B"
| Dataset | EgoSchema | VNBench | VideoMME | MLVU | LongVideoBench | NextQA | PerceptionTest |
|---|---|---|---|---|---|---|---|
| Results | 71.14 | 77.88 | 64.67 | 71.37 | 59.46 | 83.73 | 68.51 |
If you find BIMBA useful in your research, please use the following BibTeX entry for citation.
@article{islam2025bimba,
title={BIMBA: Selective-Scan Compression for Long-Range Video Question Answering},
author={Islam, Md Mohaiminul and Nagarajan, Tushar and Wang, Huiyu and Bertasius, Gedas and Torresani, Lorenzo},
journal={arXiv preprint arXiv:2503.09590},
year={2025}
}
Python
99.1%
🌐 Homepage | 📖 arXiv | 💻 GitHub | 🤗 Model | 🌟 Demo
BIMBA: Selective-Scan Compression for Long-Range Video Question Answering
Md Mohaiminul Islam, Tushar Nagarajan, Huiyu Wang, Gedas Bertasius, and Lorenzo Torresani
Accepted by CVPR 2025
Mar 20, 2025: BIMBA-LLaVA-Qwen2-7B model weigts are released on HuggingFace 🤗
Mar 20, 2025: Released the training and evaluation code.
Feb 27, 2025: BIMBA is accepted by CVPR 2025! 🔥🔥
BIMBA is a multimodal large language model (MLLM) capable of efficiently processing long-range videos. Our model leverages the selective scan mechanism of Mamba to effectively select critical information from high-dimensional video and transform it into a reduced token sequence for efficient LLM processing. Extensive experiments demonstrate that BIMBA achieves state-of-the-art accuracy on multiple long-form VQA benchmarks, including PerceptionTest, NExT-QA, EgoSchema, VNBench, LongVideoBench, Video-MME, and MLVU.
Please use the following commands to install the required packages:
cd BIMBA-LLaVA-NeXT
conda create --name bimba python=3.10
conda activate bimba
pip install -r requirements.txt
This codebase is built on LLaVA-NeXT and mamba codebases.
We provide a demo notebook on how to use selective-scan/mamba-based token compression method for long-range videos introduced in our paper. Following this notebook, you can easily utilize this compression technique to reduce the input video tokens of your model.
Download the model from HuggingFace 🤗
cd BIMBA-LLaVA-NeXT/checkpoints
git clone https://huggingface.co/mmiemon/BIMBA-LLaVA-Qwen2-7B
Use the following script to make inference on any video.
cd BIMBA-LLaVA-NeXT
python inference.py
cd BIMBA-LLaVA-NeXT
bash scripts/video/train/Train_BIMBA_LLaVA_Qwen2_7B.sh
BIMBA-LLaVA-NeXT/DATAS/eval folder. You can format a new dataset using the script.cd BIMBA-LLaVA-NeXT
python llava/eval/format_eval_data.py
cd BIMBA-LLaVA-NeXT
model_path = "checkpoints/BIMBA-LLaVA-Qwen2-7B"
model_base = "lmms-lab/LLaVA-Video-7B-Qwen2"
model_name = "llava_qwen_lora"
results_dir=results/BIMBA-LLaVA-Qwen2-7B
dataset_name=VideoMME
python llava/eval/infer.py \
--model_path $model_path \
--model_base $model_base \
--model_name $model_name \
--results_dir ${results_dir}/${dataset_name} \
--max_frames_num 64 \
--dataset_name $dataset_name \
--video_root "path_to_video_folder" \
--data_path DATAS/eval/VideoMME/formatted_dataset.json \
--cals_acc
cd BIMBA-LLaVA-NeXT
bash scripts/video/eval/Eval_BIMBA_LLaVA_Qwen2_7B.sh
python llava/eval/submit_ego_schema.py
Then, you can either submit directly to the kaggle competition page or use the script for submission and evaluation.
kaggle competitions submit -c egoschema-public -f results/BIMBA-LLaVA-Qwen2-7B/EgoSchema/es_submission.csv -m "BIMBA-LLaVA-Qwen2-7B"
| Dataset | EgoSchema | VNBench | VideoMME | MLVU | LongVideoBench | NextQA | PerceptionTest |
|---|---|---|---|---|---|---|---|
| Results | 71.14 | 77.88 | 64.67 | 71.37 | 59.46 | 83.73 | 68.51 |
If you find BIMBA useful in your research, please use the following BibTeX entry for citation.
@article{islam2025bimba,
title={BIMBA: Selective-Scan Compression for Long-Range Video Question Answering},
author={Islam, Md Mohaiminul and Nagarajan, Tushar and Wang, Huiyu and Bertasius, Gedas and Torresani, Lorenzo},
journal={arXiv preprint arXiv:2503.09590},
year={2025}
}
Python
99.1%