Skip to main content

Fine-tuning data upload rules

Describes the format specifications, packaging requirements, size and quantity limits, and API upload quotas for text generation model fine-tuning data, helping users construct and upload compliant SFT/DPO/CPT training data by training method.

Overview

This document describes the format specifications, packaging requirements, size and quantity limits, and API upload quotas for text generation model fine-tuning data. The scope covers text generation model fine-tuning (text/image/video → text), including plain-text SFT/DPO/CPT, Qwen VL image and video understanding, video frame extraction, function calling, and thinking. Video generation model fine-tuning (image → video) is out of scope. The dataset type (training set or evaluation set) cannot be changed after creation. The support for each training method and element is detailed in Training method and element support matrix. Format construction rules for each combination are described in the corresponding chapters below.
The following operations are irreversible; proceed with caution:
  • Published versions cannot be edited again; only previously created draft versions can be deleted or edited online.
  • The dataset type cannot be changed after creation.
  • Switching the type, scenario, or training method clears the uploaded files.
Management operations (creation parameters, version management, evaluation set management rules, import method selection, data cleansing, security and compliance) are covered in sibling documents; see Training set and evaluation set, Introduction to model fine-tuning, etc. We recommend downloading the data template for the corresponding scenario on the dataset creation page and preparing data according to the template structure to avoid import failures. For dataset construction recommendations (recommended data scale, diversity and balance, data augmentation strategies), see Model fine-tuning introduction - Dataset construction tips.

Training method and element support matrix

The training set supports three training methods: SFT, DPO, and CPT. The support status of each training method and element is shown in the matrix table below. The recommended fine-tuning order is CPT (optional) → SFT → DPO (optional); the three are progressive, not mutually exclusive. Region availability:
  • SFT, local upload, log backflow, API upload, and multimodal data formats are supported in all regions.
  • DPO, CPT, OSS import, and cloud storage mount are only supported in the Beijing region.
The support matrix for training methods and elements is as follows:

Training method

Text generation

Visual understanding - Image input

Visual understanding - Video input (qwen3.5+)

Visual understanding - Tool calling (qwen3.5+)

Deep thinking

SFT

✓

✓

✓

✓

✓

DPO

✓

✗

✗

✗

✓

CPT

✓

✗

✗

✗

✗

Evaluation set

✓

✗

✗

✗

✗

Each training method creates new versions in create-new mode, requiring re-import of all data. For the field definitions of the training methods SFT/DPO/CPT, see Introduction to model fine-tuning.

Text generation - SFT format

SFT text generation training data uses the jsonl file format, based on the ChatML messages multi-turn structure.
  • Supports three roles: system, user, and assistant. The content field is a string (for the content array structure in multimodal scenarios, see the corresponding multimodal format chapter).
  • Maximum single file size is 200 MB.
  • A dataset can mix rows of different formats — each record independently selects a format, no need to unify into a single format.
  • Available formats: standard dialogue, deep thinking, tool calling, and tool calling combined with thinking (see the sample tabs below).
SFT text generation supports the following sample formats. The complete JSON structure of each sample is shown on the corresponding tab:
  • Standard ChatML
  • Deep thinking (thinking)
  • Function calling
Standard ChatML format sample (system/user/assistant multi-turn dialogue):
{
  "messages": [
    {"role": "system", "content": "系统输入1"},
    {"role": "user", "content": "用户输入1"},
    {"role": "assistant", "content": "期望的模型输出1"},
    {"role": "user", "content": "用户输入2"},
    {"role": "assistant", "content": "期望的模型输出2"}
  ]
}

Advanced usage

  1. The loss_weight parameter is supported, with a value range of (0.0, 1.0]; the larger the value, the higher the importance of this record during training.
    Supported by default on Qwen3.5 and later models; to enable support for Qwen3 and Qwen2.5 series models, contact your account manager.
{"role": "assistant", "content": "期望的模型输出", "loss_weight": "1.0"}

Thinking tag rules

