ChatGPT 最佳实践指南之:系统地测试变化

Test changes systematically

系统地测试变化

Improving performance is easier if you can measure it. In some cases a modification to a prompt will achieve better performance on a few isolated examples but lead to worse overall performance on a more representative set of examples. Therefore to be sure that a change is net positive to performance it may be necessary to define a comprehensive test suite (also known an as an "eval").

如果能够对性能进行衡量,那么改进性能就更容易。在某些情况下,对提示进行修改可能会在一些孤立的示例上获得更好的性能,但在更具代表性的示例集上可能会导致更差的整体性能。因此,为确保改变对性能的净增益,可能需要定义全面的测试套件(也称为“评估”)。

Sometimes it can be hard to tell whether a change — e.g., a new instruction or a new design — makes your system better or worse. Looking at a few examples may hint at which is better, but with small sample sizes it can be hard to distinguish between a true improvement or random luck. Maybe the change helps performance on some inputs, but hurts performance on others.

有时很难判断一个变化(例如新的指令或新的设计)是使系统变得更好还是更糟。通过查看几个示例可能可以暗示哪个更好,但是对于小样本量来说,很难区分是真正的改进还是随机运气。也许这个变化在某些输入上有助于性能,但对其他输入有害。

Evaluation procedures (or "evals") are useful for optimizing system designs. Good evals are:

评估程序(或“evals”)对于优化系统设计非常有用。良好的评估应该具备以下特点:

- Representative of real-world usage (or at least diverse)

- 代表现实世界的使用情况(或至少多样化)

- Contain many test cases for greater statistical power (see table below for guidelines)

- 包含许多测试用例以增加统计功效(请参考下表以获取指导方针)

- Easy to automate or repeat

- 易于自动化或重复进行

DIFFERENCE TO DETECT

差异的检测

SAMPLE SIZE NEEDED FOR 95% CONFIDENCE

需要的样本大小以达到95%的置信度

30%
~10
10%
~100
3%
~1,000
1%~10,000

Evaluation of outputs can be done by computers, humans, or a mix. Computers can automate evals with objective criteria (e.g., questions with single correct answers) as well as some subjective or fuzzy criteria, in which model outputs are evaluated by other model queries. OpenAI Evals is an open-source software framework that provides tools for creating automated evals.

所做的评估可以由计算机、人类或二者混合进行。计算机可以根据客观标准(例如,具有单个正确答案的问题)自动化评估,也可以根据其他模型查询来评估模型输出的一些主观或模糊标准。OpenAI Evals 是一个开源软件框架,提供了创建自动化评估的工具。

Model-based evals can be useful when there exists a range of possible outputs that would be considered equally high in quality (e.g. for questions with long answers). The boundary between what can be realistically evaluated with a model-based eval and what requires a human to evaluate is fuzzy and is constantly shifting as models become more capable. We encourage experimentation to figure out how well model-based evals can work for your use case.

基于模型的评估在存在一系列可能的输出被认为具有相等高质量的情况下(例如,对于答案较长的问题)可能会很有用。基于模型的评估能够进行实际评估和需要人类评估的边界是模糊的,并且随着模型能力的提升而不断变化。我们鼓励进行实验,以确定基于模型的评估在您的用例中能够发挥多大作用。

Tactic: Evaluate model outputs with reference to gold-standard answers

技巧:根据黄金标准答案评估模型输出

Suppose it is known that the correct answer to a question should make reference to a specific set of known facts. Then we can use a model query to count how many of the required facts are included in the answer.

假设我们已知正确答案应该引用一组特定的已知事实。然后,我们可以使用模型查询来计算答案中包含的必需事实的数量。

For example, using the following system message:

例如,使用以下系统消息:

SYSTEM

系统

You will be provided with text delimited by triple quotes that is supposed to be the answer to a question. Check if the following pieces of information are directly contained in the answer:

