Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
Model tuning is the process of adapting Gemini to perform specific downstream tasks with greater precision and accuracy. Model tuning works by providing a model with a training dataset that contains examples of specific downstream tasks.
This page provides an overview of model tuning for Gemini, covering the following topics:
Benefits of model tuning: Learn how tuning can improve model quality, robustness, and efficiency.
Tuning compared to prompt design: Understand the differences between customizing a model through tuning versus crafting effective prompts.
Tuning approaches: Explore the two main approaches to tuning: parameter-efficient tuning and full fine-tuning.
Model tuning is an effective way to customize large models for your tasks. It's a key step in improving a model's quality and efficiency. Model tuning provides the following benefits:
Higher quality: Improves model performance on your specific tasks.
Increased model robustness: Makes the model more resilient to variations in input.
Lower inference cost and latency: Reduces costs and response times by allowing for shorter prompts.
Tuning compared to prompt design
The following table compares prompt design and fine-tuning:
Method
Description
Best for
Prompt design
Crafting effective instructions to guide the model's output without changing the model itself.
Rapid prototyping, tasks with limited labeled data, or when you need a baseline performance quickly.
Fine-tuning
Retraining the base model on a custom labeled dataset to adapt its weights to a specific task.
Complex or unique tasks, achieving higher quality, and when you have a sizable dataset (100+ examples).
When deciding between prompt design and fine-tuning, consider the following recommendations:
Start with prompt design to find the optimal prompt. If needed, use fine-tuning to further boost performance or fix recurring errors.
Before adding more data, evaluate where the model makes mistakes.
Prioritize high-quality, well-labeled data over quantity.
Make sure that the data used for fine-tuning reflects the prompt distribution, format, and context the model will encounter in production.
Tuning provides the following benefits over prompt design:
Deeper customization: Provides deeper customization of the model, resulting in better performance on specific tasks.
Better alignment: Aligns the model with custom syntax, instructions, and domain-specific semantic rules.
More consistent results: Offers more consistent and reliable outputs.
Handles more examples: Processes more examples in a single prompt.
Reduced inference cost: Saves costs at inference by eliminating the need for few-shot examples and long instructions in prompts.
Tuning approaches
Parameter-efficient tuning and full fine-tuning are two approaches to customizing large models. Both methods have their advantages and implications for model quality and resource efficiency.
Tuning Approach
Description
Pros
Cons
Parameter-efficient tuning (Adapter tuning)
Updates only a small subset of the model's parameters.
Resource-efficient, cost-effective, faster training with smaller datasets, flexible for multi-task learning.
May not achieve the same peak quality as full tuning for highly complex tasks.
Full fine-tuning
Updates all of the model's parameters.
Potential for higher quality on highly complex tasks.
Requires significant computational resources, higher costs for tuning and serving.
Parameter-efficient tuning (PET), also called adapter tuning, updates a small subset of the model's parameters. This approach is more resource-efficient and cost-effective than full fine-tuning. It adapts the model faster with a smaller dataset and offers a flexible solution for multi-task learning without extensive retraining. To understand how Vertex AI supports adapter tuning and serving, see the whitepaper, Adaptation of Large Foundation Models.
Full fine-tuning updates all of the model's parameters. This method is suitable for adapting a model to highly complex tasks and can achieve higher quality. However, it requires significant computational resources for both tuning and serving, leading to higher overall costs.
Supported tuning methods
Vertex AI supports supervised fine-tuning to customize foundational models.
Supervised fine-tuning
Supervised fine-tuning improves the performance of a model by teaching it a new skill using a dataset with hundreds of labeled examples. Each labeled example demonstrates the desired output you want the model to produce during inference.
When you run a supervised fine-tuning job, the model learns additional parameters that encode the information necessary to perform the desired task or learn the desired behavior. These parameters are used during inference. The output of the tuning job is a new model that combines the newly learned parameters with the original model.
Supervised fine-tuning of a text model is a good option when the output of your model isn't complex and is relatively easy to define. Supervised fine-tuning is a good choice for tasks like classification, sentiment analysis, entity extraction, summarization of content that isn't complex, and writing domain-specific queries. For code models, supervised tuning is the only option.
Models that support supervised fine-tuning
The following Gemini models support supervised tuning:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[],[],null,["# Introduction to tuning\n\n*Model tuning* is a crucial process in adapting Gemini to perform specific tasks\nwith greater precision and accuracy. Model tuning works by providing a model\nwith a training dataset that contains a set of examples of specific downstream\ntasks.\n\nThis page provides an overview of model tuning for Gemini, describes\nthe tuning options available for Gemini, and helps you determine when\neach tuning option should be used.\n\nBenefits of model tuning\n------------------------\n\nModel tuning is an effective way to customize large models to your tasks. It's a\nkey step to improve the model's quality and efficiency. Model tuning provides the\nfollowing benefits:\n\n- Higher quality for your specific tasks\n- Increased model robustness\n- Lower inference latency and cost due to shorter prompts\n\nTuning compared to prompt design\n--------------------------------\n\n- **Prompting with pre-trained Gemini models** : Prompting is the art of crafting effective instructions to guide AI models like Gemini in generating the outputs you want. It involves designing prompts that clearly convey the task, format you want, and any relevant context. You can use Gemini's capabilities with minimal setup. It's best suited for:\n - Limited labeled data: If you have a small amount of labeled data or can't afford a lengthy fine-tuning process.\n - Rapid prototyping: When you need to quickly test a concept or get a baseline performance without heavy investment in fine-tuning.\n- **Customized fine-tuning of Gemini models** : For more tailored results, Gemini lets you fine-tune its models on your specific datasets. To create an AI model that excels in your specific domain, consider fine-tuning. This involves retraining the base model on your own labeled dataset, adapting its weights to your task and data. You can adapt Gemini to your use cases. Fine-tuning is most effective when:\n - You have labeled data: A sizable dataset to train on (think 100 examples or more), which allows the model to deeply learn your task's specifics.\n - Complex or unique tasks: For scenarios where advanced prompting strategies are not sufficient, and a model tailored to your data is essential.\n\nWe recommend starting with prompting to find the optimal prompt. Then, move on to\nfine-tuning (if required) to further boost performances or fix recurrent errors.\nWhile adding more examples might be beneficial, it is important to evaluate where\nthe model makes mistakes before adding more data. High-quality, well-labeled data\nis crucial for good performance and better than quantity. Also, the data you use\nfor fine-tuning should reflect the prompt distribution, format and context the\nmodel will encounter in production.\n\nTuning provides the following benefits over prompt design:\n\n- Allows deep customization on the model and results in better performance on specific tasks.\n- Align the model with custom syntax, instructions, domain specific semantic rules.\n- Offers more consistent and reliable results.\n- Capable of handling more examples at once.\n- Save cost at inference by removing few-shot examples, long instructions in the prompts\n\nTuning approaches\n-----------------\n\nParameter-efficient tuning and full fine-tuning are two approaches to\ncustomizing large models. Both methods have their advantages and implications in\nterms of model quality and resource efficiency.\n\n### Parameter efficient tuning\n\nParameter-efficient tuning, also called adapter tuning, enables efficient\nadaptation of large models to your specific tasks or domain. Parameter-efficient tuning\nupdates a relatively small subset of the model's parameters during the tuning\nprocess.\n\nTo understand how Vertex AI supports adapter tuning and serving, you\ncan find more details in the following whitepaper, [Adaptation of Large Foundation Models](https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf).\n\n### Full fine-tuning\n\nFull fine-tuning updates all parameters of the model, making it suitable for\nadapting the model to highly complex tasks, with the potential of achieving higher\nquality. However full fine tuning demands higher computational resources for both\ntuning and serving, leading to higher overall costs.\n\n### Parameter efficient tuning compared to full fine tuning\n\nParameter-efficient tuning is more resource efficient and cost effective compared\nto full fine-tuning. It uses significantly lower computational resources to train.\nIt's able to adapt the model faster with a smaller dataset. The flexibility of\nparameter-efficient tuning offers a solution for multi-task learning without the need\nfor extensive retraining.\n\nSupported tuning methods\n------------------------\n\nVertex AI supports supervised fine-tuning to customize foundational models.\n\n### Supervised fine-tuning\n\nSupervised fine-tuning improves the performance of the model by teaching it a new\nskill. Data that contains hundreds of labeled examples is used to teach the\nmodel to mimic a desired behavior or task. Each labeled example demonstrates\nwhat you want the model to output during inference.\n\nWhen you run a supervised fine-tuning job, the model learns additional parameters\nthat help it encode the necessary information to perform the desired task or\nlearn the desired behavior. These parameters are used during inference. The\noutput of the tuning job is a new model that combines the newly learned\nparameters with the original model.\n\nSupervised fine-tuning of a text model is a good option when the output of your model\nisn't complex and is relatively easy to define. Supervised fine-tuning is recommended\nfor classification, sentiment analysis, entity extraction, summarization of\ncontent that's not complex, and writing domain-specific queries. For code\nmodels, supervised tuning is the only option.\n\n#### Models that support supervised fine-tuning\n\nThe following Gemini models support supervised tuning:\n\n- [Gemini 2.5 Flash-Lite](/vertex-ai/generative-ai/docs/models/gemini/2-5-flash-lite)\n- [Gemini 2.5 Pro](/vertex-ai/generative-ai/docs/models/gemini/2-5-pro)\n- [Gemini 2.5 Flash](/vertex-ai/generative-ai/docs/models/gemini/2-5-flash)\n- [Gemini 2.0 Flash](/vertex-ai/generative-ai/docs/models/gemini/2-0-flash)\n- [Gemini 2.0 Flash-Lite](/vertex-ai/generative-ai/docs/models/gemini/2-0-flash-lite)\n\nFor more information on using supervised fine-tuning with each respective model,\nsee the following pages: Tune [text](/vertex-ai/generative-ai/docs/models/tune_gemini/text_tune), [image](/vertex-ai/generative-ai/docs/models/tune_gemini/image_tune), [audio](/vertex-ai/generative-ai/docs/models/tune_gemini/audio_tune), and [document](/vertex-ai/generative-ai/docs/models/tune_gemini/doc_tune) data types.\n\nLimitations\n-----------\n\nSupervised fine-tuning has the following limitations:\n\n- Tuning is not a Covered Service and is excluded from the SLO of any Service Level Agreement.\n\nWhat's next\n-----------\n\n- To learn more about the document understanding capability of Gemini models, see the [Document understanding](/vertex-ai/generative-ai/docs/multimodal/document-understanding) overview.\n- To start tuning, see [Tune Gemini models by using supervised fine-tuning](/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning)\n- To learn how supervised fine-tuning can be used in a solution that builds a generative AI knowledge base, see [Jump Start Solution: Generative AI\n knowledge base](/architecture/ai-ml/generative-ai-knowledge-base)."]]