ChatGPT 最佳实践指南之:给 GPT 足够的时间“思考”

news2024/7/5 21:36:56

Give GPTs time to "think"

给予 GPT 足够的时间“思考”

If asked to multiply 17 by 28, you might not know it instantly, but can still work it out with time. Similarly, GPTs make more reasoning errors when trying to answer right away, rather than taking time to work out an answer. Asking for a chain of reasoning before an answer can help GPTs reason their way toward correct answers more reliably.

如果被要求计算 17 乘以 28,您可能不会立即知道答案,但是在经过一段时间后就计算出来。同样,与立即回答相比,GPT 在尝试立即回答时会产生更多推理错误,而是给予其足够的时间来得出答案。在给出答案之前要求模型进行推理可以帮助 GPT 更可靠地得到正确答案。

Tactic: Instruct the model to work out its own solution before rushing to a conclusion

技巧:在匆忙得出结论之前,指示模型从基本原理开始推理

Sometimes we get better results when we explicitly instruct the model to reason from first principles before coming to a conclusion. Suppose for example we want a model to evaluate a student’s solution to a math problem. The most obvious way to approach this is to simply ask the model if the student's solution is correct or not.

我们在模型匆忙得出结论之前,明确指示模型从基本原理开始推理,有时可以获得更好的结果。例如,假设我们想让模型评估学生对数学问题的解决方案,最常见的方法是简单地询问模型学生的解决方案是否正确。

SYSTEM

系统

Determine if the student's solution is correct or not.

确定学生的解决方案是否正确。

USER

用户

Problem Statement: I'm building a solar power installation and I need help working out the financials.

问题陈述:我正在建设一个太阳能发电设施,我需要帮助计算财务数据。

- Land costs $100 / square foot

- I can buy solar panels for $250 / square foot

- I negotiated a contract for maintenance that will cost me a flat $100k per year, and an additional $10 / square foot

土地成本为每平方英尺 100 美元

我可以购买每平方英尺 250 美元的太阳能电池板

我谈判了一个维护合同,每年的费用为固定的 10 万美元,加上每平方英尺 10 美元

What is the total cost for the first year of operations as a function of the number of square feet.

作为与平方英尺数量相关的第一年运营的总成本是多少。

Student's Solution: Let x be the size of the installation in square feet.

学生的解决方案:设 x 为安装的面积(平方英尺)。

1. Land cost: 100x

2. Solar panel cost: 250x

3. Maintenance cost: 100,000 + 100x

Total cost: 100x + 250x + 100,000 + 100x = 450x + 100,000

土地成本:100x

太阳能电池板成本:250x

维护费用:10 万美元 + 100x

总成本:100x + 250x + 10 万美元 + 100x = 450x + 10 万美元

ASSISTANT

助理

The student's solution is correct.

学生的解决方案是正确的。

But the student's solution is actually not correct! We can get the model to successfully notice this by prompting the model to generate its own solution first.

但实际上,学生的解决方案是错误的!我们可以通过提示模型先生成自己的解决方案,使模型成功注意到这一点。

SYSTEM

系统

First work out your own solution to the problem. Then compare your solution to the student's solution and evaluate if the student's solution is correct or not. Don't decide if the student's solution is correct until you have done the problem yourself.

首先,自己解决问题。然后将自己的解决方案与学生的解决方案进行比较,并评估学生的解决方案是否正确。在自己完成问题之前,请不要确定学生的解决方案是否正确。

USER

用户

Problem Statement: I'm building a solar power installation and I need help working out the financials.

问题陈述:我正在建设一个太阳能发电设施,我需要帮助计算财务数据。

- Land costs $100 / square foot

- I can buy solar panels for $250 / square foot

- I negotiated a contract for maintenance that will cost me a flat $100k per year, and an additional $10 / square foot

土地成本为每平方英尺 100 美元

我可以购买每平方英尺 250 美元的太阳能电池板

我谈判了一个维护合同,每年的费用为固定的 10 万美元,加上每平方英尺 10 美元

What is the total cost for the first year of operations as a function of the number of square feet.

作为与平方英尺数量相关的第一年运营的总成本是多少。

Student's Solution: Let x be the size of the installation in square feet.

学生的解决方案:设 x 为安装的面积(平方英尺)。