您将获得由三个反引号分隔的文本,这应该是一个问题的答案。检查以下信息是否直接包含在答案中:

- Neil Armstrong was the first person to walk on the moon.

尼尔·阿姆斯特朗是第一个在月球上行走的人。

- The date Neil Armstrong first walked on the moon was July 21, 1969.

尼尔·阿姆斯特朗首次登上月球的日期是1969年7月21日。

For each of these points perform the following steps:

对于这些要点,执行以下步骤:

1 - Restate the point.

1 - 重新阐述要点。

2 - Provide a citation from the answer which is closest to this point.

2 - 提供离此要点最近的答案中的引用。

3 - Consider if someone reading the citation who doesn't know the topic could directly infer the point. Explain why or why not before making up your mind.

3 - 考虑如果阅读引用的人不了解这个主题,能否直接推断出这个要点。在做出决定之前解释为什么或为什么不。

4 - Write "yes" if the answer to 3 was yes, otherwise write "no".

4 - 如果答案是“是”,则写“yes”,否则写“no”。

Finally, provide a count of how many "yes" answers there are. Provide this count as {"count": <insert count here>}.

最后,提供有多少个“yes”答案的计数。将此计数提供为{"count": <插入计数>}。

Here's an example input where both points are satisfied:

以下是满足两个要点的示例输入:

SYSTEM

系统

<insert system message above>

<插入上面的系统消息>

USER

用户

"""Neil Armstrong is famous for being the first human to set foot on the Moon. This historic event took place on July 21, 1969, during the Apollo 11 mission."""

"""尼尔·阿姆斯特朗因成为第一个登上月球的人而闻名。这一历史性事件发生在1969年7月21日,属于阿波罗11号任务。"""

Here's an example input where only one point is satisfied:

以下是只有一个满意要点的示例输入:

SYSTEM

系统

<insert system message above>

<插入上面的系统消息>

USER

用户

"""Neil Armstrong made history when he stepped off the lunar module, becoming the first person to walk on the moon."""

"""当尼尔·阿姆斯特朗踏出登月舱,成为第一个踏上月球的人时,他创造了历史。"""

Here's an example input where none are satisfied:

这是一个示例输入,其中没有满足要求的部分:

SYSTEM

系统

<insert system message above>

<插入上述系统消息>

USER

用户

"""In the summer of '69, a voyage grand,

Apollo 11, bold as legend's hand.

Armstrong took a step, history unfurled,

"One small step," he said, for a new world."""

"""在'69年的夏天,一次伟大的航行,

阿波罗11,勇敢如传说之手。

阿姆斯特朗迈出一步,历史展开,

他说:“迈出小小的一步”,为了一个新世界。

"""

There are many possible variants on this type of model-based eval. Consider the following variation which tracks the kind of overlap between the candidate answer and the gold-standard answer, and also tracks whether the candidate answer contradicts any part of the gold-standard answer.

这种基于模型的评估可以有很多可能的变体。考虑以下变种,跟踪候选答案与黄金标准答案之间的重叠类型,并跟踪候选答案是否与黄金标准答案的任何部分相矛盾。

SYSTEM

系统

Use the following steps to respond to user inputs. Fully restate each step before proceeding. i.e. "Step 1: Reason...".

使用以下步骤来回应用户输入。在继续之前,完整重新陈述每一步,例如“步骤1:逐步推理...”。

Step 1: Reason step-by-step about whether the information in the submitted answer compared to the expert answer is either: disjoint, equal, a subset, a superset, or overlapping (i.e. some intersection but not subset/superset).

步骤1:逐步推理提交的答案与专家答案的信息是否是不相交、相等、子集、超集或重叠(即有一些交集但不是子集/超集)。

Step 2: Reason step-by-step about whether the submitted answer contradicts any aspect of the expert answer.

步骤2:逐步推理提交的答案是否与专家答案的任何方面相矛盾。

Step 3: Output a JSON object structured like: {"type_of_overlap": "disjoint" or "equal" or "subset" or "superset" or "overlapping", "contradiction": true or false}

