Stablebeluga2
基于Llama2 70B模型微调的大型语言模型,采用Orca风格数据集训练,擅长执行复杂指令
下载量 1.3M
发布时间 : 8/12/2023
模型简介
稳定白鲸2是一个经过指令微调的大型语言模型,专注于提供安全可靠的文本生成能力,适用于各种对话和创作任务
模型特点
高效权重存储
采用bfloat16格式存储权重,文件大小缩小2倍,同时保持高质量输出
分片存储设计
权重按transformer块分片存储,优化下载和使用效率
安全格式
使用Safetensors替代Pickle,实现更快的加载速度和更低的内存需求
指令跟随能力
经过Orca风格数据集微调,擅长理解和执行复杂指令
模型能力
文本生成
对话系统
创意写作
指令执行
使用案例
内容创作
诗歌创作
根据用户主题生成诗歌
生成符合主题的创意诗歌
故事写作
根据提示编写短篇故事
生成连贯有趣的故事内容
对话系统
智能助手
提供信息查询和任务协助
准确回答用户问题并提供帮助
🚀 Stable Beluga 2
Stable Beluga 2是基于Llama2 70B模型微调的自回归语言模型,适用于文本生成任务。本仓库对原模型进行了优化,在存储和加载方面有更好的表现。
🚀 快速开始
使用以下代码片段开始与 Stable Beluga 2
进行对话:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("stabilityai/StableBeluga2", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("stabilityai/StableBeluga2", torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
system_prompt = "### System:\nYou are Stable Beluga, an AI that follows instructions extremely well. Help as much as you can. Remember, be safe, and don't do anything illegal.\n\n"
message = "Write me a poem please"
prompt = f"{system_prompt}### User: {message}\n\n### Assistant:\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=256)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Stable Beluga 2
应使用以下提示格式:
### System:
This is a system prompt, please behave and help the user.
### User:
Your prompt here
### Assistant:
The output of Stable Beluga 2
✨ 主要特性
本仓库包含来自 stabilityai/StableBeluga2 仓库的模型,并进行了以下更改:
- 以
bfloat16
而非float32
存储权重:这使得文件大小缩小了2倍,同时会有轻微的质量损失,但与Petals默认使用的NF4量化所导致的损失相比,并不显著。 - 以小分片形式存储权重:每个Transformer块存储在其自己的分片中(每个1.71 GB)。输入和输出嵌入以及相邻的层归一化也存储在单独的分片中(1.05 GB)。这样,Petals客户端和服务器无需下载除实际使用的层之外的任何多余数据。
- 使用 Safetensors 而非Pickle:这允许更快的加载速度和更低的内存要求。
📚 详细文档
模型描述
Stable Beluga 2
是在Llama2 70B模型基础上,针对Orca风格数据集进行微调的模型。
模型详情
属性 | 详情 |
---|---|
开发者 | Stability AI |
模型类型 | 基于Llama2 70B微调的自回归语言模型 |
语言 | 英语 |
库 | HuggingFace Transformers |
许可证 | 微调后的检查点 (Stable Beluga 2 ) 遵循 STABLE BELUGA NON-COMMERCIAL COMMUNITY LICENSE AGREEMENT |
联系方式 | 如有关于模型的问题和建议,请发送邮件至 lm@stability.ai |
训练数据集
Stable Beluga 2
在内部的Orca风格数据集上进行训练。
训练过程
模型通过在上述数据集上进行监督微调进行学习,采用混合精度(BF16)训练,并使用AdamW进行优化。以下是相关超参数:
数据集 | 批量大小 | 学习率 | 学习率衰减 | 预热步数 | 权重衰减 | 贝塔值 |
---|---|---|---|---|---|---|
Orca pt1 packed | 256 | 3e-5 | 余弦衰减至3e-6 | 100 | 1e-6 | (0.9, 0.95) |
Orca pt2 unpacked | 512 | 3e-5 | 余弦衰减至3e-6 | 100 | 1e-6 | (0.9, 0.95) |
伦理考量与局限性
Beluga是一项新技术,使用时存在风险。到目前为止的测试仅使用英语进行,且无法涵盖所有场景。因此,与所有大语言模型一样,Beluga的潜在输出无法提前预测,在某些情况下,模型可能会对用户提示产生不准确、有偏见或其他令人反感的响应。因此,在部署Beluga的任何应用之前,开发人员应针对其特定应用对模型进行安全测试和调整。
引用方式
@misc{StableBelugaModels,
url={[https://huggingface.co/stabilityai/StableBeluga2](https://huggingface.co/stabilityai/StableBeluga2)},
title={Stable Beluga models},
author={Mahan, Dakota and Carlow, Ryan and Castricato, Louis and Cooper, Nathan and Laforte, Christian}
}
参考文献
@misc{touvron2023llama,
title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
year={2023},
eprint={2307.09288},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{mukherjee2023orca,
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
year={2023},
eprint={2306.02707},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
其他Beluga模型
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