1. Land cost: 100x

2. Solar panel cost: 250x

3. Maintenance cost: 100,000 + 100x

Total cost: 100x + 250x + 100,000 + 100x = 450x + 100,000

土地成本:100x

太阳能电池板成本:250x

维护费用:10 万美元 + 100x

总成本:100x + 250x + 10 万美元 + 100x = 450x + 10 万美元

ASSISTANT

助理

Let x be the size of the installation in square feet.

设 x 为安装的面积(平方英尺)。

1. Land cost: 100x

2. Solar panel cost: 250x

3. Maintenance cost: 100,000 + 10x

Total cost: 100x + 250x + 100,000 + 10x = 360x + 100,000

土地成本:100x

太阳能电池板成本:250x

维护费用:10 万美元 + 100x

总成本:100x + 250x + 10 万美元 + 10x = 360x + 10 万美元

The student's solution is incorrect. They made an error in the maintenance cost calculation, using 100x instead of 10x. The correct total cost for the first year of operations is 360x + 100,000.

学生的解决方案是不正确的。他们在维护费用计算中犯了一个错误,使用了 100x 而不是 10x。第一年运营的正确总成本为 360x + 10 万美元。

Tactic: Use inner monologue or a sequence of queries to hide the model's reasoning process

技巧:使用内心独白或一系列查询来隐藏模型的推理过程

The previous tactic demonstrates that it is sometimes important for the model to reason in detail about a problem before answering a specific question. For some applications, the reasoning process that a model uses to arrive at a final answer would be inappropriate to share with the user. For example, in tutoring applications we may want to encourage students to work out their own answers, but a model’s reasoning process about the student’s solution could reveal the answer to the student.

上述策略表明,在回答特定问题之前,模型有时需要详细推理一个问题。对于某些应用程序,模型为了得出最终答案所使用的推理过程可能不适合与用户分享。例如,在辅导应用程序中,我们可能希望鼓励学生自己解答问题,但模型关于学生解决方案的推理过程可能会向学生揭示答案。

Inner monologue is a tactic that can be used to mitigate this. The idea of inner monologue is to instruct the model to put parts of the output that are meant to be hidden from the user into a structured format that makes parsing them easy. Then before presenting the output to the user, the output is parsed and only part of the output is made visible.

内心独白是一种可以用于缓解这个问题的策略。内心独白的思想是指示模型将那些不应与用户共享的部分放入一个结构化格式中,使其易于解析。然后,在将输出呈现给用户之前,对输出进行解析,并只显示部分输出。

SYSTEM

系统

Follow these steps to answer the user queries.

按照以下步骤回答用户的查询。

Step 1 - First work out your own solution to the problem. Don't rely on the student's solution since it may be incorrect. Enclose all your work for this step within triple quotes (""").

第一步 - 首先自己解决问题。不要依赖学生的解决方案,因为它可能是错误的。在这一步中,将所有工作放在三引号内(""")。

Step 2 - Compare your solution to the student's solution and evaluate if the student's solution is correct or not. Enclose all your work for this step within triple quotes (""").

第二步 - 将自己的解决方案与学生的解决方案进行比较,并评估学生的解决方案是否正确。在这一步中,将所有工作放在三引号内(""")。

Step 3 - If the student made a mistake, determine what hint you could give the student without giving away the answer. Enclose all your work for this step within triple quotes (""").

第三步 - 如果学生犯了错误,请确定可以给予学生什么提示,而不会透露答案。在这一步中,将所有工作放在三引号内(""")。

Step 4 - If the student made a mistake, provide the hint from the previous step to the student (outside of triple quotes). Instead of writing "Step 4 - ..." write "Hint:".

第四步 - 如果学生犯了错误,请向学生提供上一步中的提示(不包括在三引号内)。不要写成“第四步 - ...”,而应写成“提示:”。

USER

用户

Problem Statement: <insert problem statement>

问题陈述:<插入问题陈述>

Student Solution: <insert student solution>

学生解决方案:<插入学生的解决方案>

Alternatively, this can be achieved with a sequence of queries in which all except the last have their output hidden from the end user.

另外,这可以通过一系列查询来实现,其中除最后一个之外的所有查询的输出对最终用户隐藏。

