本初學者指南將介紹生成式 AI 的核心技術,並說明如何將這些技術結合,為聊天機器人和應用程式提供動力。生成式 AI (也稱為 genAI 或 gen AI) 是機器學習 (ML) 領域的一環,專門開發及使用 ML 模型來產生新內容。
生成式 AI 模型通常稱為大型語言模型 (LLM),因為它們體積龐大,且能理解及產生自然語言。不過,這些模型可根據訓練資料,理解及產生文字、圖片、影片和音訊等多種形式的內容。可處理多種資料類型的模型稱為多模態模型。
Google 提供 Gemini 系列生成式 AI 模型,專為多模態用途而設計,可處理圖片、影片和文字等多種形式的資訊。
生成內容
為了讓生成式 AI 模型產生在實際應用中實用的內容,這些模型必須具備下列功能:
瞭解如何執行新工作:
生成式 AI 模型專門用於執行一般工作,如果您希望模型執行專屬於您用途的工作,就必須能夠自訂模型。在 Vertex AI 中,您可以透過模型調整自訂模型。
存取外部資訊:
生成式 AI 模型的訓練資料,取自大量的資料。不過,這些模型必須能夠存取訓練資料以外的資訊,才能發揮實用性。舉例來說,如果您想建立由生成式 AI 模型提供支援的客戶服務聊天機器人,該模型就必須能存取您提供的產品和服務相關資訊。在 Vertex AI 中,您可以使用建立基準和函式呼叫功能,協助模型存取外部資訊。
封鎖有害內容:
生成式 AI 模型可能會產生您意料之外的輸出內容,包括令人反感或不顧及感受的文字。為了維持安全並防止濫用,模型需要安全篩選器來封鎖判定為可能有害的提示和回覆。Vertex AI 內建安全功能,可促進生成式 AI 服務的負責任使用。
下圖顯示這些不同功能如何協同運作,產生您想要的內容:
提示
生成式 AI 工作流程通常會從提示開始。提示是傳送給生成式 AI 模型的自然語言要求,用來引導模型提供回覆。視模型而定,提示可以包含文字、圖片、影片、音訊、文件和其他類型,甚至是多種類型 (多模態)。
建立提示以便從模型取得所需回應的做法稱為提示設計。雖然提示設計是一種嘗試錯誤的過程,但您可以運用提示設計原則和策略,引導模型做出理想的行為。
Vertex AI Studio 提供提示管理工具,可協助您管理提示。
基礎模型
提示會傳送至生成式 AI 模型,以產生回覆。Vertex AI 提供多種生成式 AI 基礎模型,可透過受管理的 API 存取,包括:
Gemini API:進階推理、多輪即時通訊、程式碼產生,以及多模態提示。
Imagen API:圖像生成、圖像編輯和圖像說明生成。
MedLM:回答醫療問題和產生摘要。(已淘汰)
這些模型在大小、模式和成本方面有所不同。您可以在 Model Garden 中探索 Google 模型、開放式模型和 Google 合作夥伴的模型。
自訂模型
您可以自訂 Google 基礎模型的預設行為,確保模型能持續生成符合預期的結果,而不必輸入複雜的提示。這個自訂程序稱為「模型微調」。調整模型有助於簡化提示,減少要求的成本和延遲時間。
Vertex AI 也提供模型評估工具,協助您評估經過調整的模型效能。經過調整的模型可供正式使用後,您可以將模型部署至端點,並監控成效,就像使用標準 MLOps 工作流程一樣。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Generative AI beginner's guide\n\nThis beginner's guide introduces you to the core technologies of generative AI\nand explains how they fit together to power chatbots and applications.\nGenerative AI (also known as *genAI* or *gen AI*) is a field of machine learning\n(ML) that develops and uses ML models for generating new content.\n\nGenerative AI models are often called large language models (LLMs) because of\ntheir large size and ability to understand and generate natural language.\nHowever, depending on the data that the models are trained on, these models can\nunderstand and generate content from multiple modalities, including text,\nimages, videos, and audio. Models that work with multiple modalities of data are\ncalled *multimodal* models. \n\nGoogle provides the [Gemini](/vertex-ai/generative-ai/docs/multimodal/overview)\nfamily of generative AI models designed for *multimodal* use cases; capable of\nprocessing information from multiple modalities, including images, videos,\nand text.\n\nContent generation\n------------------\n\nIn order for generative AI models to generate content that's useful in\nreal-world applications, they need to have the following capabilities:\n\n- **Learn how to perform new tasks:**\n\n Generative AI models are designed to perform general tasks. If you want a\n model to perform tasks that are unique to your use case, then you need to be\n able to customize the model. On\n Vertex AI, you can customize your model through model tuning.\n- **Access external information:**\n\n Generative AI models are trained on vast amounts of data. However, in order\n for these models to be useful, they need to be able to access information\n outside of their training data. For example, if you want to create a\n customer service chatbot that's powered by a generative AI model, the model\n needs to have access to information about the products and services that you\n offer. In Vertex AI, you use the grounding and function calling\n features to help the model access external information.\n- **Block harmful content:**\n\n Generative AI models might generate output that you don't expect, including\n text that's offensive or insensitive. To maintain safety and prevent misuse,\n the models need safety filters to block prompts and responses that are\n determined to be potentially harmful. Vertex AI has built-in safety\n features that promote the responsible use of our generative AI services.\n\nThe following diagram shows how these different capabilities work together to\ngenerate content that you want:\n\n#### Prompt\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Foundation models\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Model customization\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Access external information\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Citation check\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Responsible AI and safety\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### Response\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nGet started\n-----------\n\nTry one of these quickstarts to get started with generative AI on\nVertex AI. \n - :gemini: \n [Generate text using the Vertex AI Gemini API](/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal)\n\n\n Use the SDK to send requests to the Vertex AI Gemini API.\n - \n [Send prompts to Gemini using the Vertex AI Studio Prompt Gallery](/vertex-ai/generative-ai/docs/start/quickstarts/quickstart)\n\n\n Test prompts with no setup required.\n - \n [Generate an image and verify its watermark using Imagen](/vertex-ai/generative-ai/docs/image/quickstart-image-generate-console)\n\n\n Create a watermarked image using Imagen on Vertex AI."]]