新技术:为你引人“后退提示”

2023年10月18日 由 alex 发表 476 0

Step-Back Prompting(STP)仅与一个LLM进行迭代过程进行翻译。


正如你将在本文中看到的,STP可以与RAG结合使用,具有可比较的结果。


如下图所示,STP是一种更为技术性的提示工程方法,其中原始问题需要简化为一步回问题,并将一步回答用于最终答案。


1


考虑下面的例子,我使用LangSmith执行时,可以创建一个提示,指导LLM如何生成退步问题。


You are an expert at world knowledge. 
Your task is to step back and paraphrase a question to a more generic 
step-back question, which is easier to answer. 
Here are a few examples:
Original Question: Which position did Knox Cunningham hold from May 1955 to Apr 1956?
Stepback Question: Which positions have Knox Cunning- ham held in his career?
Original Question: Who was the spouse of Anna Karina from 1968 to 1974?
Stepback Question: Who were the spouses of Anna Karina?
Original Question: Which team did Thierry Audel play for from 2007 to 2008?
Stepback Question: Which teams did Thierry Audel play for in his career?


这里的后退问题是通过LangSmith利用 GooglePalm生成的 text-bison-001


2


我确实感觉到这种提示技术对于静态或提示模板方法来说过于复杂,而在自主代理的实现中会更有效。


正如我们在大多数已发表的提示技术中所见,当需要查询进行复杂的多步推理时,大型语言模型(LLM)需要指导,并且在解决复杂请求时分解是一个关键组成部分。


逐步监督的验证过程是提高中间推理步骤正确性的有希望的方法。


最著名的分解提示技术是链式思维推理。在这项研究中,将“退后一步”提示与COT提示进行比较。


下面的文本展示了使用原始问题、回溯问题、原则以及由LLM生成的最终答案的提示的完整示例。


Original Question: "Potassium-40 is a minor isotope found in naturally occurring potassium. It is radioactive and can be detected on simple radiation counters. 
How many protons, neutrons, and electrons does potassium-40 have when it is part of K2SO4?
Choose an option from the list below:
0) 21 neutrons, 19 protons, 18 electrons
1) 20 neutrons, 19 protons, 19 electrons
2) 21 neutrons, 19 protons, 19 electrons
3) 19 neutrons, 19 protons, 19 electrons"
Stepback Question: "What are the chemistry principles behind this question?"
Principles:
"Atomic number: The atomic number of an element is the number of protons in the nucleus of an atom of that element."
Final Answer:


这张图展示了遵循一个抽象和推理方案的“后退提示”的卓越表现。显然,这种方法在各种更复杂的任务中带来了显著的改进。


3


下图显示了在TimeQA数据集上使用Step-Back提示方法的结果。Step-Back与RAG相比基准预测。


左边是Step-Back和RAG与基准预测的比较。


右边是Step-Back和RAG与RAG预测的比较。


Step-Back提示修正了39.9%基准预测错误的情况,但引入了5.6%的错误。


Step-Back提示+RAG修复了21.6%来自RAG的错误,同时引入了6.3%的错误。


4


抽象的目的并非含糊不清,而是为了在其中创造一个全然准确的语义层次。——埃德斯格·W·迪科斯特拉


这项研究再次展示了大型语言模型的多用途性,以及可以发明新的与LLM互动的方式来进一步利用LLM。


这项技术还展示了静态提示的范围,并清楚地表明随着复杂性的增加,需要采用更多类似于提示链和自主代理等增强工具。

文章来源:https://medium.com/@cobusgreyling/a-new-prompt-engineering-technique-has-been-introduced-called-step-back-prompting-b00e8954cacb
欢迎关注ATYUN官方公众号
商务合作及内容投稿请联系邮箱:bd@atyun.com
评论 登录
热门职位
Maluuba
20000~40000/月
Cisco
25000~30000/月 深圳市
PilotAILabs
30000~60000/年 深圳市
写评论取消
回复取消