First, we can ask the model to solve the problem on its own. Since this initial query doesn't require the student’s solution, it can be omitted. This provides the additional advantage that there is no chance that the model’s solution will be biased by the student’s attempted solution.

首先,我们可以让模型独立解决问题。由于此初始查询不需要学生的解决方案,因此可以省略。这样做的额外优点是模型的解决方案不会受到学生尝试解决方案的偏见。

USER

用户

<insert problem statement>

<插入问题陈述>

Next, we can have the model use all available information to assess the correctness of the student’s solution.

接下来,我们可以让模型使用所有可用信息来评估学生的解决方案的正确性。

SYSTEM

系统

Compare your solution to the student's solution and evaluate if the student's solution is correct or not.

将自己的解决方案与学生的解决方案进行比较,并评估学生的解决方案是否正确。

USER

用户

Problem statement: """<insert problem statement>"""

问题陈述:"""<插入问题陈述>"""

Your solution: """<insert model generated solution>"""

你的解决方案:"""<插入模型生成的解决方案>"""

Student’s solution: """<insert student's solution>"""

学生的解决方案:"""<插入学生的解决方案>"""

Finally, we can let the model use its own analysis to construct a reply in the persona of a helpful tutor.

最后,我们可以让模型利用自己的分析,以有用的辅导员角色构建回复。

SYSTEM

系统

You are a math tutor. If the student made an error, offer a hint to the student in a way that does not reveal the answer. If the student did not make an error, simply offer them an encouraging comment.

你是一名数学辅导员。如果学生犯了错误,请以不透露答案的方式向他们提供提示。如果学生没有犯错误,请给予他们鼓励性的评论。

USER

用户

Problem statement: """<insert problem statement>"""

问题陈述:"""<插入问题陈述>"""

Your solution: """<insert model generated solution>"""

你的解决方案:"""<插入模型生成的解决方案>"""

Student’s solution: """<insert student's solution>"""

学生的解决方案:"""<插入学生的解决方案>"""

Analysis: """<insert model generated analysis from previous step>"""

分析:"""<插入先前步骤中模型生成的分析>"""

Tactic: Ask the model if it missed anything on previous passes

技巧:询问模型是否漏掉了之前的内容

Suppose that we are using a model to list excerpts from a source which are relevant to a particular question. After listing each excerpt the model needs to determine if it should start writing another or if it should stop. If the source document is large, it is common for a model to stop too early and fail to list all relevant excerpts. In that case, better performance can often be obtained by prompting the model with followup queries to find any excerpts it missed on previous passes.

假设我们正在使用模型列出与特定问题相关的源文件摘录。在列出每个摘录后,模型需要确定是开始撰写另一个摘录还是停止。如果源文件很大,模型往往会过早停止,未能列出所有相关的摘录。在这种情况下,可以通过提示模型进行后续查询,找出之前遗漏的摘录,以获得更好的性能。

SYSTEM

系统

You will be provided with a document delimited by triple quotes. Your task is to select excerpts which pertain to the following question: "What significant paradigm shifts have occurred in the history of artificial intelligence."

你将获得一个由三引号界定的文件。你的任务是选择与以下问题相关的摘录:“在人工智能的历史中发生了哪些重大范式转变。”

Ensure that excerpts contain all relevant context needed to interpret them - in other words don't extract small snippets that are missing important context. Provide output in JSON format as follows:

确保摘录包含解释所需的所有相关上下文 - 换句话说,不要提取缺少重要上下文的小片段。以以下 JSON 格式提供输出:

[{"excerpt": "..."},

...

{"excerpt": "..."}]

[{"摘录": "..."},

...

{"摘录": "..."}]

USER

用户

"""<insert document here>"""

"""<插入文件内容>"""

ASSISTANT

助理

[{"excerpt": "the model writes an excerpt here"},

...

{"excerpt": "the model writes another excerpt here"}]

[{"摘录": "模型在此处撰写一个摘录"},

...

{"摘录": "模型在此处撰写另一个摘录"}]

USER

用户

Are there more relevant excerpts? Take care not to repeat excerpts. Also ensure that excerpts contain all relevant context needed to interpret them - in other words don't extract small snippets that are missing important context.

