|
|
Gemini Model Fine-tuning with Vertex AI
Author: Venkata Sudhakar
Fine-tuning adapts a Gemini model to your specific domain by training it on examples of input-output pairs. After fine-tuning, the model responds in your preferred style, uses your vocabulary, and handles domain-specific queries more accurately. ShopMax India fine-tuned Gemini to improve product category classification accuracy from 78% to 96%. Vertex AI supervised tuning requires a JSONL training dataset with input-output pairs, a minimum of 100 examples (1,000 recommended), and a tuning job configuration. The tuned model is deployed as a new model endpoint you call exactly like the base model. The below example shows how ShopMax India prepares training data and runs a fine-tuning job for product classification.
Uploading to GCS and launching the fine-tuning job,
It gives the following output,
Training file created: 3 examples
Tuning job started: projects/shopmax-india/locations/us-central1/tuningJobs/123
Tuned model endpoint: projects/shopmax-india/locations/us-central1/endpoints/456
Category: Audio > Earphones > True Wireless (TWS)
Monitor tuning job progress in the Vertex AI console under Model Garden > Fine-tuning. Evaluate the tuned model on a held-out test set before deploying to production. For ShopMax India, the target metric is classification accuracy above 95% on the product test set of 500 manually labelled items.
|
|