步骤3:输出一个结构化的JSON对象,形式如下:{"type_of_overlap": "不相交"或"相等"或"子集"或"超集"或"重叠","contradiction": true或false}。

Here's an example input with a substandard answer which nonetheless does not contradict the expert answer:

以下是一个具有不太理想的答案但并不与专家答案相矛盾的示例输入:

SYSTEM

系统

<insert system message above>

<插入上述系统消息>

USER

用户

Question: """What event is Neil Armstrong most famous for and on what date did it occur? Assume UTC time."""

问题:"尼尔·阿姆斯特朗最出名的事件是什么?它发生在哪个日期?假设使用UTC时间。"

Submitted Answer: """Didn't he walk on the moon or something?"""

提交的答案:"他是不是在月球上行走了什么的?"

Expert Answer: """Neil Armstrong is most famous for being the first person to walk on the moon. This historic event occurred on July 21, 1969."""

专家答案:"尼尔·阿姆斯特朗最出名的是成为第一个在月球上行走的人。这一历史事件发生在1969年7月21日。"

Here's an example input with answer that directly contradicts the expert answer:

以下是一个与专家答案直接相矛盾的示例输入:

SYSTEM

系统

<insert system message above>

<插入上述系统消息>

USER

用户

Question: """What event is Neil Armstrong most famous for and on what date did it occur? Assume UTC time."""

问题:"尼尔·阿姆斯特朗最出名的事件是什么?它发生在哪个日期?假设使用UTC时间。"

Submitted Answer: """On the 21st of July 1969, Neil Armstrong became the second person to walk on the moon, following after Buzz Aldrin."""

提交的答案:"在1969年7月21日,尼尔·阿姆斯特朗成为第二个登上月球的人,继巴兹·奥尔德林之后。"

Expert Answer: """Neil Armstrong is most famous for being the first person to walk on the moon. This historic event occurred on July 21, 1969."""

专家答案:"尼尔·阿姆斯特朗最出名的是成为第一个在月球上行走的人。这一历史事件发生在1969年7月21日。"

Here's an example input with a correct answer that also provides a bit more detail than is necessary:

以下是一个正确的答案,但提供了比必要的细节更多的示例输入:

SYSTEM

系统

<insert system message above>

<插入上述系统消息>

USER

用户

Question: """What event is Neil Armstrong most famous for and on what date did it occur? Assume UTC time."""

问题:"尼尔·阿姆斯特朗最出名的事件是什么?它发生在哪个日期?假设使用UTC时间。"

Submitted Answer: """At approximately 02:56 UTC on July 21st 1969, Neil Armstrong became the first human to set foot on the lunar surface, marking a monumental achievement in human history."""

提交的答案:"在1969年7月21日UTC时间的02:56左右,尼尔·阿姆斯特朗成为第一个踏上月球表面的人,标志着人类历史上的一个重大成就。"

Expert Answer: """Neil Armstrong is most famous for being the first person to walk on the moon. This historic event occurred on July 21, 1969."""

专家答案:"尼尔·阿姆斯特朗最出名的是成为第一个在月球上行走的人。这一历史事件发生在1969年7月21日。

0dc723301842065a1f8d61411a8ab6fa.jpeg

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

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

分布式运用——存储系统Ceph

分布式运用——存储系统Ceph 一、Ceph 介绍1.Ceph 简介2、存储基础2.1 单机存储设备2.2 单机存储的问题2.3 商业存储解决方案2.4 分布式存储&#xff08;软件定义的存储 SDS&#xff09;2.5 分布式存储的类型 3.Ceph 优势3.1 高扩展性3.2 高可靠性3.3 高性能3.4 功能强大 4.Cep…

pwm呼吸灯

