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