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.

整理重要資訊和限制

處理足夠複雜的要求時,如果提示中太早出現負面限制 (有關禁止事項的具體指示) 或格式/量化限制 (例如字數限制),模型可能會忽略這些限制。

為減輕這種情況,請將核心要求和最重要的限制條件放在指令的最後一行。特別是負面限制,應放在指令結尾。結構良好的提示可能如下所示:

  • [背景資訊和來源資料]
  • [Main task instructions]
  • [Negative, formatting, and quantitative constraints]

使用職務角色

模型會認真對待所指派的角色,有時會忽略指令,以維持與所描述角色的一致性。在提示中使用角色時,請檢查模型指派的角色,並避免模稜兩可的情況。

範例

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.

後續步驟