文章目录 一、呼吸灯二、代码实现三、引脚分配 一、呼吸灯 呼吸灯是指灯光在微电脑的控制之下完成由亮到暗的逐渐变化&#xff0c;使用开发板上的四个led灯实现1s间隔的呼吸灯。 二、代码实现 c module pwm_led( input clk ,input rst_n ,output reg [3:0] led ); …

mysql中的行格式之compact格式分析

mysql中的行格式之compact格式分析 mysql行格式 所谓行格式&#xff0c;就是指mysql一行数据的存储格式。 InnoDB 储存引擎支持有四种行储存格式&#xff1a;Compact、Redundant、Dynamic 和 Compressed。 Redundant是很古老的行格式了&#xff0c;因为占用空间最多&#x…

(1)ADS-B接收机

文章目录 前言 1.1 所需硬件 1.2 连接到自动驾驶仪 1.3 设置 1.4 ADSB输出配置 1.5 启用载人飞行器避障功能 1.6 飞行器数据库 1.7 开发者信息包括模拟 前言 本文介绍了如何安装和配置 ADS-B 模块&#xff0c;以便你的飞机能够知道附近的其他飞机和空中交通管制&#x…

CSS样式

1.高度和宽度 .c1{height:300px;width:500px;}注意事项&#xff1a; 宽度支持百分比&#xff0c;高度不支持。行内标签&#xff1a;默认无效会计标签&#xff1a;默认有效&#xff08;霸道&#xff0c;右侧区域空白&#xff0c;也不给你用&#xff09; 2.块级和行内标签 块…

微服务架构+创建微服务工程(商品/订单)

目录 1.微服务架构 1.1.单体应用架构 1.2.微服务应用 1.3 微服务架构的优势 1.4.微服务架构的缺点(挑战) 1.5. SpringCloud与微服务关系 1.6.SpringBoot和SpringCloud关系 2. 创建微服务工程 2.1.数据库 2.2.搭建父工程 2.2 创建公共模块 2.3.商品系统 2.4.订单微…

Linux/Unix-gcc编译回顾

1、gcc编译为可执行程序四步骤&#xff1a;预处理->编译->汇编->链接 注意&#xff1a;-o 用于修改生产的文件名 2、gcc常用参数 指定头文件&#xff1a;-I 语法&#xff1a; gcc -I 头文件所在文件夹路径 源文件 -o 生成文件名 如果头文件和源文件中同一个文件夹…

Docker 常用命令

docker命令大全 命令说明docker attach将本地标准输入、输出和错误流附加到正在运行的容器docker build从 Dockerfile 构建镜像docker builder管理构建docker checkpoint管理检查点docker commit从容器的更改中创建新图像docker config管理 Docker 配置docker container管理容器…

GOPATH、GOROOT(VSCode编写第一个go程序)

1. GOROOT和GOPATH GOROOT 和 GOPATH 都是 Go 语言中的环境变量&#xff0c;用于指定 Go 工具链和工作区的路径。 GOROOT 指定了 Go 工具链的安装路径&#xff0c;它包含了 Go 语言的标准库、编译器等工具。在使用 Go 编译器、运行时等工具时&#xff0c;它们会默认从 GOROOT…

新晋 Committer!来自复旦大学的帅哥一枚

点亮Star⭐️ 支持我们 https://github.com/apache/dolphinscheduler 最近&#xff0c;社区星力量又迎来一位新晋 Committer&#xff0c;这次是来自复旦大学研究生在读的王维饶同学&#xff0c;一起来认识一下吧&#xff01; 个人简介 姓名&#xff1a;王维饶职位&#xff1a…

SignalTap II 软件使用步骤

文章目录 前言一、SignalTap II是什么&#xff1f;二、使用步骤三、总结四、参考资料 前言 环境&#xff1a; 1、Quartus18.1 2、板子型号&#xff1a;原子哥开拓者2(EP4CE10F17C8) 要求&#xff1a; 能够使用SignalTap II进行片上调试。 一、SignalTap II是什么&#xff1f; S…

华为云子网路由表作用及价值

