本新手指南介绍了生成式 AI 的核心技术,并说明了这些技术如何协同发挥作用,为聊天机器人和应用提供支持。生成式 AI(也称为 genAI)是机器学习 (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 具有可通过托管 API 访问的各种生成式 AI 基础模型,包括:
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"]],["最后更新时间 (UTC):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."]]