How to use from
Docker Model Runner
docker model run hf.co/yunfanyang1/Qwen2.5-VL-7B-GRPO
Quick Links

Qwen2.5-VL-7B-GRPO

Official baseline model weights for CSPO: Alleviating Reward Ambiguity for Structured Table-to-LaTeX Generation.

Model Description

Qwen2.5-VL-7B-GRPO is a multimodal baseline model for structured table-to-LaTeX generation. It is built on top of Qwen/Qwen2.5-VL-7B-Instruct and trained to convert table images into complete, compilable LaTeX code.

This model is trained with a two-stage pipeline consisting of supervised fine-tuning (SFT) followed by reinforcement learning with Group Relative Policy Optimization (GRPO). It serves as a comparison baseline for evaluating the effectiveness of Component-Specific Policy Optimization (CSPO). Unlike CSPO, which uses component-specific rewards and token-level credit assignment, this GRPO baseline is optimized with a global reward signal.

Component Detail
Model Qwen2.5-VL-7B-GRPO
Backbone Qwen2.5-VL-7B-Instruct
Model Type Vision-language model
Task Table image-to-LaTeX generation
Input Table image + text instruction
Output LaTeX code
Training Data TableTex
Training Pipeline SFT + GRPO

Training Data

The model is trained on TableTex, a dataset of paired table images and renderable LaTeX code constructed from publicly available arXiv papers under permissive licenses. The dataset contains tables from multiple academic domains, including Computer Science, Mathematics, Economics, Electrical Engineering and Systems Science, Quantitative Finance, and Statistics.

TableTex contains 19,000 table image-LaTeX pairs, split into 15,000 training samples and 4,000 test samples. Each sample includes a rendered table image and corresponding LaTeX code with necessary package declarations, table captions, and the table body.

Evaluation

Detailed evaluation results are reported in our paper.

Usage

import torch
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
from qwen_vl_utils import process_vision_info

model_id = "yunfanyang1/Qwen2.5-VL-7B-GRPO"

model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    attn_implementation="flash_attention_2",
)

processor = AutoProcessor.from_pretrained(model_id)

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": "file:///absolute/path/to/table_image.png"},
            {
                "type": "text",
                "text": "Please generate complete LaTeX code for the table in the image, including the table body and the full preamble."
            },
        ],
    }
]

text = processor.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

image_inputs, video_inputs = process_vision_info(messages)

inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    padding_side="left",
    return_tensors="pt",
).to(model.device)

generated_ids = model.generate(
    **inputs,
    max_new_tokens=8192,
    do_sample=False,
)

generated_ids_trimmed = [
    out_ids[len(in_ids):]
    for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]

output_text = processor.batch_decode(
    generated_ids_trimmed,
    skip_special_tokens=True,
    clean_up_tokenization_spaces=False,
)

print(output_text[0])

See the GitHub repository for full installation, evaluation, and training instructions.

License

This model is built on top of Qwen/Qwen2.5-VL-7B-Instruct; users should also comply with the license and terms of the base model.

Citation

If you find this model useful, please cite our paper:

@article{yang2026cspo,
  title={CSPO: Alleviating Reward Ambiguity for Structured Table-to-LaTeX Generation},
  author={Yang, Yunfan and Lan, Cuiling and Sang, Jitao and Lu, Yan},
  journal={arXiv preprint arXiv:2604.10918},
  year={2026}
}
Downloads last month
6
Safetensors
Model size
8B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yunfanyang1/Qwen2.5-VL-7B-GRPO

Finetuned
(1190)
this model

Dataset used to train yunfanyang1/Qwen2.5-VL-7B-GRPO

Paper for yunfanyang1/Qwen2.5-VL-7B-GRPO