๐Ÿš€ VisCo: Leveraging Large Language Models as Intrinsic Encoders for Visual Token Compression

August 7, 2026 ยท View on GitHub

๐Ÿš€ VisCo: Leveraging Large Language Models as Intrinsic Encoders for Visual Token Compression

[ACM Multimedia 2026]

Yupeng Zheng*, Kai Zou*, Bin Liuโ€ , Nenghai Yuโ€ 

*Equal contribution ย ย  โ€ Corresponding author

Compress hundreds of visual tokens into only a few memory tokens while preserving multimodal understanding.

๐Ÿ”ฅ Highlights

  • Intrinsic self-compression. VisCo reuses the pretrained VLM itself as a parameter-sharing autoencoder instead of introducing a separate compression network.
  • Lightweight adaptation. Only memory tokens and encoder-side LoRA adapters are trained; the shared pretrained backbone is kept intact for decoding.
  • Hierarchical KV passing. Layer-wise key-value states associated with memory tokens are transferred from the encoder directly into the decoder KV cache.
  • Extreme compression. VisCo retains 85.3% of LLaVA-1.5-7B performance with one visual token and 91.4% of Qwen2-VL-2B performance with 18 tokens.
  • Broad evaluation. Experiments cover LLaVA-1.5-7B, Qwen2-VL-2B, and Qwen2-VL-7B on six multimodal benchmarks.

๐Ÿ“ฐ News

  • [2026-08-07] Checkpoint of Qwen2-VL-7B-36-Token uploaded to Huggingface.
  • [2026-07-12] Code released.
  • [2026-07-10] Paper uploaded to Arxiv.
  • [2026-07-10] VisCo accepted by ACM Multimedia 2026.

๐Ÿ“– Abstract

Vision-language models (VLMs) process large numbers of visual tokens, resulting in substantial inference latency and memory overhead. This has motivated extensive research on visual token compression. While training-free strategies rely on heuristic metrics and suffer significant performance degradation under high compression ratios, many training-based methods introduce external compression modules that force the VLM backbone to adapt, incurring substantial retraining cost and compromising VLMs' priors. Effective visual token compression hinges on strong information encoding, a capability already present in pretrained VLMs but underutilized by existing approaches. Motivated by this, we propose VisCo, a training-efficient self-compression framework that reuses the pretrained VLM itself as an intrinsic compressor. VisCo is a parameter-sharing autoencoder that compresses visual information using a small set of memory tokens and transfers hierarchical information from encoding to decoding. Experiments show that VisCo surpasses prior methods across all evaluated compression ratios, with larger gains under more aggressive compression, and remains stable even in the extreme single-token setting. Moreover, when combined with the original visual tokens, the learned memory tokens can even improve the base model, suggesting that VisCo captures complementary representations beyond compression.

Comparison of visual token compression paradigms

Comparison with attention-based pruning and external-module-based compression. VisCo reuses the VLM as an intrinsic encoder and transfers hierarchical memory through the KV cache.

๐Ÿ“Š Main Results

LLaVA-1.5-7B

Average is the mean percentage of performance retained relative to the original model.

MethodTokensGQAMMBMMB-CNMMEPOPEMMVetAverage
LLaVA-1.5-7B57662.064.358.31510.785.931.1100.0%
FastV3241.537.833.2884.632.520.757.6%
SparseVLM3248.351.440.61046.767.918.672.6%
PruMerge+3251.156.847.0940.870.921.477.5%
DivPrune3254.957.649.11284.981.526.387.8%
VisPruner3252.258.452.71271.072.728.887.8%
VisCo3258.562.357.21152.981.927.991.8%
PruMerge+126.413.713.7568.940.412.535.4%
VisPruner141.822.425.8764.449.012.048.8%
VisCo158.259.052.41191.278.220.785.3%

Qwen2-VL

Base modelMethodTokensGQAMMBMMB-CNMMEPOPEMMVetAverage
Qwen2-VL-2BOrigin14459.867.361.81465.881.542.5100.0%
Qwen2-VL-2BVisionZip3653.264.356.71372.475.335.591.0%
Qwen2-VL-2BVisCo3661.164.058.91368.382.935.695.2%
Qwen2-VL-2BVisionZip1848.555.241.61300.962.725.876.1%
Qwen2-VL-2BVisCo1859.762.957.81358.082.428.991.4%
Qwen2-VL-7BOrigin14464.876.171.61664.882.656.1100.0%
Qwen2-VL-7BVisionZip3658.372.463.41530.075.339.187.7%
Qwen2-VL-7BVisCo3662.674.070.01551.083.340.492.9%
Qwen2-VL-7BVisionZip1855.366.458.31443.871.733.981.3%
Qwen2-VL-7BVisCo1861.870.068.81496.581.739.290.4%

Qualitative examples of VisCo under extreme compression

Qualitative results under aggressive compression. VisCo preserves perception and reasoning accuracy and produces detailed captions with a single memory token.

๐Ÿ› ๏ธ Installation

git clone https://github.com/Zyvpeng/VisCo.git
cd VisCo

