Evol-Instruct:让LLM将指令改写的更复杂

news2024/9/22 15:51:51

Evol-Instruct方法出自论文 WizardLM: Empowering Large Language Models to Follow Complex Instructions ,也是利用大模型生成指令的方法,它可以生成相对复杂和多样的指令数据集。

对应的github,但是目前只开源LLM部分的代码,如何生成指令的代码暂时未开源。h2o-wizardlm开源了部分指令代码,也还不完整。

Evol-Instruct方法的流程示意如下图,主要包括两个部分: Instruction Evolver和Instruction Eliminator。

在这里插入图片描述

Evol-Instruct流程对应的的一个例子如下图:
在这里插入图片描述

Instruction Evolver

因为LLM有能力根据prompt生成更复杂的指令,所以作者从深度演化和广度演化两个角度来生成指令。

广度演化的prompt如下:

'''
I want you act as a Prompt Creator. 
Your goal is to draw inspiration from the #Given Prompt# to create a brand new prompt. 
This new prompt should belong to the same domain as the #Given Prompt# but be even more rare. 
The LENGTH and difficulty level of the #Created Prompt# should be similar to that of the #Given Prompt#. 
The #Created Prompt# must be reasonable and must be understood and responded by humans. '#Given Prompt#', '#Created Prompt#', 'given prompt' and 'created prompt' are not allowed to appear in #Created Prompt#. 
#Given Prompt#: 
<Here is instruction.> 
#Created Prompt#:
'''

深度演化的prompt分为5类:add constraints, deepening, concretizing, increased reasoning steps, and complicating input。前四类不需要加入上下文,而complicating input需要给定上下文。

add constraints的prompt:

'''
I want you act as a Prompt Rewriter. 
Your objective is to rewrite a given prompt into a more complex version to make those famous AI systems (e.g., ChatGPT and GPT4) a bit harder to handle. 
But the rewritten prompt must be reasonable and must be understood and responded by humans. 
Your rewriting cannot omit the non-text parts such as the table and code in #Given Prompt#:. Also, please do not omit the input in #Given Prompt#. 
You SHOULD complicate the given prompt using the following method:
Please add one more constraints/requirements into #Given Prompt# 
You should try your best not to make the #Rewritten Prompt# become verbose, #Rewritten Prompt# can only add 10 to 20 words into #Given Prompt#. 
'#Given Prompt#', '#Rewritten Prompt#', 'given prompt' and 'rewritten prompt' are not allowed to appear in #Rewritten Prompt# 
#Given Prompt#: 
<Here is instruction.> 
#Rewritten Prompt#:
'''

deepening prompt 的prompt:

'''
I want you act as a Prompt Rewriter.
Your objective is to rewrite a given prompt into a more complex version to make those famous AI systems (e.g., ChatGPT and GPT4) a bit harder to handle. 
But the rewritten prompt must be reasonable and must be understood and responded by humans.
Your rewriting cannot omit the non-text parts such as the table and code in #Given Prompt#:. Also, please do not omit the input in #Given Prompt#. 
You SHOULD complicate the given prompt using the following method: 
If #Given Prompt# contains inquiries about certain issues, the depth and breadth of the inquiry can be increased. or 
You should try your best not to make the #Rewritten Prompt# become verbose, #Rewritten Prompt# can only add 10 to 20 words into #Given Prompt#. 
'#Given Prompt#', '#Rewritten Prompt#', 'given prompt' and 'rewritten prompt' are not allowed to appear in #Rewritten Prompt# 
#Given Prompt#: 
<Here is instruction.> 
#Rewritten Prompt#:
'''

concretizing prompt的prompt:

