Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Dokument wird beschrieben, wie Sie den Vertex AI Prompt Optimizer verwenden, um die Leistung von Prompts automatisch zu optimieren, indem Sie die Systemanweisungen für eine Reihe von Prompts verbessern.
Mit dem Vertex AI-Prompt-Optimierer können Sie Ihre Prompts schnell und in großem Umfang verbessern, ohne Systemanweisungen oder einzelne Prompts manuell neu zu schreiben. Das ist besonders nützlich, wenn Sie Systemanweisungen und Prompts, die für ein Modell geschrieben wurden, mit einem anderen Modell verwenden möchten.
Wir bieten zwei Ansätze zur Optimierung von Prompts:
Der Zero-Shot-Optimierer ist ein Echtzeit-Optimierer mit niedriger Latenz, der einen einzelnen Prompt oder eine Systemanweisungsvorlage verbessert. Es ist schnell und erfordert keine zusätzliche Einrichtung außer der Angabe Ihres ursprünglichen Prompts oder Ihrer Systemanweisung.
Der datengesteuerte Optimierer ist ein iterativer Optimierer auf Batch-Aufgabenebene, der Prompts verbessert, indem er die Reaktion des Modells auf Stichproben von gelabelten Prompts anhand der angegebenen Bewertungs-Messwerte für das ausgewählte Zielmodell bewertet. Diese Funktion ist für die erweiterte Optimierung gedacht. Sie können die Optimierungsparameter konfigurieren und einige Beispiele mit Labels bereitstellen.
Diese Methoden sind für Nutzer über die Benutzeroberfläche oder das Vertex AI SDK verfügbar.
Unterstützte Zielmodelle für die Optimierung
Der Zero-Shot-Optimizer ist modellunabhängig und kann Prompts für jedes Google-Modell verbessern.
Der datengetriebene Optimierer unterstützt die Optimierung nur für allgemein verfügbare Gemini-Modelle.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Optimize prompts\n\nThis 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/vertex_ai_prompt_optimizer_sdk.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_sdk.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_sdk.ipynb) \\| [View on GitHub](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/vertex_ai_prompt_optimizer_sdk.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/vertex_ai_prompt_optimizer_sdk_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%2Fvertex_ai_prompt_optimizer_sdk_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%2Fvertex_ai_prompt_optimizer_sdk_custom_metric.ipynb) \\| [View on GitHub](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/vertex_ai_prompt_optimizer_sdk_custom_metric.ipynb)\n| **Important:** While Prompt Optimizer is [generally available](/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----------------------------------------\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\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)"]]