Thinking content is wrapped in <think>\n…\n</think>\n\n tags, placed inside the assistant output text (sharing the same last assistant content as the final reply). Rules:
  • It can only be placed in the last assistant output; intermediate assistant outputs must not include thinking tags.
  • The line breaks before and after the thinking tag must be preserved.
  • If a training sample is configured so that the model does not output thinking tags, it is not recommended to re-enable the thinking mode when calling the model after training.

Evaluation set format

Evaluation sets serve text generation and multi-modal scenarios and are independent of the SFT/DPO/CPT training method — models trained with DPO/CPT are also evaluated using text generation evaluation sets, with no distinction by training method. Multi-modal evaluation sets are used for custom evaluation of multi-modal models (visual understanding, image generation, and video generation models). Text evaluation sets support two sample formats, which you select from the training scenario of the data format when creating a dataset:
  • Text generation (prompt&completion): single-turn format. Each record consists of a Prompt (user question) and a Completion (reference answer). Local upload supports only xls and xlsx files (up to 20 MB per file); the column structure can be found in the data template provided by the console.
  • Text generation (ChatML-messages): multi-turn dialogue format. Each record is a messages array composed of system, user, and assistant messages, and the reference answer is the last assistant message in messages. Local upload supports jsonl, xls, and xlsx files (up to 200 MB per file); a sample file can be downloaded when you create the dataset.
Multi-modal evaluation sets support visual understanding, text-to-image, image-to-image, and image-to-video (first frame/first and last frames) scenarios. The data format is a Zip archive (2 GB max per file), with data.jsonl at the root of the archive; image and video files reside in the same archive as data.jsonl and can be placed in subdirectories (for packaging rules, see multi-modal archive packaging rules). When you switch scenarios, the data format description and sample download on the dataset creation page change accordingly. The field structure of data.jsonl for each scenario is as follows (one sample per line, with field values being file paths within the archive):

Scenario

Field

Description

Visual understanding

messages

Message array, with the same structure as the visual understanding SFT format for training sets (the content array contains text and image fields); the reference answer is the last assistant message. For more information, see visual understanding - SFT format

Text-to-image

prompt

Image generation instruction

Image-to-image

prompt

Image editing instruction

Image-to-image

input_imgs

Array of input image file paths (for example, the original image and pose image)

Image-to-image

img_path

Reference answer image file path

Image-to-video (first frame)

first_frame_path

First-frame image file path

Image-to-video (first frame)

prompt

Video generation instruction

Image-to-video (first and last frames)

first_frame_path

First-frame image file path

Image-to-video (first and last frames)

last_frame_path

Last-frame image file path

Image-to-video (first and last frames)

prompt

Video generation instruction

Sample files for each scenario can be downloaded on the dataset creation page, or you can download the following attachments directly:

Visual understanding evaluation set sample (Trainingdata_vl.zip), Text-to-image evaluation set sample (wan-t2i-validation.zip), Image-to-image evaluation set sample (wan-mi2i-validation.zip), Image-to-video (first frame) evaluation set sample (wan-i2v-valid-dataset.zip), Image-to-video (first and last frames) evaluation set sample (wan-kf2v-valid-dataset.zip)

