Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VTC-R1: Vision-Text Compression for Efficient Long-Context Reasoning

If you find this project useful, please give us a star🌟.

News

Case Inference

Setup

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 path

vLLM for Batch Inference (Evaluation)

Setup

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.txt

Then, 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, amc23

Training

We 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.yaml

Citation

If 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}
}

Acknowledgment

Our work is primarily based on the following codebases. We are sincerely grateful for their work.

About

VTC-R1: Vision-Text Compression for Efficient Long-Context Reasoning.

Resources

Stars

26 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages