Skip to main content

Directory Structure

The directory should be archived in a .zip file and stored in an object storage. Example zip command:cd path/to/dataset_dir && zip -r dataset_dir.zip ./*

Dataset Structure

The train.jsonl file should be a list of JSON-like objects, serialised in jsonl format, where each object has exactly three keys:

Example JSONL File


Field Definitions


Prompt Format

Each prompt entry is a list of one or more messages. Minimal single-turn example:

Message fields

  • role: usually user (extend with assistant for multi-turn data).
  • content: ordered list of messages in a turn. Content can have two subtypes:
    • { "type": "image" } - placeholder indicating an image input accompanies this turn
    • { "type": "text", "text": "<question/text> + <control tags>" } - Text message from the user or assistant.

Image Format

Path to the image file relative to the root of the dataset files archive. Example:

Answer Format

The expected answer to the question. Example:

Complete Example


Reward functions

Depending on the dataset structure and task objectives, you may need to define reward functions for model training. These reward functions are accepted by the trainer through a special reward_models.py file. This sections outlines (with examples) the standard method for providing custom reward functions. Users should define their reward functions in a file named reward_models.py, which must expose a list named reward_functions containing callable functions.
The reward functions list is then passed directly to GRPOTrainer like so:

GRPOTrainer(reward_functions=reward_functions, **kwargs)

Example implementation


  • formatting_reward_func checks that <think>…</think> and <answer>…</answer> appear exactly once.
  • correctness_reward_func validates the extracted answer matches the ground truth.