还有更多相关的摘录吗?请注意不要重复摘录。还要确保摘录包含解释所需的所有相关上下文,换句话说,不要提取缺少重要上下文的小片段。

e2829faf2816130020b0293a3f813fec.jpeg

“点赞有美意,赞赏是鼓励”

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/748502.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Modbus TCP/BACnet IP/MQTT物联网网关IOT-810介绍及其典型应用

伴随着计算机技术以及互联网的发展&#xff0c;物联网这个概念已经逐渐进入我们的日常生活&#xff0c;例如智能泊车&#xff0c;智能家居&#xff0c;智能照明&#xff0c;智能楼宇等。智能楼宇是将传统的楼宇自控系统与物联网技术相融合&#xff0c;把系统中常见的传感器、设…

克服 ClickHouse 运维难题:ByteHouse 水平扩容功能上线

前言 对于分析型数据库产品&#xff0c;通过增加服务节点实现集群水平扩容&#xff0c;并提升集群性能和容量&#xff0c;是运维的必要手段。 但是对于熟悉 ClickHouse 的工程师而言&#xff0c;听到“扩容”二字一定会头疼不已。开源 ClickHouse 的 MPP 架构导致扩容成本高&…

【前缀和优化DP】ABC 222D

虽然很简单&#xff0c;但是统一一下板子&#xff0c;以防写错 D - Between Two Arrays (atcoder.jp) 题意&#xff1a; 思路&#xff1a; 直接DP即可 Code&#xff1a; #include <bits/stdc.h>#define int long longusing namespace std;const int mxn3e310; const…

ASP.NET Website 项目 .NET Framework 4.0 ~ .NET Framework 4.8支持c#哪些版本(Website)

本文讲的是Website网站项目&#xff0c;由于维护老项目Website .net framework4.0&#xff0c;遇到c#6.0语法不支持。便做了点记录 ASP.NET Website 项目 .NET Framework 4.0、 .NET Framework 4.5、 .NET Framework 4.6、 .NET Framework 4.8都支持c#哪些版本&#xff1f; 下面…

使用一行css实现黑白色主题皮肤的切换

很多网站都有切换主题的效果 比如如下所示 示例代码 <template><div class"css-switch-theme"><el-switchchange"hanldeSwitchTheme"v-model"themValue"active-text"暗黑"inactive-text"白色"active-color&q…

文件传输越来越频繁,如何选择高速文件传输解决方案

随着云计算、大数据等技术的发展和人们对文件传输速度的要求不断提高&#xff0c;高速文件传输成为个人和企业之间必不可少的需求。在这个背景下&#xff0c;如何实现安全、稳定、高效的文件传输就成为了一个热门话题。本文将从以下几个方面&#xff0c;详细介绍 高速文件传输解…

SpringBoot 集成 Mybatis

SpringBoot 集成 Mybatis 详细教程 &#xff08;只有操作&#xff0c;没有理论&#xff0c;仅供参考学习&#xff09; 一、操作部分 1. 准备数据库 1.1 数据库版本&#xff1a; C:\WINDOWS\system32>mysql -V mysql Ver 8.0.25 for Win64 on x86_64 (MySQL Community …

深入解读:多人语音聊天室源码开发搭建社交分享功能

在生活中&#xff0c;流传着这么一句谚语&#xff0c;叫“赠人玫瑰&#xff0c;手有余香”&#xff0c;这句谚语大致意思就是劝导人们&#xff0c;分享给别人好的东西&#xff0c;自己也会有好处&#xff0c;收获到快乐。分享也是我们日常生活中社交的一种方式&#xff0c;当我…

【技能实训】DMS数据挖掘项目-Day08

文章目录 任务8【任务8.1.1】对IDataAnalyse类方法返回值使用泛型集合升级【任务8.1.2】对DataFilter类成员属性使用泛型集合升级&#xff0c;类型参数是有界的&#xff08;DataBase的子类&#xff09;【任务8.2】对LogRecAnalyse类成员属性使用泛型集合升级,相关数据集合进行泛…

SaaS私有云智慧校园电子班牌系统源码

智慧校园APP源码人脸识别系统 电子班牌云平台源码 SaaS私有云部署模式 电子班牌又称智慧班牌&#xff0c;是打造智慧校园的必需品&#xff0c;它可以展示班级信息、时间天气、班容班貌、通知公告、考勤签到、课程安排、值日安排等信息&#xff0c;无纸化电子设备&#xff0c;后…

