How to label data for PaliGemma training
Before you can train a computer vision model, you need labeled data on which to train your model. The more accurate the labels, or annotations, are, the higher the performance the model will achieve.
Overview
PaliGemma is a vision language model. It learns from pairs of text for each image: a prefix, the prompt you give the model, and a suffix, the answer it should return. This guide shows how to label those pairs in a Multimodal project in Roboflow Annotate, then train PaliGemma in Roboflow or export your data to train it yourself.
Roboflow Annotate runs in your browser and is free to start. Roboflow is SOC 2 Type 2 compliant and used by over 2 million developers.
To label data for PaliGemma, you will:
- Create a multimodal project and upload images
- Open an image in Roboflow Annotate
- Write prefix and suffix pairs
- Train PaliGemma or export your data
Step 1: Create a project and upload images
Create a free Roboflow account, then create a new project. Give it a name and choose Multimodal as the project type:

Next, upload your images. Drag them onto the Upload Data page, or select files or a whole folder. If you already have labels, upload the annotation files with your images to review or fix them in Roboflow Annotate:

Step 2: Open an image
Click any image in your project to open it in Roboflow Annotate. In a Multimodal project, the editor shows a prefix and a suffix field for each pair:

Step 3: Write prefix and suffix pairs
For PaliGemma, write the prefix as a short instruction, such as "Extract all receipt information as structured JSON." Use the same wording for the same task on every image.
Write the suffix exactly as you want the model to answer. If you want structured output, like the JSON on this receipt, use the same keys and format on every image.
Click "Add New Pair" to teach more than one task on the same image. To reuse prefixes across images, add them under Classes & Tags in the project sidebar. The multimodal labeling guide (opens in a new tab) covers both.
Step 4: Train PaliGemma or export your data
When your images are labeled, generate a dataset version. Then open Train in your project, click "Custom Training", and choose "PaliGemma 2". The Train a Model guide (opens in a new tab) walks through each option.
To train PaliGemma on your own hardware instead, export the version as JSONL, with one prefix and suffix pair per line.
Learn how to label data for other models
Each guide walks through the same steps in Roboflow Annotate for a different model.
- Detectron2 Instance Segmentation
- Detectron2 Object Detection
- DETR
- Florence-2
- GPT-4o
- MMDetection
- MT-YOLOv6
- RF-DETR
- RF-DETR Pose
- RF-DETR Segmentation
- RF-DETR Semantic Segmentation
- RTMDet
- Vision Transformer
- YOLO-NAS
- YOLO11
- YOLO11 OBB
- YOLO26
- YOLOR
- YOLOS
- YOLOv3 PyTorch
- YOLOv4 PyTorch
- YOLOv5
- YOLOv5 Classification
- YOLOv5 Instance Segmentation
- YOLOv7
- YOLOv7 Instance Segmentation
- YOLOv8
- YOLOv8 Classification
- YOLOv8 Instance Segmentation
- YOLOv8 Oriented Bounding Boxes
- YOLOv9
- YOLOv10
- YOLOv12
- YOLOX