本頁說明自訂前置文字,以及如何撰寫前置文字來提升產生的答案品質。
在 LLM 處理輸入文件之前,前言會設定 LLM 的初始背景資訊和預期。前言會影響產生摘要的品質。每次呼叫 answer 方法時,系統都會提供預設前置字串。不過,您可以選擇指定自己的前置文字,而非使用預設值。
如要瞭解如何在答案方法呼叫中指定前置文字,請參閱「指定自訂前置文字」一文。
舉例來說,您可以使用前置文字執行以下操作:
指定模型可使用和不可使用的字詞。
指定要特別關注或避免的主題。
指定回覆的樣式、語氣和格式。
調整前言可大幅改善摘要的品質。
前言應包含兩個部分:
工作說明範例
以下列舉一些任務說明範例。情境:您的員工想從包含許多公司文件的資料儲存庫中取得答案。
範例 1
工作說明:全面引用來源:
Given a user query and a list of sources, write a response that cites individual
sources as comprehensively as possible.
範例 2
瞭解使用者並著重於提供實用資訊的工作說明:
You are an enterprise LLM summarization tool. Your task is to understand the
true intent of a user question in the context of enterprise search and
summarization, and provide a helpful answer to the user's question.
範例 3
工作說明:摘要說明客戶與助理之間的對話內容:
Given the conversation between a customer and a helpful assistant with some
search results, create a final answer for the assistant.
其他操作說明的範例和提示
額外說明應包含您的特定重要需求。
下表列出您可能在工作說明後提供的其他操作說明範例、每個範例解決的問題類型,以及前言解決問題的原因。
要解決的問題 | 解決方案 | 範例 |
---|---|---|
答案必須更貼近業務需求 | 提供其他背景資訊和操作說明,確保摘要內容可針對特定用途和目標對象進行調整。 |
範例 1
Utilize the specific context of the workspace (e.g. meeting notes, public
guidance, FAQ) to provide more accurate and relevant summaries.
範例 2
Summarize customer feedback, focusing on their pain points, feature
request and overall satisfaction. Highlight any actionable insights that
can help improve our product or service.
範例 3
For input documents of troubleshooting website, please summary the
problem statement, step-by-step solutions and any relevant tips or
warnings.
範例 4
"XYZ" is an internal forum for engineers to discuss technical problems,
you can use it to summarize technical issues, proposed solutions and any
unresolved challenges or next steps identified in the discussion.
|
答案必須採用特定格式 | 明確指定風格或語調和目標對象。 |
範例 1
Summarize troubleshooting guide for customer support agent in a clear and
concise manner. The summary should be easy for a non-technical user to
understand.
範例 2
Summarize the technical documents for engineers. Focus on the core
functionality, system architecture, and potential challenges.
|
答案必須符合特定格式 | 指定輸出格式 |
範例 1
Use bullet points for steps, numbered lists for rankings, tables for
comparisons, code block for coding example
範例 2
Summarize the key takeaways in a numbered lists
|
答案必須簡短 | 明確指示 LLM 產生「精簡」或「簡短」摘要。 您也可以視需要指定字詞或句子數量。 |
範例 1
Please keep summaries concise and focused, providing only the most
essential information to address the user's query.
範例 2
The answer should be less than 200 words.
|
答案需要更全面 | 鼓勵 LLM 加入重要細節和重點。 |
範例
Please ensure key details are included.
|
包含禁止的主題 | 定義模型在特定情況下的回應方式。 |
範例
For political questions, the most helpful way is to politely refuse to
answer the question.
|
減少幻覺 (錯誤資訊) | 強調準確度的重要性,並指示 LLM 嚴格遵循文字中提供的資訊。 |
範例 1
Keep the summary accurate, ensuring all claims are verifiable within the given context.
範例 2
Use exact words from the context if possible.
|
完整前置文字範例
以下是完整前置文字的更多範例,其中包含工作說明和其他說明。
範例 1
請提供簡潔、準確且相關的摘要,並以方便使用者閱讀的格式呈現。
You are an enterprise LLM summarization tool. Your task is to understand the
true intent of a user question in the context of enterprise search and
summarization, and provide a helpful answer to the user's question. Please keep
summaries concise and focused, providing only the most essential information to
address the user's query.
Please also structure and format the summary by
1) prioritize most relevant and accurate information to user's question
2) highlight critical information
3) structure the response and adapt the formatting to be user friendly (e.g.,
use bullet points for steps, numbered lists for rankings, tables for
comparisons, code block for coding example, etc).
範例 2
根據對話內容,為客戶查詢提供簡潔、友善且實用的最終答案。
Given the conversation between a customer and a helpful assistant with some
search results, create a final answer for the assistant.
The answer should addresses the query accurately and concisely (less than 10
sentences), while also being friendly and helpful. If the search results don't
provide enough information to fully answer the question, suggest additional
resources or steps the customer can take.
範例 3
提供完整且易於理解的答案,並引用指定的來源。禮貌拒絕回答任何政治性問題。
Given a user query and a list of sources, write a response that cites individual
sources as comprehensively as possible.
The response should be suitable for a non-expert audience.
For political questions, the response should be a polite refusal to answer the
question.
最佳做法
以下是撰寫及調整前置碼的最佳做法:
迭代式精進:嘗試使用不同的前置詞變化版本,並觀察對答案品質的影響。
使用者意見:收集使用者意見,找出常見問題和需要改善的部分。
保持最新狀態:前置文字調整的效果可能因模型版本和文件性質而異。持續實驗並調整做法,以求取得最佳成效。
徹底評估:在所有預期用途中驗證修改過的前置文字,有助於找出並減輕可能在特定情況下對摘要品質造成負面影響的潛在偏差或意外行為。