剑指Offer-学习计划(二)链表篇

剑指 Offer 06. 从尾到头打印链表https://leetcode.cn/problems/cong-wei-dao-tou-da-yin-lian-biao-lcof/ 剑指 Offer 35. 复杂链表的复制https://leetcode.cn/problems/fu-za-lian-biao-de-fu-zhi-lcof/剑指 Offer 24. 反转链表https://leetcode.cn/problems/fan-zhuan-lian…

(37)安全开关

文章目录 前言 37.1 LED的含义 37.2 配置安全开关 37.3 使用安全开关强制更新I/O板固件 前言 一个安全开关可以用来启用/禁用电机和伺服的输出。该开关控制飞行器的"安全"状态。当处于这种状态时&#xff0c;电机被阻止运行&#xff08;除了在 Planes MANUAL 模…

2023年9月山东/厦门/南宁/深圳DAMA-CDGA/CDGP认证考试报名

据DAMA中国官方网站消息&#xff0c;2023年度第三期DAMA中国CDGA和CDGP认证考试定于2023年9月23日举行。 报名通道现已开启&#xff0c;相关事宜通知如下&#xff1a; 考试科目: 数据治理工程师(CertifiedDataGovernanceAssociate,CDGA) 数据治理专家(CertifiedDataGovernanc…

记一次在forEach循环中使用异步代码无效

背景 代码如下&#xff1a; const res1 await getOrderPackage({XM_LX: "95", // 入院检查套餐 }); const res2 await getOrderPackage({XM_LX: "98", // 入院检验套餐 });const res [...res1.data, ...res2.data] let retList: any[] []; const map: …

一万字带你吃透RocketMQ

前言 工作中很多种场景下会用到消息队列&#xff0c;消息队列简单来说就是 消息的传输过程中保存消息的容器。消息队列主要解决了应用耦合、异步处理、流量削峰等问题。今天我们来了解一下阿里开源的一款产品 RocketMQ。 RocketMQ简介 RocketMQ 是一款低延迟、高并发、高可用…

SEM代运营费用解析:为什么值得投资?

随着企业竞争的日益激烈&#xff0c;SEM&#xff08;搜索引擎营销&#xff09;作为一种重要的数字营销手段&#xff0c;已经成为各类企业不可或缺的一部分。然而&#xff0c;在进行SEM代运营时&#xff0c;很多企业都会关心费用问题。本文将为您解析SEM代运营费用的组成和投资价…

React中的key有什么作用?

一、是什么 首先&#xff0c;先给出react组件中进行列表渲染的一个示例&#xff1a; const data [{ id: 0, name: abc },{ id: 1, name: def },{ id: 2, name: ghi },{ id: 3, name: jkl } ];const ListItem (props) > {return <li>{props.name}</li>; };co…

网络安全(黑客技术)自学笔记

首先给大家简单介绍一下网络安全&#xff1a; 1.什么是网络安全&#xff1f; 网络安全可以基于攻击和防御视角来分类&#xff0c;我们经常听到的 “红队”、“渗透测试” 等就是研究攻击技术&#xff0c;而“蓝队”、“安全运营”、“安全运维”则研究防御技术。 无论网络、…

【星戈瑞】荧光染料BODIPY-689/725激发发射应用

BODIPY-689/725是一种荧光染料&#xff0c;BODIPY具有强烈吸收和发射荧光的有机染料&#xff0c;常用于生物成像和荧光探针应用中&#xff0c;其激发和发射波长适合于深层组织和细胞内的成像,可应用于生物成像、荧光探针、传感器等领域。 产品名称&#xff1a;氟化硼二吡咯-68…

房屋结构安全监测方案,守护城市建筑的安全底线!

近年来&#xff0c;随着城市化进程的加速和建筑业的迅猛发展&#xff0c;房屋结构安全成为社会关注的焦点。房屋在长期使用的过程中可能遭受到各种自然原因逐渐老化、人为原因的损坏导致房屋基础结构产生老化、腐蚀、折断等险情&#xff0c;进而引发结构倾斜、位移、开裂、扭曲…