Text-to-SQL小白入门(四)指令进化大模型WizardLM
摘要
本文主要对大模型WizardLM的基本信息进行了简单介绍,展示了WizardLM取得的优秀性能,分析了论文的核心——指令进化方法。
论文概述
基本信息
- 英文标题:WizardLM: Empowering Large Language Models to Follow Complex Instructions
- 中文标题:WizardLM:授权大型语言模型遵循复杂的指令
- 发表时间:2023年4月-arxiv
- 作者单位:北京大学 & 微软
- 论文链接:https://arxiv.org/abs/2304.12244
- 代码链接:GitHub - nlpxucan/WizardLM: Family of instruction-following LLMs powered by Evol-Instruct: WizardLM, WizardCoder and WizardMath
摘要
- 论文展示了使用LLM而不是人工来创建具有不同复杂程度的大量指令数据的途径。
- 从一组初始指令开始,通过进化指令逐步将它们重写为更复杂的指令。然后,将生成的所有指令数据进行混合来微调LLaMA。
- 论文将生成的模型称为WizardLM。
- 在复杂平衡测试平台和Vicuna测试集上的人类评估表明,来自evolution - instruct的指令优于人类创造的指令。
- 通过分析高复杂性部分的人工评估结果,论文证明了WizardLM模型的输出比OpenAI,ChatGPT的输出更受欢迎。在GPT-4自动评估中,WizardLM在29项技能中的17项达到了ChatGPT 90%以上的能力
WizardLM模型性能优越,可以作为text2sql的基座模型,github上有个DB-GPT-Hub项目开源了大模型微调text2sql的pipline,模型支持也有WizardLM模型(这是DB-GPT项目的子项目),其中提供了数据集下载-数据集预处理-模型下载-模型微调-模型权重合并-模型预测-模型评估,如果没有GPU可以使用AutoDL平台按需使用。
- DB-GPT项目:目前已有6.4k star,可以关注一波,目前该项目最新版本——DB-GPT V0.3.7 发布,支持用自然语言分析和查询Excel表格数据
- DB-GPT_Hub项目:目前有200多star,专注于text2sql大模型微调领域,大家也可以去贡献代码,比如模型支持里面也有WizardLM。
WizardLM模型的思想值得借鉴,后面还有模型Code Llama更加出色,后面再介绍。
结果
收集测试集
- 网上收集的指令测试集:总共218个例子,分成了29项类别,比如有数学math、代码生成、写作等等。
- 图3a说明了测试集中实例和技能的分布。测试集由218个实例组成,每个实例都是针对特定技能的指令。
- 图3b比较了和Vicuna小羊驼、Alpaca羊驼
人工打分评估
为了评估WizardLM,在evolution - directive测试集上进行了人类评估。我们在WizardLM和基线之间进行盲两两比较。具体来说,招募了10名受过良好教育的注释员。对于每个注释者,提供了来自Alpaca、Vicuna-7b、WizardLM和ChatGPT的四个响应,这些响应被随机打乱以隐藏其来源。然后评注者根据附录h中的标准判断哪一个回答更好,然后他们应该将四个回答从1到5进行排序(1表示最好),并允许同等分数的可比较实例。
- 比如图4a中Evol-Instruct testset数据集上,跟ChatGPT相比,WizardLM赢了61次,ChatGPT赢了89次,平局68次。(总共218)
GPT4自动评估
- 如图5a和5b所示,WizardLM-78.0%在evolo-instruct测试集上的性能明显优于Alpaca-7B-71.8%和Vicuna-7B-72.2%(分别优于Alpaca-7B和Vicuna-7B的性能6.2%和5.8%)
- 图6比较了WizardLM和ChatGPT在evolution - directive测试集上的技能水平。结果表明,WizardLM的平均性能达到了ChatGPT的78%,17项技能的容量几乎超过了90%。然而,WizardLM在代码、数学和推理场景方面遇到了困难,显示出与ChatGPT的明显差距。(所以后面有WizardCoder)
结论
本文提出了一种进化算法——evolution-directive,用于生成多种复杂的LLM指令数据。论文证明提出的方法提高了LLM的性能,WizardLM,在高复杂性任务上取得了最先进的结果,在其他指标上取得了具有竞争力的结果。
局限性(评估方法):本文承认我们的自动GPT-4和人工评估方法的局限性。这种方法对可扩展性和可靠性提出了挑战。此外,我们的测试集可能无法代表LLM可以应用或与其他方法进行比较的所有场景或领域。
更广泛的影响。evolo - instruct可以提高LLM在各个领域和应用中的性能和交互性,但它也可能产生不道德、有害或误导性的指令。因此,我们敦促未来对人工智能进化指令的研究,以解决伦理和社会影响。
核心思想
这个图看着还挺有意思的
很简约
图形化很不错
只不过作为模型核心结构会有点懵
instruction data evolution指令数据演化
输入指令I1-instruction,通过LLM得到答复R1-response
输入指令I2-instruction,通过LLM得到答复R2-response
不断迭代
指令I1如何更新为指令2?
- 通过LLM instruction evolution prompt 指令进化提示词
instruction evolution prompt是什么?
- 参考下方的指令进化器
Automatic Instruction Data Evolution自动指令数据演化
pipline 分成3个部分:
- 1)指令进化
- 2)响应生成
- 3)消除进化,即过滤无法进化的指令。
指令进化instruction evolution
作者发现LLM可以使用特定的提示使给定的指令变得更加复杂和困难。此外,它们可以生成同样复杂但完全不同的全新指令。
利用这一发现,我们可以迭代地进化一个初始指令数据集,提高难度水平,扩大其丰富性和多样性。
1.用给定的初始指令数据集D(0)初始化指令池。
2.在每个进化时期,从前一个时期升级的指令从池中取出。
3.然后利用指令进化器instruction evolver来进化每条获取到的指令,并利用指令消除器instruction eliminator来检查是否存在进化失败的指令。
- 成功进化的指令被添加到池中
- 不成功的指令被放回原处,希望在下一个进化时期成功升级它们。
指令进化器instruction evolver
指令进化器是一种LLM,它使用提示来进化指令,有两种类型:深度进化和广度进化。
深度进化
深度进化通过五种类型的提示来增强指令的复杂性和难度:
- 添加约束
- 使得深度化
- 使得具体化
- 增加推理步骤
- 使输入变得复杂化。
举例子:
- 这是添加约束add contraints:
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深化:
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 Pormpt:
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:
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.
You must add [XML data] format data as input data in [Rewritten Prompt]
#Given Prompt#:
<Here is Demonstration instruction 1.>
#Rewritten Prompt#:
<Here is Demonstration Example 1.>
... N -1 Examples ...
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.
You must add [#Given Dataformat#] format data as input data, add [#Given Dataformat#] code as input code in [Rewritten Prompt]
Rewrite prompt must be a question style instruction
#Given Prompt#:
<Here is instruction.>
#Rewrite prompt must be a question style instruction Rewritten Prompt(MUST contain a specific JSON data as input#:
广度进化
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#:
生成response
- 使用与进化相同的LLM来为进化的指令生成相应的响应。生成提示符是" <Here is instruction.> "。
消除进化
有以下4种情况归类为失败:
- 指令进化失败;与原始指令相比,进化后的指令没有提供任何信息增益。我们使用ChatGPT进行此确定。
- 进化的指令使得LLM很难产生响应。我们发现,当生成的响应包含“sorry”并且长度相对较短(即少于80个单词)时,它通常表明LLM努力响应进化的指令。所以我们可以用这个规则来做判断。
- LLM生成的响应只包含标点和停止词。
- 进化指令显然从进化提示中复制了一些单词,如“给定提示”、“重写提示”、“#重写提示#”等。
baseline
- ChatGPT
-
- OpenAI
- AI bot
- 基于GPT-3.5 or GPT-4
- Alapaca
-
- 开源模型,基于LLaMA
- 斯坦福大学Standford University
- Vicuna
-
- 开源的chat bot
- 基于LLaMA
参考文献
WizardLM论文:https://arxiv.org/abs/2304.12244
DB-GPT项目:https://github.com/eosphoros-ai/DB-GPT/blob/main/README.zh.md
DB-GPT-Hub项目:GitHub - eosphoros-ai/DB-GPT-Hub: A repository that contains models, datasets, and fine-tuning techniques for DB-GPT, with the purpose of enhancing model performance, especially in Text-to-SQL.
相关文章:

Text-to-SQL小白入门(四)指令进化大模型WizardLM
摘要 本文主要对大模型WizardLM的基本信息进行了简单介绍,展示了WizardLM取得的优秀性能,分析了论文的核心——指令进化方法。 论文概述 基本信息 英文标题:WizardLM: Empowering Large Language Models to Follow Complex Instructions中…...

浅谈红队资产信息收集经验
文章目录 子公司资产收集备案号|官网收集子域名|ip收集fofa灯塔ARLX情报社区 资产确认目录扫描Google Hacking绕过CDNnmap端口扫描参数技巧其他常用工具 子公司资产收集 红蓝对抗中往往只会给你目标企业的名称,以及对应的靶标系统地址,而很少有直接从靶标…...

list根据对象中某个字段属性去重Java流实现
list根据对象中某个字段属性去重Java流实现? 在Java的流(Stream)中,你可以使用distinct方法来实现根据对象中某个字段属性去重的功能。要实现这个功能,你需要重写对象的hashCode和equals方法,以确保相同字段属性的对象被认为是相…...

软件架构设计(三) B/S架构风格-层次架构(一)
层次架构风格从之前的两层C/S到三层C/S,然后演化为三层B/S架构,三层B/S架构之后仍然在往后面演化,我们来看一下层次架构演化过程中都有了哪些演化的架构风格呢? 而我们先简单了解一下之前的层次架构风格中分层的各个层次的作用。 表现层:由于用户进行交互,比如MVC,MVP,…...
大端字节和小端字节
介绍 大端字节序(Big-Endian)和小端字节序(Little-Endian)是在计算机系统中用来表示多字节数据类型(如整数、浮点数等)的存储方式。字节序指的是在内存中多字节数据的存放顺序,即哪个字节在前&…...

(10)(10.8) 固件下载
文章目录 前言 10.8.1 固件 10.8.2 Bootloader 10.8.3 APM2.x Autopilot 10.8.4 许可证 10.8.5 安全 前言 固件服务器(firmware server)可提供所有飞行器的最新固件。其中包括: CopterPlaneRoverAntennaTrackerSub 本页提供了一些被视为&quo…...

vue实现列表自动滚动效果
效果如图: 1.下载插件 npm install vue-seamless-scroll --save 2.在main.js中引入注册 import scroll from vue-seamless-scroll Vue.use(scroll) 3.在页面中使用(写一个固定的表头 el-table:show-header"status" 设置为false,自带的表头不…...
如何通过构建遥感光谱反射信号与地表参数之间的关系模型来准确估算植被参数?植被参数光学遥感反演方法(Python)及遥感与生态模型数据同化算法
目录 专题一 植被参数遥感反演理论 专题二 植被叶片及冠层反射率模拟与处理 专题三 植被遥感模型参数敏感性分析 专题四 基于查找表(LUT)方法反演植被参数 专题五 基于优化算法反演植被参数 专题六 基于机器学习反演植被参数 专题七 遥感数据同化理论 专题八 同化遥感反…...

持续集成与持续交付(CI/CD):探讨在云计算中实现快速软件交付的最佳实践
文章目录 持续集成(CI)的最佳实践持续交付(CD)的最佳实践云计算环境下的特别注意事项 🎈个人主页:程序员 小侯 🎐CSDN新晋作者 🎉欢迎 👍点赞✍评论⭐收藏 ✨收录专栏&am…...

【LeetCode题目详解】第九章 动态规划part02 62.不同路径 63. 不同路径 II day39补
本文章代码以c为例! 一、力扣第62题:不同路径 题目: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为 “Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(…...

四维轻云助力在线管理、展示及分享多种地理空间数据
《四维轻云》是一款轻量化的地理空间数据管理云平台,支持倾斜摄影模型、激光点云、数字高程模型及正射影像等多种地理空间数据的在线管理、展示及分享。目前,平台有项目管理、数据上传、场景搭建、发布分享、素材库等功能模块,支持多人在线协…...
CMake 学习笔记
一直想了解CMake,但是不知从何入门。最近看了CMake 官方的Tutorial,感觉的确很适合入门。 首先要安装CMake, 安装步骤: 直接去下载最新版Download | CMakemacos 点开CMake 后,遵循“How to Install For Command Line Use” 菜单项࿰…...

docker高级(DockerFile解析)
1、构建三步骤 编写Dockerfile文件 docker build命令构建镜像 docker run依镜像运行容器实例 2、DockerFile构建过程解析 Dockerfile内容基础知识 1:每条保留字指令都必须为大写字母且后面要跟随至少一个参数 2:指令按照从上到下,顺序执行…...
抽象类实现接口的意义
文章目录 前言一、抽象类和接口对比二、举例说明三种情况1.接口实现类接口 2.抽象类实现类抽象类实现类(子类) 3.抽象类实现接口接口抽象类三个实现类 总结 前言 抽象类和接口其实都是抽象的一种,那么他俩有何异同呢? 抽象类实现接口的意义何在? 一、抽象类和接口对比 接口…...

什么是接口测试,如何做接口测试?
比起点点点的功能测试,“接口测试”显得专业又高大上,也因此让有些初级测试人员“望而生畏”。别担心,其实接口测试也是功能测试的一种,它是针对接口进行的功能测试。 写在前面:本文参考了茹炳晟老师的《测试工程师 全…...

Keil 编译 Debug
# 头文件无法导入进来 # 导入头文件,只有函数声明,但缺少函数实现 已经导入了air32f10x_gpio.h但是没有导入 .c,就导致 编译出错出现undefined symbol (某个函数),这时候按照下面的操作,导入外设模块就好。...

【通用消息通知服务】0x3 - 发送我们第一条消息(Websocket)
【通用消息通知服务】0x3 - 发送我们第一条消息 项目地址: A generic message notification system[Github] 实现接收/发送Websocket消息 Websocket Connection Pool import asyncio from asyncio.queues import Queue from asyncio.queues import QueueEmpty from contextli…...

Eclipse打jar包与JavaDOC文档的生成
补充知识点——Eclipse打jar包与JavaDOC文档的生成 1、Eclipse如何打jar包,如何运行jar包 Java当中编写的Java代码,Java类、方法、接口这些东西就是项目中相关内容,到时候我们需要把代码提供给甲方、或者是我们需要运行我们编写的代码&…...
力扣:80. 删除有序数组中的重复项 II(Python3)
题目: 给你一个有序数组 nums ,请你 原地 删除重复出现的元素,使得出现次数超过两次的元素只出现两次 ,返回删除后数组的新长度。 不要使用额外的数组空间,你必须在 原地 修改输入数组 并在使用 O(1) 额外空间的条件下…...
linux:需要注意docker和aws的rds的mysql默认是UTC而不是中国时区
问题: 如题 解决办法: docker参考: mysql时间不对,修改时区_set global time_zone 无效_《小书生》的博客-CSDN博客 aws参考: https://www.youtube.com/watch?vB-NaqV-A1BY mysql - AWS修改RDS时区 - 个人文章 - Segm…...
GitHub 趋势日报 (2025年06月08日)
📊 由 TrendForge 系统生成 | 🌐 https://trendforge.devlive.org/ 🌐 本日报中的项目描述已自动翻译为中文 📈 今日获星趋势图 今日获星趋势图 884 cognee 566 dify 414 HumanSystemOptimization 414 omni-tools 321 note-gen …...
06 Deep learning神经网络编程基础 激活函数 --吴恩达
深度学习激活函数详解 一、核心作用 引入非线性:使神经网络可学习复杂模式控制输出范围:如Sigmoid将输出限制在(0,1)梯度传递:影响反向传播的稳定性二、常见类型及数学表达 Sigmoid σ ( x ) = 1 1 +...
2023赣州旅游投资集团
单选题 1.“不登高山,不知天之高也;不临深溪,不知地之厚也。”这句话说明_____。 A、人的意识具有创造性 B、人的认识是独立于实践之外的 C、实践在认识过程中具有决定作用 D、人的一切知识都是从直接经验中获得的 参考答案: C 本题解…...
【Go语言基础【12】】指针:声明、取地址、解引用
文章目录 零、概述:指针 vs. 引用(类比其他语言)一、指针基础概念二、指针声明与初始化三、指针操作符1. &:取地址(拿到内存地址)2. *:解引用(拿到值) 四、空指针&am…...

iview框架主题色的应用
1.下载 less要使用3.0.0以下的版本 npm install less2.7.3 npm install less-loader4.0.52./src/config/theme.js文件 module.exports {yellow: {theme-color: #FDCE04},blue: {theme-color: #547CE7} }在sass中使用theme配置的颜色主题,无需引入,直接可…...

【Linux系统】Linux环境变量:系统配置的隐形指挥官
。# Linux系列 文章目录 前言一、环境变量的概念二、常见的环境变量三、环境变量特点及其相关指令3.1 环境变量的全局性3.2、环境变量的生命周期 四、环境变量的组织方式五、C语言对环境变量的操作5.1 设置环境变量:setenv5.2 删除环境变量:unsetenv5.3 遍历所有环境…...

wpf在image控件上快速显示内存图像
wpf在image控件上快速显示内存图像https://www.cnblogs.com/haodafeng/p/10431387.html 如果你在寻找能够快速在image控件刷新大图像(比如分辨率3000*3000的图像)的办法,尤其是想把内存中的裸数据(只有图像的数据,不包…...

算法打卡第18天
从中序与后序遍历序列构造二叉树 (力扣106题) 给定两个整数数组 inorder 和 postorder ,其中 inorder 是二叉树的中序遍历, postorder 是同一棵树的后序遍历,请你构造并返回这颗 二叉树 。 示例 1: 输入:inorder [9,3,15,20,7…...

【免费数据】2005-2019年我国272个地级市的旅游竞争力多指标数据(33个指标)
旅游业是一个城市的重要产业构成。旅游竞争力是一个城市竞争力的重要构成部分。一个城市的旅游竞争力反映了其在旅游市场竞争中的比较优势。 今日我们分享的是2005-2019年我国272个地级市的旅游竞争力多指标数据!该数据集源自2025年4月发表于《地理学报》的论文成果…...

【汇编逆向系列】六、函数调用包含多个参数之多个整型-参数压栈顺序,rcx,rdx,r8,r9寄存器
从本章节开始,进入到函数有多个参数的情况,前面几个章节中介绍了整型和浮点型使用了不同的寄存器在进行函数传参,ECX是整型的第一个参数的寄存器,那么多个参数的情况下函数如何传参,下面展开介绍参数为整型时候的几种情…...