{"id":24251371,"url":"https://github.com/Yxxxb/VoCo-LLaMA","last_synced_at":"2025-09-23T16:31:09.105Z","repository":{"id":245044186,"uuid":"816241048","full_name":"Yxxxb/VoCo-LLaMA","owner":"Yxxxb","description":"VoCo-LLaMA: This repo is the official implementation of \"VoCo-LLaMA: Towards Vision Compression with Large Language Models\".","archived":false,"fork":false,"pushed_at":"2024-07-06T11:45:49.000Z","size":837,"stargazers_count":78,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-18T23:16:02.850Z","etag":null,"topics":["image-compression","llama","llava"],"latest_commit_sha":null,"homepage":"https://yxxxb.github.io/VoCo-LLaMA-page/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yxxxb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T10:32:51.000Z","updated_at":"2024-10-16T16:01:54.000Z","dependencies_parsed_at":"2024-07-27T20:03:32.778Z","dependency_job_id":"ac9d0f96-7e63-4e6a-8888-b40477501652","html_url":"https://github.com/Yxxxb/VoCo-LLaMA","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"25eb325a33a12410d919fae1edf4923eba686848"},"previous_names":["yxxxb/voco-llama"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yxxxb%2FVoCo-LLaMA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yxxxb%2FVoCo-LLaMA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yxxxb%2FVoCo-LLaMA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yxxxb%2FVoCo-LLaMA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yxxxb","download_url":"https://codeload.github.com/Yxxxb/VoCo-LLaMA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233985939,"owners_count":18761562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-compression","llama","llava"],"created_at":"2025-01-15T02:50:52.942Z","updated_at":"2025-09-23T16:31:09.099Z","avatar_url":"https://github.com/Yxxxb.png","language":"Python","funding_links":[],"categories":["📖 Related Papers"],"sub_categories":["2024.6 ###"],"readme":"# VoCo-LLaMA: Towards Vision Compression with Large Language Models\n\n[Xubing Ye](https://yxxxb.github.io/), [Yukang Gan](https://scholar.google.com/citations?user=8rltp9AAAAAJ\u0026hl=zh-CN), [Xiaoke Huang](https://xk-huang.github.io/), [Yixiao Ge](https://geyixiao.com/), [Yansong Tang](https://andytang15.github.io)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href='https://arxiv.org/abs/2406.12275v2'\u003e\n  \u003cimg src='https://img.shields.io/badge/Arxiv-2406.12275-A42C25?style=flat\u0026logo=arXiv\u0026logoColor=A42C25'\u003e\u003c/a\u003e \n  \u003ca href='https://arxiv.org/pdf/2406.12275v2'\u003e\n  \u003cimg src='https://img.shields.io/badge/Paper-PDF-purple?style=flat\u0026logo=arXiv\u0026logoColor=yellow'\u003e\u003c/a\u003e \n  \u003ca href='https://yxxxb.github.io/VoCo-LLaMA-page/'\u003e\n  \u003cimg src='https://img.shields.io/badge/Project-Page-%23df5b46?style=flat\u0026logo=Google%20chrome\u0026logoColor=%23df5b46'\u003e\u003c/a\u003e \n\u003c/p\u003e\n\n## TL;DR\n\nWe propose VoCo-LLaMA, the first approach to compress vision tokens using LLMs. By fully utilizing the LLMs' understanding paradigm of vision tokens, our method can compress hundreds of vision tokens into a single VoCo token, while minimizing visual information loss.\n\nVoCo-LLaMA demonstrates the ability to understand video through continuous training using time-series compressed token sequences of video frames.\n\nVoCo-LLaMA presents a promising way to unlock the full potential of VLMs' contextual window.\n\n![image](https://i.imgur.com/wznshA6.jpeg)\n\n## News\n\n- [x] **[2024/06/17]** Upload paper and release vision compression code.\n\n## Preparation\n\n### Install\n\n1. Clone this repository and navigate to VoCo-LLaMA folder\n\n```bash\ngit clone https://github.com/Yxxxb/VoCo-LLaMA.git\ncd VoCo-LLaMA\n```\n\n2. Install Package\n\n```Shell\nconda create -n voco_llama python=3.10 -y\nconda activate voco_llama\npip install --upgrade pip  # enable PEP 660 support\npip install -e .\n```\n\n3. Install additional packages for training cases\n\n```\npip install -e \".[train]\"\npip install flash-attn --no-build-isolation\ncp VoCo-LLaMA/llava/model/language_model/cache_py/modeling_attn_mask_utils.py /data/miniconda3/envs/voco_llama/lib/python3.10/site-packages/transformers/modeling_attn_mask_utils.py\n```\n\n### Data and Pre-trained weights\n\nVoCo-LLaMA training requires only visual instruction fine-tuning. Please download the aligned LLaVA checkpoints ([base LLM and projection layers](https://github.com/haotian-liu/LLaVA/blob/main/docs/MODEL_ZOO.md)). Please download the annotation of the LLaVA instruction tuning data [llava_v1_5_mix665k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/llava_v1_5_mix665k.json), and download the images from constituting datasets:\n\n- COCO: [train2017](http://images.cocodataset.org/zips/train2017.zip)\n- GQA: [images](https://downloads.cs.stanford.edu/nlp/data/gqa/images.zip)\n- OCR-VQA: [download script](https://drive.google.com/drive/folders/1_GYPY5UkUy7HIcR0zq3ZCFgeZN7BAfm_?usp=sharing), we save all files as `.jpg`\n- TextVQA: [train_val_images](https://dl.fbaipublicfiles.com/textvqa/images/train_val_images.zip)\n- VisualGenome: [part1](https://cs.stanford.edu/people/rak248/VG_100K_2/images.zip), [part2](https://cs.stanford.edu/people/rak248/VG_100K_2/images2.zip)\n\nAfter downloading all of them, organize the data as follows in `./playground/data`,\n\n```\n├── coco\n│   └── train2017\n├── gqa\n│   └── images\n├── ocr_vqa\n│   └── images\n├── textvqa\n│   └── train_images\n└── vg\n    ├── VG_100K\n    └── VG_100K_2\n```\n\n## Train\n\nVoCo-LLaMA is trained on 8 A100 GPUs with 40GB memory. To train on fewer GPUs, you can reduce the `per_device_train_batch_size` and increase the `gradient_accumulation_steps` accordingly. Always keep the global batch size the same: `per_device_train_batch_size` x `gradient_accumulation_steps` x `num_gpus`. \n\nTrain VoCo-LLaMA with vision instruction tuning by running following command:\n\n```\nbash scripts/finetune.sh\n```\n\n## Evaluation\n\nThere are evaluations about visual understanding we follow the relevant settings in LLaVA. Please refer to the LLaVA official [repository](https://github.com/haotian-liu/LLaVA/blob/main/docs/Evaluation.md) for details of data setup and testing.\n\n## Citation\n\nIf you find this work useful, please consider citing our paper:\n\n```bash\n@InProceedings{Ye_2025_CVPR,\n    author    = {Ye, Xubing and Gan, Yukang and Huang, Xiaoke and Ge, Yixiao and Tang, Yansong},\n    title     = {VoCo-LLaMA: Towards Vision Compression with Large Language Models},\n    booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)},\n    month     = {June},\n    year      = {2025},\n    pages     = {29836-29846}\n}\n```\n\n## \n\n## Acknowledgement\n\n- [LLaVA](https://github.com/haotian-liu/LLaVA): the codebase we built upon.\n- [Vicuna](https://github.com/lm-sys/FastChat): our base model Vicuna-7B that has the amazing language capabilities!\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYxxxb%2FVoCo-LLaMA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYxxxb%2FVoCo-LLaMA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYxxxb%2FVoCo-LLaMA/lists"}