A partire dal 29 aprile 2025, i modelli Gemini 1.5 Pro e Gemini 1.5 Flash non sono disponibili nei progetti che non li hanno mai utilizzati, inclusi i nuovi progetti. Per maggiori dettagli, vedi Versioni e ciclo di vita dei modelli.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento descrive come utilizzare lo strumento di ottimizzazione dei prompt di Vertex AI per
ottimizzare automaticamente il rendimento dei prompt migliorando le istruzioni
di sistema per un insieme di
prompt.
Vertex AI Prompt Optimizer può aiutarti a migliorare i tuoi prompt
in modo rapido e su larga scala, senza riscrivere manualmente le istruzioni di sistema o i singoli
prompt. Ciò è particolarmente utile quando vuoi utilizzare istruzioni e
prompt di sistema scritti per un modello con un modello diverso.
Offriamo due approcci per ottimizzare i prompt:
L'ottimizzatore
zero-shot
è un ottimizzatore in tempo reale a bassa latenza che migliora un singolo prompt o un modello di istruzioni di sistema. È veloce e non richiede configurazioni aggiuntive, oltre a
fornire il prompt originale o le istruzioni di sistema.
L'ottimizzatore
basato sui dati
è un ottimizzatore iterativo a livello di attività batch che migliora i prompt
valutando la risposta del modello a prompt etichettati di esempio rispetto a metriche di
valutazione specificate per il modello di destinazione selezionato. È per l'ottimizzazione
più avanzata che ti consente di configurare i parametri di ottimizzazione e fornire
alcuni campioni etichettati.
Questi metodi sono disponibili per gli utenti tramite l'interfaccia utente o l'SDK Vertex AI.
Modelli target supportati per l'ottimizzazione
L'ottimizzatore zero-shot è indipendente dal modello e può migliorare i prompt per qualsiasi
modello Google.
L'ottimizzatore basato sui dati supporta l'ottimizzazione solo per i modelli Gemini disponibili a livello generale.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[],[],null,["This document describes how to use the Vertex AI prompt optimizer to\nautomatically optimize prompt performance by improving the [system\ninstructions](/vertex-ai/generative-ai/docs/learn/prompts/system-instructions) for a set of\nprompts.\n\nThe Vertex AI prompt optimizer can help you improve your prompts\nquickly at scale, without manually rewriting system instructions or individual\nprompts. This is especially useful when you want to use system instructions and\nprompts that were written for one model with a different model.\n\nWe offer two approaches for optimizing prompts:\n\n- The [**zero-shot\n optimizer**](/vertex-ai/generative-ai/docs/learn/prompts/zero-shot-optimizer) is a real-time low-latency optimizer that improves a single prompt or system instruction template. It is fast and requires no additional setup besides providing your original prompt or system instruction.\n- The [**data-driven\n optimizer**](/vertex-ai/generative-ai/docs/learn/prompts/data-driven-optimizer) is a batch task-level iterative optimizer that improves prompts by evaluating the model's response to sample labeled prompts against specified evaluation metrics for your selected target model. It's for more advanced optimization that lets you configure the optimization parameters and provide a few labeled samples.\n\nThese methods are available to users through the user interface (UI) or the\nVertex AI SDK.\n| To see an example of optimizing prompts, run one of the following Jupyter notebooks:\n|\n| - Vertex AI prompt optimizer: [Open in Colab](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/vertex_ai_prompt_optimizer_ui.ipynb) \\| [Open in Colab Enterprise](https://console.cloud.google.com/vertex-ai/colab/import/https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fgemini%2Fprompts%2Fprompt_optimizer%2Fvertex_ai_prompt_optimizer_ui.ipynb) \\| [Open in Vertex AI Workbench user-managed notebooks](https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fgemini%2Fprompts%2Fprompt_optimizer%2Fvertex_ai_prompt_optimizer_ui.ipynb) \\| [View on GitHub](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/vertex_ai_prompt_optimizer_ui.ipynb)\n| - Vertex AI prompt optimizer SDK: [Open in Colab](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/get_started_with_vertex_ai_prompt_optimizer.ipynb) \\| [Open in Colab Enterprise](https://console.cloud.google.com/vertex-ai/colab/import/https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fgemini%2Fprompts%2Fprompt_optimizer%2Fget_started_with_vertex_ai_prompt_optimizer.ipynb) \\| [Open in Vertex AI Workbench user-managed notebooks](https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fgemini%2Fprompts%2Fprompt_optimizer%2Fget_started_with_vertex_ai_prompt_optimizer.ipynb) \\| [View on GitHub](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/get_started_with_vertex_ai_prompt_optimizer.ipynb)\n| - Vertex AI prompt optimizer custom metrics: [Open in Colab](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/get_started_with_vertex_ai_prompt_optimizer_custom_metric.ipynb) \\| [Open in Colab Enterprise](https://console.cloud.google.com/vertex-ai/colab/import/https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fgemini%2Fprompts%2Fprompt_optimizer%2Fget_started_with_vertex_ai_prompt_optimizer_custom_metric.ipynb) \\| [Open in Vertex AI Workbench user-managed notebooks](https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fgemini%2Fprompts%2Fprompt_optimizer%2Fget_started_with_vertex_ai_prompt_optimizer_custom_metric.ipynb) \\| [View on GitHub](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/get_started_with_vertex_ai_prompt_optimizer_custom_metric.ipynb)\n| **Important:** While Prompt Optimizer is [generally available](https://cloud.google.com/products#product-launch-stages), its SDK library is still experimental. This means that the SDK is subject to change at any time without notice. We are continuously working to improve and stabilize the SDK. You may encounter bugs or changes to APIs and functionality.\n\nSupported target models for optimization\n\nThe zero-shot optimizer is model independent and can improve prompts for any\nGoogle model.\n\nThe data-driven optimizer supports optimization for only generally available\nGemini models.\n\nWhat's next\n\n- Learn about [zero-shot optimizer](/vertex-ai/generative-ai/docs/learn/prompts/zero-shot-optimizer)\n\n- Learn about [data-driven optimizer](/vertex-ai/generative-ai/docs/learn/prompts/data-driven-optimizer)"]]