'''
I want you act as a Prompt Rewriter.
Your objective is to rewrite a given prompt into a more complex version to make those famous AI systems (e.g., ChatGPT and GPT4) a bit harder to handle. 
But the rewritten prompt must be reasonable and must be understood and responded by humans.
Your rewriting cannot omit the non-text parts such as the table and code in #Given Prompt#:. Also, please do not omit the input in #Given Prompt#. 
You SHOULD complicate the given prompt using the following method: 
Please replace general concepts with more specific concepts. or 
You should try your best not to make the #Rewritten Prompt# become verbose, #Rewritten Prompt# can only add 10 to 20 words into #Given Prompt#. 
'#Given Prompt#', '#Rewritten Prompt#', 'given prompt' and 'rewritten prompt' are not allowed to appear in #Rewritten Prompt# 
#Given Prompt#: 
<Here is instruction.> 
#Rewritten Prompt#:
'''

increased reasoning steps 的prompt:

'''
I want you act as a Prompt Rewriter.
Your objective is to rewrite a given prompt into a more complex version to make those famous AI systems (e.g., ChatGPT and GPT4) a bit harder to handle.
But the rewritten prompt must be reasonable and must be understood and responded by humans.
Your rewriting cannot omit the non-text parts such as the table and code in #Given Prompt#:. Also, please do not omit the input in #Given Prompt#.
You SHOULD complicate the given prompt using the following method:
If #Given Prompt# can be solved with just a few simple thinking processes, you can rewrite it to explicitly request multiple-step reasoning.
You should try your best not to make the #Rewritten Prompt# become verbose, #Rewritten Prompt# can only add 10 to 20 words into #Given Prompt#.
'#Given Prompt#', '#Rewritten Prompt#', 'given prompt' and 'rewritten prompt' are not allowed to appear in #Rewritten Prompt#
#Given Prompt#:
<Here is instruction.>
#Rewritten Prompt#:
'''

complicating input需要给定上下文,论文附录D给了多个例子,这里列一个:

'''
I want you act as a Prompt Rewriter. Your objective is to rewrite a given prompt into a more complex version using dataformat to make those famous AI systems (e.g., chatgpt and GPT4) more difficult to handle. But the rewritten prompt must be reasonable and must be understood and responded by humans.
You must add [python code] format text as input data in [Rewritten Prompt]
The Given Prompt:
Transformat python code
Rewritten Prompt(MUST contain a specific python code as input):
I have the following Python code:

cursor.execute(" INSERT INTO table VALUES var1 , var2 , var3 ,")
 
where var1 is an integer, var2 and var3 are strings.
How can I write the variable names without Python including them as part of the query text?
'''

Instruction Eliminator

对于第一步演化生成的指令,让LLM生成回复时,直接将生成的指令作为LLM的prompt输入就可以了。

以下四种情况会被判定为演化失败:

  1. 演化生成的指令相比之前的指令没有提供信息增益,使用chatGPT来作判断,使用的prompt如下:

    '''
    Here are two Instructions to ChatGPT AI, do you think they are equal to each other, which meet the following requirements:
    1. They have same constraints and requirments.
    2. They have same depth and breadth of the inquiry.
    The First Prompt: <Here is first instruction.>
    The Second Prompt: <Here is second instruction.>
    Your Judgement (Just answer: Equal or Not Equal. No need to explain the reason.):
    '''
    
  2. 演化生成的指令对于LLM生成回答很困难,如果LLM生成的回复中包括sorry或者长度很短(小于80个词),就认为LLM生成回答很困难。

  3. LLM生成的回答只包括标点符号和停用词

  4. 演化生成的指令明显是从prompt中复制过来一些词如“given prompt"、"rewritten prompt"等情形

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

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

相关文章

如何直接关闭使用3306端口的进程

要直接关闭使用3306端口的进程&#xff0c;你可以按照以下步骤进行操作(以关闭占领3306端口MySQL服务为例)&#xff1a; 获取占用3306端口的进程ID&#xff08;PID&#xff09;。在终端中执行以下命令&#xff1a; sudo lsof -i :3306查找输出中的进程ID&#xff08;PID&…

MyBatis-Plus自动填充

