自定义序言简介

本页将介绍自定义序言以及如何编写序言以提升 生成答案的质量。

在开始之前,序言设定了 LLM 的初始背景信息和预期 它会处理您的输入文档。序言会影响 所生成摘要的质量。每当您调用 answer 方法时,系统都会提供默认的序言。不过,您可以选择 而不是使用默认的序言

有关如何在应答方法调用中指定前导的说明,请参见 指定自定义序言

例如,您可以使用序言执行以下操作:

  • 指定模型可以和不可以使用的字词。

  • 指定要关注或避免的主题。

  • 指定回答的风格、语气和格式。

量身定制序言可以显著提高摘要的质量。

前言应包含两个部分:

  • 任务说明,用于描述您要让 LLM 执行的任务。请参阅任务说明示例

  • LLM 应遵循的其他说明。如需更多说明,请参阅示例和提示

任务描述示例

以下是一些任务描述示例。场景如下:您的员工希望从包含许多公司文档的数据存储区中获取答案。

示例 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

用于总结客户与 Google 助理之间的对话的任务说明:

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.

最佳做法

以下是编写和优化序言的一些最佳实践:

  • 迭代优化:对不同的前言进行实验 并观察这对答案质量的影响。

  • 用户反馈:从用户那里收集反馈,以找出反复出现的问题和有待改进的方面。

  • 及时了解最新动态:前奏调优的效果可能会因模型版本和文档性质而异。持续 实验并优化您的方法以获得最佳效果。

  • 全面评估:在所有预期用途中验证修改后的前导 案例有助于发现和减少潜在的偏见或意外行为 在某些情况下可能会对摘要质量产生负面影响。