-
Jan 29, 2026.We release our paper in arxiv and our model in huggingface.
First, please install the required dependencies using the following command:
apt-get install poppler-utils # or conda install -c conda-forge poppler
pip install torch==2.6.0
pip install transformers==4.57.1
pip install reportlab
pip install pdf2image We provide the inference code for running VTC-R1 models, which can output VTC-R1 style reasoning.
python inference.py # replace your model pathvLLM for Batch Inference (Evaluation)
We recommend creating a new environment, such as conda, to avoid dependency conflicts.
apt-get install poppler-utils # or conda install -c conda-forge poppler
pip install torch==2.8.0
pip install transformers==4.57.1
pip install vllm==0.10.2
cd evaluation
pip install -r requirements.txtThen, run the code to evaluation:
bash scripts/run_eval.sh direct /YOUR/PATH/TO/MODEL # gsm8k, math500, gpqa_d
bash scripts/run_eval_16.sh direct /YOUR/PATH/TO/MODEL # aime25, amc23We use LLaMA-Factory to fine-tune the VTC-R1 models. We provide the training instructions and configs here.
First, install LLaMA-Factory according to the official_instruction.
Then, refer here and update the following customized dataset into dataset_info.json in LLaMA-Factory.
"vtc-r1": {
"file_name": "./openr1_vtc_r1",
"formatting": "sharegpt",
"columns": {
"messages": "messages",
"images": "images"
},
"tags": {
"role_tag": "role",
"content_tag": "content",
"user_tag": "user",
"assistant_tag": "assistant",
"system_tag": "system"
}
},Finally, you can use the following command to train the models.
llamafactory-cli train examples/vtcr1_glyph_full_sft.yamlIf you find this repository is useful, please star🌟 this repo and cite🖇️ our paper.
@article{wang2026vtc,
title={VTC-R1: Vision-Text Compression for Efficient Long-Context Reasoning},
author={Wang, Yibo and Jing, Yongcheng and Liu, Shunyu and Guan, Hao and Tu, Rong-cheng and Wang, Chengyu and Huang, Jun and Tao, Dacheng},
journal={arXiv preprint arXiv:2601.22069},
year={2026}
}Our work is primarily based on the following codebases. We are sincerely grateful for their work.
- LLaMA-Factory: We use llama-factory to fine-tune Models.
- Glyph: We use Glyph as the intial ckpt and rendering.
- math-evaluation-harness We use it for evaluation.