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 applicable scope is text generation model fine-tuning (text/image/video → text), covering pure text SFT/DPO/CPT, Qwen VL image and video understanding, video frame extraction, tool calling (function calling), and deep thinking (thinking). Video generation model fine-tuning (image → video) is out of this scope. Evaluation sets are not subject to these limits: in addition to the text generation format, they also support multi-modal scenarios such as visual understanding, text-to-image, image-to-image, and image-to-video (used for multi-modal model evaluation). For the format, see Evaluation set format.
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.
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.
For reinforcement learning (RL) training data format (jsonl + messages + rollout_extra, uploaded via SDK), see RL training data format.
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.
Training method | Text generation | Visual understanding - Image input | Visual understanding - Video input (qwen3.5+) | Visual understanding - Tool calling (qwen3.5+) | Deep thinking |
|---|---|---|---|---|---|
✓ | ✓ | ✓ | ✓ | ✓ | |
✓ | ✗ | ✗ | ✗ | ✓ | |
✓ | ✗ | ✗ | ✗ | ✗ | |
✓ | ✗ | ✗ | ✗ | ✗ |
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: plain dialogue, deep thinking, tool calling, and tool calling combined with thinking (see the sample tabs below).
- Standard ChatML
- Deep thinking (thinking)
- Tool calling (function calling)
Advanced usage
-
Supports the
loss_weightparameter, with a value range of(0.0, 1.0]; the larger the value, the higher the importance of this record during training.Supported by Qwen3.5 and later models by default; to support Qwen3 and Qwen2.5 series models, contact your account manager.
Notes on the Thinking Mode Format
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 scenarios and multi-modal scenarios, and are independent of the SFT/DPO/CPT training method—models fine-tuned 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.
Scenario | Field | Description |
|---|---|---|
Visual Understanding | messages | Message array, with the same structure as the visual understanding SFT format of 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 the 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 Frame) | first_frame_path | First frame image file path |
Image-to-Video (First and Last Frame) | last_frame_path | Last frame image file path |
Image-to-Video (First and Last Frame) | prompt | Video generation instruction |
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 frame) evaluation set sample (wan-kf2v-valid-dataset.zip)
Data for each scenario is packaged separately. Each line below is a data.jsonl example for, in order, the text-to-image, image-to-image, image-to-video (first frame), and image-to-video (first and last frame) scenarios (for the visual understanding scenario example, see Visual Understanding - SFT Format):- 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; some rule evaluation preset templates (Contains all substrings, Contains any substring, and Regex match) use this field as an evaluation input.
- Ingestion methods: local upload and log replay; Object Storage Service (OSS) import and cloud storage mounting are not supported.
- Only 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.
- 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).
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 draft 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)
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.
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
- 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.
- Standard ChatML
- Deep thinking (thinking)
- Tool calling (function calling)
- Image input
- Video file path mode
- Image frame list mode
Tool Calling Format
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.
Thinking Mode Format
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.
RL Training Data Format
Reinforcement learning (RL) training data uses the jsonl format, with one JSON object per line, containing the messages and rollout_extra fields. RL is uploaded via the SDK (AgenticRL.run()), not the console packaging channel; billing is by MTU model training unit, not Token. For details on RL data format, SDK upload, and Rollout/Reward function development, see Reinforcement learning training overview.
Field descriptions:
messages: the user question, in ChatML structure ([{role, content}]). It only contains the prompt (user, optionally prefixed withsystem), and does not includeassistantanswers — the answer is autonomously generated by the model during the Rollout phase.contentis a string.rollout_extra: the reference answer or business data, of dict type, passed through to the Reward function for scoring. It supports custom keys (not limited tosolution); the framework automatically extractsground_truth(the reference answer), and custom keys are read viarollout_extra["key"].
rewardfield — reward is computed by the Reward function at training runtime (scoring against the rollout_extra reference answer, outputting a 0~1 score), and is not preset in the jsonl. Unlike SFT (messages contain the full assistant answer) and DPO (chosen/rejected pairs), RL messages only contain the prompt.
Math reasoning sample (rollout_extra.solution standard answer):
entry_point/tests/timeout_sec/language):
expected_tools/success_check/max_steps):
rollout_extra (by scenario):
- Math reasoning:
solution(standard answer),solution_steps(process, optional),difficulty(difficulty, optional). - Agent tool calls:
expected_tools(expected tool set),success_check(success criterion),max_steps(call efficiency reference). - Code generation:
entry_point(entry function),tests(unit test code),timeout_sec(execution timeout),language(sandbox selection).
- The data volume must be greater than
batch_size(default 64). Dozens to hundreds of samples can verify a solution; for formal training, math reasoning requires 500~2000 samples, Agent ≥1000 samples, code ≥1000 problems — the larger the data volume, the better the effect. - The training set and validation set are two independent jsonl files, uploaded separately via
TrainingDataset/ValidationDataset(validation set optional). - RL is uploaded via the SDK (
AgenticRL.run()), not the console packaging channel; billing is by MTU model training unit, not Token. For SDK fields and submission method, see Reinforcement learning training configuration.
Multi-modal Package Compression 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.
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 value displayed 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 samples |
Text generation - DPO format | 200 MB | 10 (default) | At least hundreds of samples |
Text generation - CPT format | 300 MB | 1 | At least 50 million Tokens |
Multimodal (zip) | 2 GB | 1 | Prepare sufficient samples based on actual scenarios |
Filename (without extension) | ≤120 characters and unique | — | — |
Extension | Must be in the Create dataset list | — | — |
API Upload Quota
The quota for uploading fine-tuning files via the DashScope API (with purpose tagged as model fine-tuning) is shown in the quota table below. When creating a dataset in the console, the File API list supports merging and registering up to 10 files; fine-tuning files uploaded via the API are visible and usable in both the console model fine-tuning page and API calls.
Constraints for loading datasets via cloud storage mount:
- Specify the data.jsonl root directory manifest path via MountStorage's file_path; zip archives are not supported.
- Before mounting, you must authorize the Bailian service to access OSS data.
- Single file exceeding 300 MB: upload via cloud storage mount 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).
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 |
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:
Issue: When uploading files, the frontend prompts that the file count exceeds the upper limit, and the files are rejected
Issue: When uploading files, the frontend prompts that the file count exceeds the upper limit, and the files are rejected
- Check the maxCount upper limit corresponding to the current training method; for details see File size and quantity limits.
- 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.
- If the file count still exceeds the limit, split into multiple datasets and upload in batches.
Issue: The filename (excluding extension) length exceeds 120 characters, and the frontend rejects the upload
Issue: The filename (excluding extension) length exceeds 120 characters, and the frontend rejects the upload
- Rename the file so that the filename (excluding extension) is shortened to within 120 characters.
- Use only a-z/A-Z/0-9/_/- characters; remove Chinese and other non-ASCII characters.
- Filenames inside a multi-modal archive must also be globally unique.
Issue: The filename (excluding extension comparison) is duplicated, and the frontend rejects the upload
Issue: The filename (excluding extension comparison) is duplicated, and the frontend rejects the upload
- Check for duplicate-named files and rename them so the part excluding extension is unique.
- 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.
- Filenames inside a multi-modal zip must be globally unique, even if distributed across different folders.
Issue: The single file size exceeds the upper limit of the corresponding training method, and the frontend rejects the upload
Issue: The single file size exceeds the upper limit of the corresponding training method, and the frontend rejects the upload
- Check whether the file size exceeds the upper limit of the corresponding training method.
- Split the jsonl into multiple files for batch upload (SFT/DPO); CPT data splitting requires creating multiple new datasets.
- For the overflow handling method when a single file exceeds 300 MB, see API upload quota.
Issue: The file extension is not in the supportedExtension list, and the frontend pops up a warning and rejects the upload
Issue: The file extension is not in the supportedExtension list, and the frontend pops up a warning and rejects the upload
- Check whether the file extension is within the supported list for the corresponding scenario.
- Convert the file to a supported extension and repackage for upload.
- Image and video extensions inside a multi-modal zip must each conform, otherwise the entire package import fails.
Issue: During OSS upload, the file is set to error status, and the upload is not completed
Issue: During OSS upload, the file is set to error status, and the upload is not completed
- Verify that the OSS Bucket has the Bailian data access authorization tag added.
- Confirm that the Bailian service has been authorized to access OSS data.
- 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.
- 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.