本页讨论了自定义序言,以及如何编写序言来提高生成的答案的质量。
前导文本会在 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.
最佳做法
以下是有关撰写和调整前导的一些最佳实践:
迭代优化:尝试不同的序言变体,并观察对回答质量的影响。
用户反馈:收集用户反馈,找出反复出现的问题和需要改进的方面。
及时了解最新动态:前导调优的有效性可能会因模型版本和文档性质而异。不断进行实验并完善方法,以取得理想成效。
全面评估:验证所有预期使用情形下的修改后序言有助于发现并缓解潜在的偏差或意外行为,这些偏差或意外行为可能会在某些情况下对摘要质量产生负面影响。