子网路由表 子网路由表作用云专线、VPN的配置与子网路由表强关联&#xff0c;本质是在相应的子网路由表中添加了一条路由Nat路由表问题地址变更问题snat和dnat 子网路由表作用 子网内部作为一个二层网络&#xff0c;通过mac地址互通&#xff0c;不通过路由互通。跨子网&#x…

ASUS华硕ROG幻14 2021款GA401QM原厂Win10系统工厂模式带ASUS Recovery恢复功能

自带恢复分区、所有驱动、出厂主题壁纸LOGO、Office办公软件、奥创控制中心等预装程序 所需要工具&#xff1a;16G或以上的U盘(非必需) 文件格式&#xff1a;HDI,SWP,OFS,EDN,KIT,TLK多个底包 文件大小&#xff1a;11.34GB 注&#xff1a;恢复时会清空电脑上所有盘的数据&…

【布局优化】基于遗传算法的车间布局优化 车间设施布局优化【Matlab代码#50】

文章目录 【获取资源请见文章第5节&#xff1a;资源获取】1. 车间布局优化2. 基于GA的布局优化模型3. 部分代码展示4. 仿真结果展示5. 资源获取 【获取资源请见文章第5节&#xff1a;资源获取】 1. 车间布局优化 车间设施布置的规划一直是工业工程领域不断研究和探索的内容&am…

【人工智能】xAI——“X宇宙”又增添了一位新成员

个人主页&#xff1a;【&#x1f60a;个人主页】 &#x1f31e;热爱编程&#xff0c;热爱生活&#x1f31e; 文章目录 前言xAI团队成员做解开宇宙本质的AI 前言 有人问他&#xff0c;xAI公司是干啥的&#xff1f;马斯克的回答引用了其偶像、科幻作家道格拉斯・亚当斯的话&…

[javascript核心-08] V8 内存管理机制及性能优化

V8 内存管理 V8 本身也是程序&#xff0c;它本身也会申请内存&#xff0c;它申请的内存称为常驻内存&#xff0c;而它又将内存分为堆和栈 栈内存 栈内存介绍 栈用于存放JS 中的基本类型和引用类型指针栈空间是连续的&#xff0c;增加删除只需要移动指针&#xff0c;操作速度…

leetcode100.相同的树

⭐️ 题目描述 &#x1f31f; leetcode链接&#xff1a;相同的树 1️⃣ 代码&#xff1a; bool isSameTree(struct TreeNode* p, struct TreeNode* q){// 判断两棵树当前结点是否为空if (p NULL && q NULL) {// 说明是相同的return true;}// 来到这里有几种情况// …

单片机第一季:零基础6——按键

目录 1&#xff0c;独立按键 2&#xff0c;矩阵按键 &#xff08;注意&#xff1a;文章中的代码仅供参考学习&#xff0c;实际使用时要根据需要修改&#xff09; 1&#xff0c;独立按键 按键管脚两端距离长的表示默认是导通状态&#xff0c;距离短的默认是断开状态&#xf…

集群基础3——haproxy负载均衡apache

文章目录 一、环境说明二、安装配置httpd三、安装配置haproxy四、验证http负载均衡五、配置https负载均衡六、haproxy网页监控6.1 监控参数详解6.2 页面操作 一、环境说明 使用haproxy对apache进行负载均衡。 主机IP角色安装服务192.168.161.131后端服务器1httpd,80端口192.168…

前端 | (五)CSS三大特性及常用属性 | 尚硅谷前端html+css零基础教程2023最新

学习来源&#xff1a;尚硅谷前端htmlcss零基础教程&#xff0c;2023最新前端开发html5css3视频 文章目录 &#x1f4da;CSS三大属性&#x1f407;层叠性&#x1f407;继承性&#x1f407;优先级 &#x1f4da;CSS常用属性&#x1f407;像素的概念&#x1f407;颜色的表示⭐️表…
最新文章