[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Prepare supervised fine-tuning data for Translation LLM models\n\nThis document describes how to define a supervised fine-tuning dataset for a Translation LLM\nmodel. You can tune text data types.\n\nAbout supervised fine-tuning datasets\n-------------------------------------\n\nA supervised fine-tuning dataset is used to fine-tune a pre-trained model to a\nspecific domain. The input data should be similar to what\nyou expect the model to encounter in real-world use. The output labels should\nrepresent the correct answers or outcomes for each input.\n\n**Training dataset**\n\nTo tune a model, you provide a *training dataset*. For best results, we recommend\nthat you start with 100 examples. You can scale up to thousands of examples if\nneeded. The quality of the dataset is far more important than the quantity.\n\nLimitations:\n\n- Max input and out token per examples: 1,000\n- Max file size of training dataset: Up to 1GB for JSONL.\n\n**Validation dataset**\n\nWe strongly recommend that you provide a validation dataset. A validation dataset\nhelps you measure the effectiveness of a tuning job.\n\nLimitations:\n\n- Max input and out token per examples: 1,000\n- Max numbers of examples in validation dataset: 1024\n- Max file size of training dataset: Up to 1GB for JSONL.\n\n### Dataset format\n\nYour model tuning dataset must be in the [JSON Lines](https://jsonlines.org/) (JSONL) format, where each line contains a single tuning example.\nBefore tuning your model, you must\n[upload your dataset to a Cloud Storage bucket](#upload-datasets). Make sure to upload to us-central1. \n\n {\n \"contents\": [\n {\n \"role\": string,\n \"parts\": [\n {\n \"text\": string,\n }\n ]\n }\n ]\n }\n\n### Parameters\n\nThe example contains data with the following parameters:\n\nDataset example for `translation-llm-002`\n-----------------------------------------\n\n {\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"English: Hello. Spanish:\",\n }\n ]\n }\n {\n \"role\": \"model\"\",\n \"parts\": [\n {\n \"text\": \"Hola.\",\n }\n ]\n }\n ]\n }\n\n### Contents\n\nThe base structured data type containing multi-part content of a message.\n\nThis class consists of two main properties: `role` and `parts`. The `role` property\ndenotes the individual producing the content, while the `parts` property contains\nmultiple elements, each representing a segment of data within a message.\n\n### Parts\n\nA data type containing media that is part of a multi-part `Content` message.\n\n### Upload tuning datasets to Cloud Storage\n\nTo run a tuning job, you need to upload one or more datasets to a\nCloud Storage bucket. You can either\n[create a new Cloud Storage bucket](/storage/docs/creating-buckets#create_a_new_bucket)\nor use an existing one to store dataset files. The region of the bucket doesn't\nmatter, but we recommend that you use a bucket that's in the same\nGoogle Cloud project where you plan to tune your model.\n\nAfter your bucket is ready,\n[upload](/storage/docs/uploading-objects#uploading-an-object) your dataset file\nto the bucket.\n\nNotebook examples for preparing data\n------------------------------------\n\nHere are some Colab notebook examples to help you get started.\n\n### AutoML Translation Dataset\n\nIf you already have Translation Datasets uploaded to AutoML Translation,\nyou can follow the Colab example to export them for tuning.\n\n### Local Dataset\n\nIf you have your data in a TSV, CSV, or TMX format locally, you can upload them to\nColab for tuning.\n\nWhat's next\n-----------\n\n- Run a [supervised fine-tuning job](/vertex-ai/generative-ai/docs/models/translation-use-supervised-tuning)."]]