Each scenario's data is packaged separately. Each line below is a data.jsonl example for the text-to-image, image-to-image, image-to-video (first frame), and image-to-video (first and last frames) scenarios in order (for the visual understanding scenario example, see visual understanding - SFT format):
{"prompt": "一只橘猫趴在洒满阳光的窗台上,窗外樱花盛开,画面温暖明亮"}
{"prompt": "把背景换成夕阳下的海滩,人物保持原有姿态", "input_imgs": ["origin.jpg", "pose.png"], "img_path": "result.jpg"}
{"first_frame_path": "first_frame.jpg", "prompt": "镜头从静态画面开始缓慢推近,画面中的人物微笑并向镜头挥手"}
{"first_frame_path": "image/1_first.jpg", "last_frame_path": "image/1_last.jpg", "prompt": "人物从站立的姿态平滑过渡到坐下"}
In the ChatML format, each line is one jsonl record, and single-turn and multi-turn records can be mixed, as shown below:
{"messages": [{"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "谁在文艺复兴时期绘制人体?"}, {"role": "assistant", "content": "文艺复兴时期是一个关于艺术、文化和学术的复兴运动,在这个时期,许多艺术家都绘制了人体。"}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "谁在文艺复兴时期绘制人体?"}, {"role": "assistant", "content": "文艺复兴时期是一个关于艺术、文化和学术的复兴运动,在这个时期,许多艺术家都绘制了人体。"},{"role": "user", "content": "那雕塑方面如何呢?"}, {"role": "assistant", "content": "文艺复兴时期的雕塑也非常有名,几位世界级的雕塑大师都出自于这个时期"}]}
ChatML format field descriptions:
  • messages: the message array. The system message is optional and placed first; user and assistant messages alternate. For multi-turn dialogues, continue appending user/assistant message pairs, and the last assistant message is the reference answer of the record.
  • The content of an assistant message can contain model thinking content: the thinking text is placed before the answer and separated by the </think> marker (used when evaluating reasoning models).
  • extra: an optional custom extension field that supports types such as objects, arrays, and numbers, which you can use to attach custom data to records based on business needs.
Evaluation set specifications:
  • Ingestion methods: local upload and log backflow; Object Storage Service (OSS) import and cloud storage mounting are not supported.
  • Only previously created draft versions support online editing (Prompt/Completion); published versions cannot be edited.
  • For ChatML datasets, the file preview on the dataset details page displays the complete messages content of each jsonl record.
Log backflow ingestion limits:
  • Supported log range is within the last 30 days.
  • Maximum of 100,000 records per import.
  • You must authorize the service-linked role and specify the API Key and model filter conditions.
  • The training set is only available for SFT text generation scenarios (the text generation evaluation set is also supported).
For details on the log backflow ingestion method, seeLog backflow. The evaluation set should be an independent collection of non-overlapping data, used to objectively evaluate the model's generalization ability. For evaluation set management rules, seeTraining set and evaluation set.

Text generation - DPO format

DPO text generation training data uses the jsonl format. Based on the ChatML messages multi-turn structure, it additionally contains two contrasting assistant outputs, chosen and rejected, for preference alignment training. All content within messages is used as input, and DPO is used to train the model's positive/negative feedback on the last user input. For the messages multi-turn structure rules, see Text generation - SFT format. For deep thinking content, the chosen or rejected assistant output can be wrapped with thinking tags. The thinking tag can only be placed in the last assistant line. For the rules, see Text generation - SFT format. The loss_weight parameter (invite-only) supports the chosen module. The value range is 0.0 to 1.0; the larger the value, the higher the training importance. For details, see Text generation - SFT format. The single file size limit for DPO training data is 200 MB, consistent with SFT text generation. For the DPO definition, see Introduction to model fine-tuning. For version management and publish operations, see Training set and evaluation set. See the code block below for a DPO text generation training data sample:
  • Standard ChatML
  • Deep thinking (thinking)
Standard chosen/rejected comparison format sample (two contrasting assistant outputs):
{
  "messages": [
    {"role": "system", "content": "系统输入"},
    {"role": "user", "content": "用户输入1"},
    {"role": "assistant", "content": "模型输出1"},
    {"role": "user", "content": "用户输入2"},
    {"role": "assistant", "content": "模型输出2"},
    {"role": "user", "content": "用户输入3"}
  ],
  "chosen": {"role": "assistant", "content": "赞同的模型期望输出3"},
  "rejected": {"role": "assistant", "content": "反对的模型期望输出3"}
}

Text generation - CPT format

CPT text generation training data uses the jsonl plain text format, with one jsonl object per line, structured as {text}, where the text field is plain text content. For the messages multi-turn structure rules, see Text generation - SFT format. CPT training data constraints:
  • A minimum of 50 million Tokens is recommended, and the single file size limit is 300 MB.
For the CPT definition, see Introduction to model fine-tuning; for version management and publish operations, see Training set and evaluation set. The complete JSON structure of a CPT plain text sample is shown in the code block below. {text} plain text format sample (one jsonl plain text object per line):
{
  "text": "文本内容"
}

Visual understanding-SFT format

SFT image training data is used for Qwen VL multimodal understanding (the console UI option is "Image Understanding"). It uses a zip package format containing a data.jsonl training text data file and image files. data.jsonl must be placed at the root of the package. Each training record's messages in data.jsonl adopt a content array structure, with array items containing an image field (image) and a text field (text). A single-layer directory structure is recommended. For packaging rules, see Multimodal zip package packaging rules.
  • Image input limits
  • Video input limits
Image admission limits are as follows:
  • The width and height of a single image must not exceed 1024 px.
  • A single image must not exceed 10 MB.
  • Supported formats: bmp, jpeg, jpg, png, tif, tiff, webp.
resized_width and resized_height are optional target scaling control parameters used to specify the target scaling dimensions of the image; they are not the image admission upper limit. The image admission upper limit is that the width and height do not exceed 1024 px and a single image does not exceed 10 MB. The specific values for image admission are subject to the actual display in the console.For token consumption calculation for images, see Image and video understanding - Billing and rate limits.
SFT image training examples are shown in the tabs below:
  • Standard ChatML
  • Deep thinking (thinking)
  • Function calling
  • Image input
  • Video file path mode
  • Image frame list mode
Standard ChatML format sample (system/user/assistant multi-turn dialogue):
{
  "messages": [
    {"role": "system", "content": [{"text": "系统输入1"}]},
    {"role": "user", "content": [{"text": "用户输入1"}]},
    {"role": "assistant", "content": [{"text": "期望的模型输出1"}]},
    {"role": "user", "content": [{"text": "用户输入2"}]},
    {"role": "assistant", "content": [{"text": "期望的模型输出2"}]}
  ]
}
For the multimodal understanding definition, see Introduction to model fine-tuning.

Function calling format rules

The function calling mode adds tools definitions and the tool_calls/role:tool mechanism on top of the multi-turn messages structure. Field constraints are as follows:
  • tools: tool definition array; each item contains type:"function" and function{name, description, parameters}; parameters is a JSON Schema (containing type/properties/required).
  • messages: multi-turn dialogue array; roles include user, assistant, and tool.
  • content: multimodal content array; can contain image, text, video, and other items (consistent with the multimodal understanding format).
  • assistant.tool_calls: tool call array generated by the model; contains id, type:"function", function{name, arguments}; arguments is a JSON string.
  • role:"tool": tool return; tool_call_id must correspond one-to-one with the corresponding tool_calls[].id; content contains the tool return result.
The last message of a multi-turn dialogue is usually the assistant's final reply based on the tool return. Bailian does not support OpenAI's name and weight parameters; all assistant outputs will be trained. Training data migrated from OpenAI/Azure must not carry name/weight fields. Data diversity and balance recommendations: the quantity of data in each scenario should be relatively balanced, and the data ratio should match the actual scenario ratio. Avoid having too much of one type of data, which would cause the model to favor learning that type of features and affect generalization ability.

Thinking tag rules

Thinking content is wrapped in <think>\n…\n</think>\n\n tags, placed inside the assistant output text (sharing the same last assistant content as the final reply). Rules:
  • It can only be placed in the last assistant output; intermediate assistant outputs must not include thinking tags.
  • The line breaks before and after the thinking tag must be preserved.
  • If a training sample is configured so that the model does not output thinking tags, it is not recommended to re-enable the thinking mode when calling the model after training.

Multimodal zip package packaging rules

Multimodal understanding training data is uploaded as a zip package via the Add Dataset page. Packaging must meet the following constraints:
  • The zip package supports up to 2 GB.
  • The allowed character set for folder and file names inside the package is ASCII letters (a-z, A-Z), digits (0-9), underscores (_), and hyphens (-).
  • The training text data file is fixed as data.jsonl and must be located in the root directory of the zip package — ensure that after extraction, opening the zip file directly shows data.jsonl, with no additional outer folder wrapping.
Image or video file names must be globally unique within the zip package, even if distributed across different folders. Inside data.jsonl, only the file name needs to be declared rather than the file path — correct example: image1.jpg; wrong example: jpg_folder/image1.jpg. Cloud storage mount does not support zip packages. When loading a dataset via cloud storage mount, you must upload the uncompressed dataset folder as a whole to the OSS Bucket, and specify the data.jsonl file path via MountStorage's file_path; when multiple files are included, only the data.jsonl path needs to be specified, and other files in the same directory are mounted automatically. For details on cloud storage mount, see Fine-tune with the API or CLI. Naming examples and directory structure are shown in the code block below. For cloud storage mount authorization operations, see Fine-tune models in the console; for OSS Bucket import tagging operations, see Training set and evaluation set.
# 单层目录(推荐)
Trainingdata_vl.zip
  |--- data.jsonl        # 必须在根目录,外层不再包裹文件夹
  |--- image1.png
  |--- video1.mp4

# data.jsonl 内声明文件名(非路径)
# 正确:image1.jpg
# 错误:jpg_folder/image1.jpg
Go to the console Create dataset page to upload the multimodal zip package and complete packaging validation.

File size and quantity limits

The upper limits on local upload file size and quantity are set by training method and scenario, as detailed in the scenario-specific table below. For image admission limits, see Visual understanding-SFT format; for evaluation set format limits, see Evaluation set format; for log backflow ingestion limits, see Evaluation set format. max_length takes values in the range 500 to 131072 as a training sequence length configuration parameter, not an upload admission upper limit. The upper limit on the admission size of a single training data record is subject to the display on the console page. The upper limits on local upload file size and quantity are set by training method and scenario. The recommended data volume is the minimum suggested value:

Training method/scenario

Max single file size

Max file count (maxCount)

Recommended data volume

Text generation - SFT format

200 MB

10 (default)

At least thousands of entries

Text generation - DPO format

200 MB

10 (default)

At least hundreds of entries

Text generation - CPT format

300 MB

1

At least 50 million tokens

Multi-modal (zip)

2 GB

1

Prepare sufficient samples based on your actual scenario

File name (excluding extension)

≤120 characters and unique

—

—

Extension

Must be in the Add Dataset list

—

—

API upload quotas

The quotas for uploading fine-tuning files via the DashScope API (with the purpose marked as model fine-tuning) are shown in the quota table below. When creating a dataset in the console, the File API list supports registering up to 10 files in a combined manner; fine-tuning files uploaded via the API are visible and usable in both the console model fine-tuning page and API calls. Constraints on loading datasets via cloud storage mounting:
  • Use the file_path of MountStorage to specify the manifest path of the data.jsonl root directory; zip archives are not supported.
  • Before mounting, you must authorize the Model Studio service to access OSS data.
Handling exceeded limits and encryption:
  • Single files exceeding 300 MB: upload via cloud storage mounting or the multi-modal ZIP 2 GB channel.
  • Total quota exceeded: delete historical files to free up space.
  • Imported data automatically enables OSS server-side encryption (SSE-OSS, AES256).
For more information about API calls, authentication, SDKs, error codes, and MountStorage field details, see Fine-tuning models with the API. The quotas for uploading fine-tuning files via the API are as follows:

Quota item

Limit

Description

Single file size

Up to 300 MB

Fine-tuning files (for model fine-tuning purpose)

Total valid file space

100 GB

Cumulative of undeleted files

Total valid file count

10000

Cumulative of undeleted files

File storage duration

No time limit

Does not auto-expire

File API list upper limit

10

Merged registration when creating a dataset in the console

The differences between OSS import and cloud storage mount are compared as follows:

Dimension

OSS import

Cloud storage mount

Prerequisite

Bailian data access authorization tag

Authorize Bailian service to access OSS data

Data form

Single or batch files

Entire uncompressed dataset folder (zip not supported)

Entry

Data Management > New Dataset > OSS Import

Model Fine-tuning > Create Training Task > Data Configuration > Dataset Mount

Evaluation set

✗

✗

Upload validation and common errors

When uploading files locally on the Add Dataset page, frontend validation rejects files that do not meet the admission rules and displays a prompt. Common validation rejections and upload error scenarios are shown in the collapsible items below:
Diagnosis:maxCount is set by training method — SFT/DPO text defaults to 10, multi-modal zip and CPT default to 1. Uploading files exceeding the corresponding training method's upper limit will be rejected by the frontend.Action:Adjust as follows and re-upload:
  1. Check the maxCount upper limit corresponding to the current training method; for details see File size and quantity limits.
  2. Reduce the file count to within the upper limit; merge multi-modal data into a single zip, and merge CPT data into a single jsonl.
  3. If the file count still exceeds the limit, split into multiple datasets and upload in batches.
Diagnosis:The filename excluding extension has a 120-character upper limit and must contain only ASCII letters, digits, underscores, and hyphens.Action:Adjust as follows and re-upload:
  1. Rename the file so that the filename (excluding extension) is shortened to within 120 characters.
  2. Use only a-z/A-Z/0-9/_/- characters; remove Chinese and other non-ASCII characters.
  3. Filenames inside a multi-modal archive must also be globally unique.
Diagnosis:Filenames within the same dataset must be unique excluding extension; the comparison ignores the extension.Action:Adjust as follows and re-upload:
  1. Check for duplicate-named files and rename them so the part excluding extension is unique.
  2. Files with the same name but different extensions (e.g., image.jpg and image.png) are also judged as duplicates and must be differentiated simultaneously.
  3. Filenames inside a multi-modal zip must be globally unique, even if distributed across different folders.
Diagnosis:The single file size upper limit varies by training method scenario — SFT/DPO text 200 MB, multi-modal zip 2 GB, CPT 300 MB.Action:Adjust as follows and re-upload:
  1. Check whether the file size exceeds the upper limit of the corresponding training method.
  2. Split the jsonl into multiple files for batch upload (SFT/DPO); CPT data splitting requires creating multiple new datasets.
  3. For the overflow handling method when a single file exceeds 300 MB, see API upload quota.
Diagnosis:The extension must be within the supported list — text training uses jsonl; evaluation sets vary by sample format (prompt&completion uses xls/xlsx, and ChatML-messages supports jsonl/xls/xlsx); multi-modal images support bmp/jpeg/jpg/png/tif/tiff/webp, and multi-modal videos support mp4 and other formats.Action:Adjust as follows and re-upload:
  1. Check whether the file extension is within the supported list for the corresponding scenario.
  2. Convert the file to a supported extension and repackage for upload.
  3. Image and video extensions inside a multi-modal zip must each conform, otherwise the entire package import fails.
Diagnosis:Common causes are missing Bucket tag, abnormal Bailian service OSS access authorization, or non-conforming file format.Action:Troubleshoot as follows and retry:
  1. Verify that the OSS Bucket has the Bailian data access authorization tag added.
  2. Confirm that the Bailian service has been authorized to access OSS data.
  3. Check that data.jsonl and the file format conform to the packaging rules and retry the upload; for details see Multimodal zip package packaging rules.
Irreversible operation risk notice:
  • Publish and delete operations are both irreversible; published versions cannot be edited again, and only draft versions can be deleted or edited online.
  • Dataset type (training set/evaluation set) cannot be changed or interchanged after creation; selecting the wrong one requires creating a new dataset and re-importing all data.
  • Switching dataset type, training scenario, or training method clears the uploaded files and resets the storage location and import method.
Automatic validation set splitting randomly extracts 10% of data from the training set as the validation set, reducing the actual training data volume. For small datasets, an independent validation set is recommended; for validation set configuration operations see Fine-tune models in the console. It is recommended to first download the data template for the corresponding scenario; preparing data according to the template structure can avoid import failures. For data template download recommendations see Overview. Common issue troubleshooting is detailed in the collapsible items below. For draft data cleaning and augmentation operations see , and for security and compliance data domains see . When upload validation fails, go to the console New Dataset page to check the file format and admission rules.