Airoboros Gpt 3.5 Turbo 100k 7b
基于10万条GPT-3.5-turbo生成的指令/响应对微调的70亿参数模型,性能接近13B模型
下载量 217
发布时间 : 5/12/2023
模型简介
这是一个70亿参数的指令调优模型,完全使用机器生成的合成数据进行微调,适用于各种自然语言处理任务但不适合聊天场景。
模型特点
合成数据训练
完全使用GPT-3.5-turbo生成的10万条指令/响应对进行微调
小模型高性能
7B参数模型在多项基准测试中表现接近13B参数模型
开源工具链
配套的提示生成工具airoboros完全开源且高度可定制
模型能力
文本生成
指令跟随
邮件撰写
创意写作
技术问答
使用案例
商业沟通
产品发布邮件
生成专业的产品发布公告邮件
评估得分91/100(对比GPT-3.5得分为95)
客户道歉信
起草订单延迟的道歉邮件
评估得分91/100(对比GPT-3.5得分为94)
创意写作
科幻叙事
以未来人视角描述公元3000年的技术进步
评估得分85/100
角色扮演
模拟海盗船长激励船员寻找宝藏的演讲
评估得分85/100
🚀 airoboros-gpt-3.5-turbo-100k-7b
本项目是一个基于70亿参数的模型,在由gpt-3.5-turbo使用我开发的 airoboros 版本的自指令方法生成的10万个合成指令/响应对上进行了微调。该模型的上下文长度为2048。
🚀 快速开始
本仓库中的内容较旧,使用的是旧的提示格式,你可以查看 airoboros-13b。
✨ 主要特性
- 基于70亿参数,在大量合成指令/响应对上微调。
- 上下文长度达2048。
- 与130亿参数的模型相比,表现良好。
📦 安装指南
文档未提供安装相关内容,暂不展示安装指南。
💻 使用示例
基础用法
使用此模型最简单的方法是通过fastchat:
python -m fastchat.serve.cli --model-path ./airoboros-gpt-3.5-turbo-100k-7b --temperature 1.0
高级用法
以下是一个使用示例,展示如何使用该模型生成一封介绍新指令微调AI模型 airoboros 的邮件:
Human: Write an email introducing a new instruction-tuned AI model named airoboros. The key features about airoboros are: 1. it was fine-tuned with entirely machine-generated synthetic instruction/response pairs 2. the 7 billion parameter model performs very well in comparison to 13b models 3. the synthetic prompt generation tool is free, open-source, and highly customizable.
Assistant: Subject: Introducing airoboros - a new instruction-tuned AI model
Dear [Recipient],
I am excited to introduce a new instruction-tuned AI model named airoboros. This model was developed by our team with the aim of providing high-quality natural language processing capabilities at scale.
airoboros is a 7 billion parameter model that was fine-tuned with entirely machine-generated synthetic instruction/response pairs. This approach allowed us to achieve state-of-the-art performance in various NLP tasks such as question answering, sentiment analysis, and machine translation. In fact, when compared to other popular 13b models, airoboros performed better on several benchmarks.
Moreover, airoboros's synthetic prompt generation tool is free, open-source, and highly customizable. This means that developers can easily integrate our model into their applications without having to worry about licensing fees or restrictions.
We believe that airoboros will be an excellent addition to your workflow and hope you find it useful. If you have any questions or concerns, please do not hesitate to contact us.
Best regards,
[Your Name]
[Your Company Name]
⚠️ 重要提示
这是一个指令微调模型,不太适合用于聊天。
📚 详细文档
提示生成
airoboros generate-instructions --instruction-count 100000 --concurrency 100 --temperature 1.0
微调
将 instructions.jsonl 文件转换为 FastChat 训练脚本所需的对话风格,然后使用以下命令进行训练:
torchrun --nproc_per_node=8 --master_port=20001 train_mem.py \
--model_name_or_path /workspace/llama-7b-hf \
--data_path ./as_conversations.json \
--bf16 True \
--output_dir /workspace/airoboros-gpt-3.5-100k-7b \
--num_train_epochs 3 \
--per_device_train_batch_size 4 \
--per_device_eval_batch_size 32 \
--gradient_accumulation_steps 4 \
--evaluation_strategy "steps" \
--eval_steps 1500 \
--save_strategy "steps" \
--save_steps 1500 \
--save_total_limit 8 \
--learning_rate 2e-5 \
--weight_decay 0. \
--warmup_ratio 0.04 \
--lr_scheduler_type "cosine" \
--logging_steps 1 \
--fsdp "full_shard auto_wrap offload" \
--fsdp_transformer_layer_cls_to_wrap 'LlamaDecoderLayer' \
--tf32 True \
--model_max_length 2048 \
--gradient_checkpointing True \
--lazy_preprocess True
在8块英伟达A100 80GB GPU上训练大约需要22小时。
转换为对话风格的代码如下:
import json
import uuid
inputs = [json.loads(line) for line in open("instructions.jsonl").readlines()]
conversations = []
for row in inputs:
inputs = row['instruction']
conversations.append({
"id": str(uuid.uuid4()),
"conversations": [
{
"from": "human",
"value": inputs,
},
{
"from": "gpt",
"value": row['response']
},
],
})
with open("as_conversations.json", "w") as outfile:
outfile.write(json.dumps(conversations, indent=2))
评估
我使用了 WizardVicunaLM 中的相同问题进行评估:
指令 | gpt3.5 | wizard-vicuna-13b | vicuna-13b | wizard-7b | airoboros-gpt-3.5-turbo-100k-7b |
---|---|---|---|---|---|
"撰写一封有说服力的产品发布公告邮件,向客户介绍我们的新软件解决方案。" | 95 | 92 | 89 | 90 | 91 |
"为一位订单延迟的客户撰写一封道歉邮件,并向其保证问题已解决。" | 94 | 96 | 90 | 89 | 91 |
"作为一名海盗船长,你会对船员说些什么来激励他们寻找隐藏的宝藏?" | 95 | 90 | 80 | 70 | 85 |
"假设你是来自3000年的时间旅行者,你会向人们介绍哪些技术进步?" | 95 | 92 | 90 | 88 | 85 |
"作为火星上的太空殖民者,描述你的日常生活以及在另一个星球上生活所面临的挑战。" | 95 | 90 | 87 | 85 | 88 |
"如何在不完全依赖作者或出版商声誉的情况下,评估信息来源(如新闻文章或博客帖子)的可信度?" | 93 | 85 | 89 | 87 | 90 |
"在社交场合中观察他人的行为如何能为了解文化规范和期望提供线索?" | 95 | 90 | 85 | 92 | 80 |
"全球每分钟发送多少条短信?请尝试解释你的答案,解释应逐步引导读者了解你的推理过程。" | 90 | 70 | 65 | 80 | 85 |
"Python和JavaScript编程语言的主要区别是什么?" | 90 | 85 | 80 | 88 | 82 |
"植物性和动物性蛋白质来源有哪些区别?" | 85 | 92 | 90 | 80 | 94 |
"描述一个可以使用人工智能来提高医疗服务质量和效率的场景。" | 95 | 90 | 92 | 89 | 91 |
"文化、社会和经济因素如何影响人们的食物选择,以及如何利用这些知识来促进更健康的饮食?" | 90 | 85 | 87 | 83 | 84 |
"地球上每天有多少个单词被说出?请尝试解释你的答案,解释应逐步引导读者了解你的推理过程。" | 90 | 70 | 80 | 75 | 65 |
"地球上每天发生多少次雷击?请尝试解释你的答案,解释应逐步引导读者了解你的推理过程。" | 90 | 80 | 60 | 70 | 85 |
如果以gpt-3.5为基线(与wizardvicuna/vicuna的做法相同),我们得到以下分数:
gpt3.5 | wizard-vicuna-13b | vicuna-13b | wizard-7b | airoboros-gpt-3.5-turbo-100k-7b |
---|---|---|---|---|
1.0 | 0.968421052631579 | 0.9368421052631579 | 0.9473684210526315 | 0.9578947368421052 |
1.0 | 1.0212765957446808 | 0.9574468085106383 | 0.9468085106382979 | 0.9680851063829787 |
1.0 | 0.9473684210526315 | 0.8421052631578947 | 0.7368421052631579 | 0.8947368421052632 |
1.0 | 0.968421052631579 | 0.9473684210526315 | 0.9263157894736842 | 0.8947368421052632 |
1.0 | 0.9473684210526315 | 0.9157894736842105 | 0.8947368421052632 | 0.9263157894736842 |
1.0 | 0.9139784946236559 | 0.956989247311828 | 0.9354838709677419 | 0.967741935483871 |
1.0 | 0.9473684210526315 | 0.8947368421052632 | 0.968421052631579 | 0.8421052631578947 |
1.0 | 0.7777777777777778 | 0.7222222222222222 | 0.8888888888888888 | 0.9444444444444444 |
1.0 | 0.9444444444444444 | 0.8888888888888888 | 0.9777777777777777 | 0.9111111111111111 |
1.0 | 1.0823529411764705 | 1.0588235294117647 | 0.9411764705882353 | 1.1058823529411765 |
1.0 | 0.9473684210526315 | 0.968421052631579 | 0.9368421052631579 | 0.9578947368421052 |
1.0 | 0.9444444444444444 | 0.9666666666666667 | 0.9222222222222223 | 0.9333333333333333 |
1.0 | 0.7777777777777778 | 0.8888888888888888 | 0.8333333333333334 | 0.7222222222222222 |
1.0 | 0.8888888888888888 | 0.6666666666666666 | 0.7777777777777778 | 0.9444444444444444 |
平均分数:
gpt3.5 1.000000
wizard-vicuna-13b 0.934090
vicuna-13b 0.900847
wizard-7b 0.902428
airoboros-gpt-3.5-turbo-100k-7b 0.926496
可以看出,70亿参数的 airoboros 模型表现出色,即使与130亿参数的模型相比也是如此。
🔧 技术细节
文档未提供技术细节相关内容,暂不展示技术细节。
📄 许可证
所有 airoboros 模型和数据集仅用于研究目的并获得相应许可。我使用了 'cc-nc-4.0' 许可证,但实际上它受自定义/特殊许可证的约束,原因如下:
- 基础模型是 LLaMa,它有自己的特殊研究许可证。
- 数据集是使用 OpenAI(gpt-4 和/或 gpt-3.5-turbo)生成的,OpenAI 有条款规定数据不能用于创建与 OpenAI 竞争的模型。
因此,再次强调:此模型(和数据集)不能用于商业用途。
Phi 2 GGUF
其他
Phi-2是微软开发的一个小型但强大的语言模型,具有27亿参数,专注于高效推理和高质量文本生成。
大型语言模型 支持多种语言
P
TheBloke
41.5M
205
Roberta Large
MIT
基于掩码语言建模目标预训练的大型英语语言模型,采用改进的BERT训练方法
大型语言模型 英语
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基础模型的蒸馏版本,在保持相近性能的同时更轻量高效,适用于序列分类、标记分类等自然语言处理任务。
大型语言模型 英语
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一个多语言大语言模型,针对多语言对话用例进行了优化,在常见的行业基准测试中表现优异。
大型语言模型 英语
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基于100种语言的2.5TB过滤CommonCrawl数据预训练的多语言模型,采用掩码语言建模目标进行训练。
大型语言模型 支持多种语言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基于Transformer架构的英语预训练模型,通过掩码语言建模目标在海量文本上训练,支持文本特征提取和下游任务微调
大型语言模型 英语
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI发布的开放预训练Transformer语言模型套件,参数量从1.25亿到1750亿,旨在对标GPT-3系列性能,同时促进大规模语言模型的开放研究。
大型语言模型 英语
O
facebook
6.3M
198
1
基于transformers库的预训练模型,适用于多种NLP任务
大型语言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多语言大语言模型系列,包含8B、70B和405B参数规模,支持8种语言和代码生成,优化了多语言对话场景。
大型语言模型
Transformers 支持多种语言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基础版是由Google开发的文本到文本转换Transformer模型,参数规模2.2亿,支持多语言NLP任务。
大型语言模型 支持多种语言
T
google-t5
5.4M
702
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98