conda create -n visco python=3.10 -y
conda activate visco
pip install --upgrade pip
pip install torch transformers peft datasets safetensors qwen-vl-utils
pip install flash-attn --no-build-isolation

The current implementation additionally uses torch, transformers, peft, datasets, safetensors, qwen-vl-utils, and FlashAttention for LLaVA.

โšก Quick Start

The case examples read /home/ypzheng/VLM_ICAE/data/case/data.json. Each item must provide image and question fields. Run commands from the repository parent so that VisCo is importable.

Qwen2-VL case inference

cd /home/ypzheng
conda activate mmicae2

python -m VisCo.inference.case_qwen2 \
  --model_name_or_path /home/ypzheng/Qwen2-VL-2B-Instruct \
  --output_dir /path/to/qwen2_visco_checkpoint.pt \
  --fixed_mem_size 18 \
  --train false \
  --per_device_train_batch_size 1

LLaVA-1.5 case inference

cd /home/ypzheng
conda activate mmicae2

python -m VisCo.inference.case_llava15 \
  --model_name_or_path /home/ypzheng/llava15 \
  --output_dir /path/to/llava_visco_checkpoint.pt \
  --fixed_mem_size 32 \
  --train false \
  --per_device_train_batch_size 1

--output_dir is used by the inference scripts as the checkpoint file path and is loaded with torch.load.

๐Ÿš‚ Training

Both training scripts fine-tune for one epoch on LLaVA-665K-style JSON data. Update the dataset path near the top of the selected script before launching. Qwen2-VL trains LoRA on q_proj and v_proj; LLaVA-1.5 trains LoRA on the attention q/k/v/o projections. Memory-token embeddings are learned jointly, while decoding reuses the shared backbone without the encoder LoRA adapters.

Qwen2-VL-2B

cd /home/ypzheng
torchrun --nproc_per_node=1 -m VisCo.train.train_qwen2 \
  --model_name_or_path /home/ypzheng/Qwen2-VL-2B-Instruct \
  --output_dir /path/to/output/qwen2_visco \
  --fixed_mem_size 18

LLaVA-1.5-7B

cd /home/ypzheng
torchrun --nproc_per_node=8 -m VisCo.train.train_llava15 \
  --model_name_or_path /home/ypzheng/llava15 \
  --output_dir /path/to/output/llava_visco \
  --fixed_mem_size 32

Training uses the tokenization/mapping functions and data collators in utils/preprocess.py, then delegates optimization and checkpointing to train_model in the same module.

๐Ÿงช Evaluation

The released evaluation entry points cover MME for both backbones. They load the checkpoint passed through --output_dir, preprocess the benchmark with the matching backbone-specific mapping function, and report MME accuracy and accuracy+ scores.

# Qwen2-VL
python -m VisCo.inference.mme_qwen2 \
  --model_name_or_path /home/ypzheng/Qwen2-VL-2B-Instruct \
  --output_dir /path/to/qwen2_visco_checkpoint.pt \
  --fixed_mem_size 18 \
  --train false

# LLaVA-1.5
python -m VisCo.inference.mme_llava15 \
  --model_name_or_path /home/ypzheng/llava15 \
  --output_dir /path/to/llava_visco_checkpoint.pt \
  --fixed_mem_size 32 \
  --train false

The paper evaluates GQA, MMBench, MMBench-CN, MME, POPE, and MMVet. Additional benchmark entry points will be added as they are cleaned for release.

๐Ÿ“ Repository Structure

VisCo/
|-- model/
|   |-- visco_llava.py       # VisCo_LLaVA: LoRA encoder and hierarchical KV-cache decoder
|   `-- visco_qwen2.py       # VisCo_Qwen2: LoRA encoder and hierarchical KV-cache decoder
|-- train/
|   |-- train_llava15.py     # LLaVA-1.5 training entry point
|   `-- train_qwen2.py       # Qwen2-VL training entry point
|-- inference/
|   |-- case_llava15.py      # Local case inference with LLaVA-1.5
|   |-- case_qwen2.py        # Local case inference with Qwen2-VL
|   |-- mme_llava15.py       # MME evaluation with LLaVA-1.5
|   `-- mme_qwen2.py         # MME evaluation with Qwen2-VL
|-- utils/
|   |-- preprocess.py        # Dataset mapping, tokenization, collators, and training utilities
|   |-- lora.py              # LoRA helper utilities
|   `-- callbacks.py         # Trainer callbacks
|-- __init__.py
`-- README.md

โœ… TODO

  • Release the paper.
  • Release inference code.
  • Release model checkpoints.
  • Release training code.
  • Release evaluation scripts.
  • Support additional VLM backbones.
  • Release the project page.

๐Ÿ“Œ Citation

If you find this project useful, please cite:

@inproceedings{zheng2026visco,
  title     = {VisCo: Leveraging Large Language Models as Intrinsic Encoders for Visual Token Compression},
  author    = {Zheng, Yupeng and Zou, Kai and Liu, Bin and Yu, Nenghai},
  booktitle = {Proceedings of the 34th ACM International Conference on Multimedia},
  year      = {2026}
}

๐Ÿ™ Acknowledgements

This project builds on LLaVA, Qwen2-VL, Hugging Face Transformers.