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.
This page provides prerequisites and detailed instructions for fine-tuning
Gemini on document data using supervised learning.
Use cases
Fine-tuning lets you customize powerful language models for your specific needs.
Here are some key use cases where fine-tuning with your own set of PDFs can
significantly enhance a model's performance:
Internal knowledge base: Convert your internal documents into an AI-powered knowledge base that provides instant answers and insights. For example, a sales representative could instantly access product specifications and pricing details from past training materials.
Research assistant: Create a research assistant capable of analyzing a collection of research papers, articles, and books. A researcher studying climate change could quickly analyze scientific papers to identify trends in sea level rise or assess the effectiveness of different mitigation strategies.
Legal or regulatory compliance: Fine-tuning on legal documents can help automate contract review, flagging potential inconsistencies or areas of risk. This allows legal professionals to focus on higher-level tasks while ensuring compliance.
Automated report generation: Automate the analysis of complex financial reports, extracting key performance indicators and generating summaries for stakeholders. This can save time and reduce the risk of errors compared to manual analysis.
Content summarization and analysis: Summarize lengthy PDF documents, extract key insights, and analyze trends. For example, a market research team could analyze a collection of customer surveys to identify key themes and sentiment.
Document comparison and version control: Compare different versions of a document to identify changes and track revisions. This can be particularly useful in collaborative environments where multiple authors contribute to a document.
The following is an example of a document dataset.
{"contents":[{"role":"user","parts":[{"fileData":{"mimeType":"application/pdf","fileUri":"gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf"}},{"text":"You are a very professional document summarization specialist. Please summarize the given document."}]},{"role":"model","parts":[{"text":"The report introduces Gemini 2.0 Flash, a multimodal AI model developed by Google DeepMind. The report positions Gemini 2.0 Flash as a significant advancement in multimodal AI, pushing the boundaries of long-context understanding and opening new avenues for future research and applications."}]}]}
What's next
To learn more about the document understanding capability of Gemini models, see the Document understanding overview.
[[["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-09-04 UTC."],[],[],null,["# Document tuning\n\nThis page provides prerequisites and detailed instructions for fine-tuning\nGemini on document data using supervised learning.\n\nUse cases\n---------\n\nFine-tuning lets you customize powerful language models for your specific needs.\nHere are some key use cases where fine-tuning with your own set of PDFs can\nsignificantly enhance a model's performance:\n\n- **Internal knowledge base**: Convert your internal documents into an AI-powered knowledge base that provides instant answers and insights. For example, a sales representative could instantly access product specifications and pricing details from past training materials.\n- **Research assistant**: Create a research assistant capable of analyzing a collection of research papers, articles, and books. A researcher studying climate change could quickly analyze scientific papers to identify trends in sea level rise or assess the effectiveness of different mitigation strategies.\n- **Legal or regulatory compliance**: Fine-tuning on legal documents can help automate contract review, flagging potential inconsistencies or areas of risk. This allows legal professionals to focus on higher-level tasks while ensuring compliance.\n- **Automated report generation**: Automate the analysis of complex financial reports, extracting key performance indicators and generating summaries for stakeholders. This can save time and reduce the risk of errors compared to manual analysis.\n- **Content summarization and analysis**: Summarize lengthy PDF documents, extract key insights, and analyze trends. For example, a market research team could analyze a collection of customer surveys to identify key themes and sentiment.\n- **Document comparison and version control**: Compare different versions of a document to identify changes and track revisions. This can be particularly useful in collaborative environments where multiple authors contribute to a document.\n\nLimitations\n-----------\n\n### Gemini 2.5 models\n\n### Gemini 2.0 Flash\nGemini 2.0 Flash-Lite\n\nTo learn more about document understanding requirements, see [Document understanding](/vertex-ai/generative-ai/docs/multimodal/document-understanding#document-requirements).\n\nDataset format\n--------------\n\nThe `fileUri` for your dataset can be the URI for a file in a Cloud Storage\nbucket, or it can be a publicly available HTTP or HTTPS URL.\n\nTo see the generic format example, see\n[Dataset example for Gemini](/vertex-ai/generative-ai/docs/models/gemini-supervised-tuning-prepare#dataset-example).\n\nThe following is an example of a document dataset. \n\n {\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"fileData\": {\n \"mimeType\": \"application/pdf\",\n \"fileUri\": \"gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf\"\n }\n },\n {\n \"text\": \"You are a very professional document summarization specialist. Please summarize the given document.\"\n }\n ]\n },\n {\n \"role\": \"model\",\n \"parts\": [\n {\n \"text\": \"The report introduces Gemini 2.0 Flash, a multimodal AI model developed by Google DeepMind. The report positions Gemini 2.0 Flash as a significant advancement in multimodal AI, pushing the boundaries of long-context understanding and opening new avenues for future research and applications.\"\n }\n ]\n }\n ]\n }\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)."]]