Provide reference text
提供参考文本
GPTs can confidently invent fake answers, especially when asked about esoteric topics or for citations and URLs. In the same way that a sheet of notes can help a student do better on a test, providing reference text to GPTs can help in answering with fewer fabrications.
GPT 可以自信地编造虚假答案,特别是在询问深奥主题、引用和网址时。就像一页笔记可以帮助学生在考试中取得更好的成绩一样,向 GPT 提供参考文本可以帮助它以较少的虚构答案来回答问题。
Tactic: Instruct the model to answer using a reference text
技巧:指示模型使用参考文本回答问题
If we can provide a model with trusted information that is relevant to the current query, then we can instruct the model to use the provided information to compose its answer.
如果我们能够为模型提供与当前查询相关的可信信息,那么我们可以指示模型使用提供的信息来组成答案。
SYSTEM 系统 | Use the provided articles delimited by triple quotes to answer questions. If the answer cannot be found in the articles, write "I could not find an answer." 使用由三个引号分隔的提供的文章来回答问题。如果答案在文章中找不到,则写下"我找不到答案"。 |
USER 用户 | <insert articles, each delimited by triple quotes> <插入由三个引号分隔的文章> Question: <insert question here> 问题:<插入问题> |
Given that GPTs have limited context windows, in order to apply this tactic we need some way to dynamically lookup information that is relevant to the question being asked. Embeddings can be used to implement efficient knowledge retrieval. See the tactic "Use embeddings-based search to implement efficient knowledge retrieval" for more details on how to implement this.
由于 GPT 有限的上下文窗口,为了应用这个技巧,我们需要一种动态查找与所提出问题相关的信息的方式。嵌入可以用于实现高效的知识检索。有关如何实施此战术的更多详细信息,请参见“使用嵌入式搜索实现高效的知识检索”。
Tactic: Instruct the model to answer with citations from a reference text
技巧:指示模型通过引用参考文本来回答问题
If the input has been supplemented with relevant knowledge, it's straightforward to request that the model add citations to its answers by referencing passages from provided documents. Note that citations in the output can then be verified programmatically by string matching within the provided documents.
如果输入已经补充了相关的知识,那么可以简单地要求模型通过引用所提供文档中的段落来添加答案的引用。请注意,可以通过在所提供的文档中进行字符串匹配来自动验证输出中的引用。
SYSTEM 系统 | You will be provided with a document delimited by triple quotes and a question. Your task is to answer the question using only the provided document and to cite the passage(s) of the document used to answer the question. If the document does not contain the information needed to answer this question then simply write: "Insufficient information." If an answer to the question is provided, it must be annotated with a citation. Use the following format for to cite relevant passages ({"citation": …}). 您将获得一个由三个引号分隔的文档和一个问题。您的任务是仅使用提供的文档回答问题,并引用用于回答问题的文档的段落。如果文档中没有包含回答这个问题所需的信息,则简单地写下“信息不足”。如果提供了对问题的答案,那么必须使用以下格式注释相关段落({"引用": …})。 |
USER 用户 | """<insert document here>""" """<插入文档>""" Question: <insert question here> 问题:<插入问题> |
“点赞有美意,赞赏是鼓励”