文章目录 一、前言二、MyBatis-Plus自动填充功能实现2.1、实体类上增加注解2.2、自定义填充类编写 一、前言 我们在建表的时候&#xff0c;所有的表都会有create_id&#xff08;创建人id&#xff09;、create_time&#xff08;创建时间&#xff09;、update_id&#xff08;更新…

2022.09.17【读书笔记】丨生物信息学与功能基因组学(第十三章 蛋白质结构预测 下)

目录 蛋白质结构预测三种方法同源建模(比较建模)穿线法从头预测&#xff08;ab initio&#xff09;基于假设推荐策略 精度与方法选择Alphafold2相关信息 蛋白质结构预测 三种方法 同源建模(比较建模) 建模4步骤 1.模板选择和确定折叠构象 通过blast或delta-blast搜索同源蛋白…

8 个线程池最佳实践和坑!使用不当直接生产事故!!

这篇文章我会简单总结一下我了解的使用线程池的时候应该注意的坑以及一些优秀的实践。拿来即用&#xff0c;美滋滋&#xff01; 1、正确声明线程池 线程池必须手动通过 ThreadPoolExecutor 的构造函数来声明&#xff0c;避免使用Executors 类创建线程池&#xff0c;会有 OOM …

华为鸿蒙HarmonyOS4发布即巅峰,车机系统、多模态交互等实现突破

7 月 27 日最新消息&#xff0c;华为将于8月4日推出全新鸿蒙HarmonyOS 4.0&#xff0c;届时华为开发者大会也一并举行。 根据证券日报的报道&#xff0c;华为有关负责人在7月27日向媒体确认了以下消息。华为鸿蒙4.0将在汽车娱乐系统、多模态交互等领域实现重大突破&#xff0c;…

@Conditional

Conditional Conditional 是 spring framework 中提供的一个条件注解&#xff0c;&#xff0c;满足条件就注入&#xff0c;不满足就不注入ioc Condtional 需要和 Condition接口 一起用&#xff1a; 返回true注入&#xff0c;返回false不注入&#xff0c;&#xff0c; 里面有一…

灵雀云Alauda MLOps 现已支持 Meta LLaMA 2 全系列模型

在人工智能和机器学习领域&#xff0c;语言模型的发展一直是企业关注的焦点。然而&#xff0c;由于硬件成本和资源需求的挑战&#xff0c;许多企业在应用大模型时仍然面临着一定的困难。为了帮助企业更好地应对上述挑战&#xff0c;灵雀云于近日宣布&#xff0c;企业可通过Alau…

《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(7)-Fiddler状态面板-QuickExec命令行

1.简介 Fiddler成了网页调试必备的工具&#xff0c;抓包看数据。Fiddler自带命令行控制&#xff0c;并提供以下用法。Fiddler的快捷命令框让你快速的输入脚本命令。 除了输入默认命令&#xff0c;也可以自定义命令&#xff0c;你可以通过编辑 FiddlerScript 来增加新命令&…

mysql(四)数据备份

目录 前言 一、概述 二、备份的类型 &#xff08;一&#xff09;物理与逻辑角度 &#xff08;二&#xff09;数据库备份策略角度 三、常见的备份方法 四、完整备份 &#xff08;一&#xff09;打包数据库文件备份 &#xff08;二&#xff09;备份工具备份 五、增量备份 六、操…

文旅数字化营销系统怎么做?文旅营销系统有什么优势?

文旅行业和数字经济的融合&#xff0c;让数字化文旅成为推动行业升级迭代、赋能行业增速的重要推手。如何顺应数字化时代下新的发展趋势&#xff0c;结合数字化文旅数字化营销系统扩大行业影响力&#xff0c;从而推动文旅行业商业营销落地模式的更新和变化&#xff1f; 开利网络…

自动化运维工具—Ansible概述

