Gemini 3 提示指南

提示是使用任何 Gemini 模型的重要环节,您可以提示 Gemini 3 模型的新功能来帮助解决复杂问题并完成其他任务,例如解读大量文本、解决复杂的数学问题,甚至创建图片和视频。

本指南提供了各种提示策略,可帮助您在各种应用场景中充分利用 Vertex AI 上的 Gemini 3。

温度调优

对于 Gemini 3,我们强烈建议将温度参数保留为默认值 1.0

Gemini 3 的推理能力已针对默认温度设置进行了优化,不一定能通过调整温度来获益。更改温度(将其设置为低于 1.0)可能会导致意外行为、循环或性能下降,尤其是在复杂的数学或推理任务中。

提示策略

以下各部分介绍了可与 Gemini 3 模型搭配使用的各种提示策略。

缩短响应延迟时间

如需获得低延迟的回答,请尝试将思考水平设置为 LOW,并使用 think silently 等系统指令。

区分演绎推理和外部信息

在某些情况下,提供开放式系统指令(例如 do not inferdo not guess)可能会导致模型过度关注该指令,而无法执行基本逻辑或算术运算,也无法整合文档不同部分中的信息。

与其使用大范围的负面限制,不如明确告知模型使用提供的额外信息或上下文进行推理,避免使用外部知识。

示例

What was the profit? Do not infer.

此指令无效,因为 do not infer 指令过于宽泛。

You are expected to perform calculations and logical deductions based strictly
on the provided text. Do not introduce external information.

在此示例中,指令明确指出模型应使用提供的上下文进行计算和推理。

使用分步验证

当模型遇到它没有足够信息的主题(例如鲜为人知的地方)或被要求执行它不具备相应能力的操作(例如访问特定的实时网址)时,它可能会生成看似合理但实际上不正确的信息,以试图满足请求。

为避免这种情况,请将提示分为两步:首先,验证信息或预期功能是否存在;然后,根据该信息或功能生成答案。

示例

Verify with high confidence if you're able to access the New York Times home page.
If you cannot verify, state 'No Info' and STOP. If verified, proceed to generate
a response.

Query: Summarize the headlines from The New York Times today.

整理重要信息和限制

在处理足够复杂的请求时,如果负面限制(关于不应做什么的具体说明)或格式/定量限制(例如字数限制)在提示中出现得过早,模型可能会忽略这些限制。

为缓解此问题,请将核心请求和最关键的限制条件放在指令的最后一行。特别是,负面限制应放在指令的末尾。结构良好的提示可能如下所示:

  • [背景信息和源材料]
  • [主线任务说明]
  • [负面、格式和定量限制]

使用角色

该模型旨在认真对待分配给它的人设,有时会忽略指令,以保持与所描述人设的一致性。在提示中使用角色时,请查看分配给模型的角色,并避免出现模棱两可的情况。

示例

You are a data extractor. You are forbidden from clarifying, explaining, or
expanding terms. Output text exactly as it appears. Do not explain why.

保持接地

模型可能会使用自己的知识来回答您的提示,这可能会与提供的任何上下文发生冲突。虽然该模型旨在提供帮助,但如果您提供的假设情景与现实世界的事实相悖(例如,提示中包含 Crabs are fictional and have never existed. 等背景信息),模型可能会回退到其训练数据,而不是您的提示,以便将您的请求与其现有信息保持一致。

如果您需要在不基于现实世界信息的背景下工作,请明确声明所提供的背景是当前会话的唯一可信来源。

示例

You are a strictly grounded assistant limited to the information provided in the
User Context. In your answers, rely **only** on the facts that are directly
mentioned in that context. You must **not** access or utilize your own knowledge
or common sense to answer. Do not assume or infer from the provided facts;
simply report them exactly as they appear. Your answer must be factual and
fully truthful to the provided text, leaving absolutely no room for speculation
or interpretation. Treat the provided context as the absolute limit of truth;
any facts or details that are not directly mentioned in the context must be
considered **completely untruthful** and **completely unsupported**. If the
exact answer is not explicitly written in the context, you must state that the
information is not available.

综合多个信息来源

如果信息在上下文来源中的多个位置呈现,模型有时会在找到第一个相关匹配项后停止处理其他信息。

处理大型数据集(例如整本书籍、代码库或长视频)时,请将具体指令或问题放在提示末尾的数据上下文之后。您还可以通过在问题开头添加“根据以下数据Based on the entire document above...”之类的短语,将模型的推理锚定到提供的数据。

指令示例

Based on the entire document above, provide a comprehensive answer. Synthesize
all relevant information from the text that pertains to the question's scenario.

转向输出详细程度

默认情况下,Gemini 3 模型的回答简洁明了,旨在优先提供直接高效的答案。

如果您的应用场景需要更口语化的角色设定,您必须在提示中明确引导模型变得更健谈。

指令示例

Explain this as a friendly, talkative assistant.

后续步骤