Ansible是什么&#xff1f; Ansible是一个基于Python开发的配置管理和应用部署工具&#xff0c;现在也在自动化管理领域大放异彩。它融合了众多老牌运维工具的优点&#xff0c;Pubbet和Saltstack能实现的功能&#xff0c;Ansible基本上都可以实现。 Ansible能批量配置、部署、…

智慧园区变电所运维云平台解决方案

1、概述 变电所运维云平台可以看做是电力监控系统的网络应用延伸&#xff0c;变电所运维云平台通过互联网&#xff0c;电力运维人员通过手机可以随时随地了解园区配电系统的运行情况&#xff0c;做到无人值守或者少人值守&#xff0c;同时可以监测用能状况、漏电、线缆异常发热…

手把手一起使用WPF MVVM制作USB调试助手Demo

1、USB调试助手Demo 该Demo使用WPF框架&#xff0c;基于MVVM设计模式&#xff0c;实现USB调试助手&#xff0c;效果如图所示&#xff1a; 实现功能&#xff1a;上位机(USB调试助手)与下位机(ZYNQ)通过USB通信&#xff0c;实现收发数据 实验环境&#xff1a;Visual Studio 2022…

在线帮助文档——帮助客户快速了解您的产品如何使用

当新接触到一个产品或者软件&#xff0c;在使用上遇到问题时&#xff0c;以往第一件事就是给咨询客服人员或者打电话等形式&#xff0c;每天客服人员都需要回答很多同样的问题&#xff0c;长期下去&#xff0c;客服人员压力大&#xff0c;离职率高&#xff0c;并且人工客服在这…

瓴羊Quick BI:可视化大屏界面设计满足企业个性需求

大数据技术成为现阶段企业缩短与竞争对手之间差距的重要抓手&#xff0c;依托以瓴羊Quick BI为代表的工具开展内部数据处理分析工作&#xff0c;也成为诸多企业持续获取竞争优势的必由之路。早年间国内企业倾向于使用进口BI工具&#xff0c;但随着瓴羊Quick BI等一众国内数据处…

从零开始学习CTF——CTF是什么

引言&#xff1a; 从2019年10月开始接触CTF&#xff0c;学习了sql注入、文件包含等web知识点&#xff0c;但都是只知道知识点却实用不上&#xff0c;后来在刷CTF题才发现知识点的使用方法&#xff0c;知道在哪里使用&#xff0c;哪里容易出漏洞&#xff0c;可是在挖src漏洞中还…

勘探开发人工智能应用:测井岩相识别

1 测井岩相识别 1.1 简介 岩相识别是最基础的工作,能够获得地层岩石物理特性的直观认识,进而帮助实时钻井、地质评价和储层建模。 地球物理测井使用特定的设备,观测井眼内不同深度地层的声学特性、电学特性、放射性、热力学特性等地球物理特性。通过确定地球物理测井采集的…

前端面试题 —— Vue (二)

目录 一、过滤器的作用&#xff0c;如何实现一个过滤器 二、v-model 是如何实现的&#xff0c;语法糖实际是什么&#xff1f; 三、$nextTick 原理及作用 四、Vue 中给 data 中的对象属性添加一个新的属性时会发生什么&#xff1f;如何解决&#xff1f; 五、简述 mixin、ex…

【C++进阶】:多态

多态 一.概念二.多态的定义和实现1.简单使用2.虚函数重写的两个例外1.协变2.析构函数的重写 3. C11 override 和 final4.重载&#xff0c;重定义&#xff0c;重写对比 三.多态的原理1.虚函数表2.总结3.静态绑定和动态绑定 四.单继承和多继承1.单继承2.多继承1.多继承的虚表2.多…

【代码随想录day21】二叉树的最近公共祖先

题目 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为&#xff1a;“对于有根树 T 的两个节点 p、q&#xff0c;最近公共祖先表示为一个节点 x&#xff0c;满足 x 是 p、q 的祖先且 x 的深度尽可能大&#xff08;一个节点也可以是它…