[大数据][机器学习]之Model Card(模型卡片)介绍

每当我们在公有云或者私有云发布训练好的大数据模型,为了方便大家辨识、理解和运用,参照huggingface所制定的标准制作一个Model Card展示页,是种非常好的模型展示和组织形式。

下面就是一个Model Card 的示例,我试着把它翻译成了中文,源网址,并且提供了Markdown的模板,供大家参考。在这里你可以看到它的指导手册,以后有时间我也把它翻译过来。

Falcon-180B(猎鹰-180B)的模型卡片

模型详情

🚀 Falcon-180B

Falcon-180B是一个1800亿参数的因果解码器模型,它由TII(Technology Innovation Institut)公司研发,基于RefinedWeb增强的语料库,使用3万5千亿个Token进行训练。它提供了Falcon-180B TII License(猎鹰180 TII许可证)Acceptable Use Policy(使用条款).

论文将很快发布 😊

🤗 要开始使用Falcon(推理、微调、量化等),我们建议阅读 HF这篇伟大的博客 或者 这篇 Falcon-40B的发布版!

请注意因为180B大于transformers(转换)+acccelerate(加速)可以轻松处理的值, 我们建议使用Text Generation Inference(文本生成推断).

至少需要400GB内存 才能使用Falcon-180B快速进行推理.

为什么要使用Falcon-180B?

  • 它是目前可用的最好的开放访问模型,也是总体上最好的模型之一 Falcon-180B 性能上优于 LLaMA-2, StableLM, RedPajama, MPT, 等等. 请参阅 OpenLLM Leaderboard 排行榜.
  • 它的特点是具有多查询的推理优化架构, (Shazeer et al., 2019).
  • 它提供的许可证允许商业使用。
  • ⚠️ 这是一个原始的、经过预训练的模型,应该针对大多数用例进行进一步的微调。 如果您正在寻找一个更适合在聊天格式中使用通用指令的版本,我们建议您查看 Falcon-180B-Chat.

💸 想找一个更小、更便宜的模型吗? Falcon-7BFalcon-40B 是 Falcon-180B 的小兄弟!

💥 Falcon LLMs 需要 PyTorch 2.0 才能使用 transformers!

模型描述

模型源码

  • 代码: 即将发布.

使用条例

请查看 acceptable use policy.

直接使用

大型语言模型研究;作为进一步专业化和微调特定用例(例如,摘要、文本生成、聊天机器人等)的基础

超出范围的使用

没有对风险和mitigation(抱歉不知道这个词怎么翻译)进行充分评估就在生产环境中使用;任何可能被认为是不负责任或有害的用例。

偏见、风险和限制

Falcon-180B主要接受英语、德语、西班牙语和法语的训练,意大利语、葡萄牙语、波兰语、荷兰语、罗马尼亚语、捷克语和瑞典语的能力有限。它不会适当地推广到其他语言。此外,由于它是在代表网络的大规模语料库上进行训练的,它将携带网上常见的刻板印象和偏见。

建议

我们建议Falcon-180B的用户考虑对其进行微调,以适应感兴趣的特定任务集,并且在生产环境中使用界限和适当的预防措施。

如何开始使用模型

要完全以 bfloat16 精度运行模型您需要大约8张A100 80GB计算卡或者等效容量。

(以下是Python代码)

from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch

model = "tiiuae/falcon-180b"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
    device_map="auto",
)
sequences = pipeline(
   "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
    max_length=200,
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

训练详情

训练数据

训练 Falcon-180B 使用 3万5千亿个Token,使用 RefinedWeb, 一个高质量的过滤和消除重复的网络数据集。我们用策划的语料库进行了增强。我们精心策划的copora的重要组成部分受到The Pile的启发 (Gao et al., 2020).

数据集比例Tokens来源
RefinedWeb-English75%750B大量的网络爬虫数据
RefinedWeb-Europe7%70B来自欧洲的网络爬虫数据
Books 书籍6%60B
Conversations 会话5%50BReddit, StackOverflow, HackerNews
Code 代码5%50B
Technical 技术2%20BarXiv, PubMed, USPTO, etc.

RefinedWeb-欧洲 数据集由以下语言组成:

语言多语种的笔记Tokens
德语26%18B
西班牙语24%17B
法语23%16B
意大利语7%5B
葡萄牙语4%3B
波兰语4%3B
荷兰语4%3B
罗马尼亚语3%2B
捷克语3%2B
瑞典语2%1B

所有的数据由Falcon Token标记器进行Token化.

训练过程

Falcon-180B 使用4096块Tesla A100 40GB计算卡进行训练, 使用3D并行化策略(TP=8, PP=8, DP=64)与ZeRO相结合.

训练参数
超级参数备注
精度bfloat16
优化器AdamW
学习率1.25e-44B tokens warm-up, cosine decay to 1.25e-5
权重衰减1e-1
Z-loss1e-4
批处理大小2048100B tokens ramp-up
速度, 大小, 时间

训练于于2023年初开始。

评价

即将发布论文.

有关早期结果,请参阅 OpenLLM Leaderboard 排行榜。

技术规范

模型体系结构和目标

Falcon-180B 是在因果关系语言模型上建立的因果关系解码语言模型 (i.e., 预测下一个Token).

该体系架构广泛改编自GPT-3论文 (Brown et al., 2020), 并且有着以下几方面的不同:

对于多重查询,我们使用一个内部变量,该变量使用每个张量平行度的独立键和值(所谓的多组)。

超参数备注
层数80
d_model14848
head_dim64Reduced to optimise for FlashAttention
字典65024
序列长度2048

计算基础设施

硬件

Falcon-180B 在 AWS SageMaker 上训练, 使用 P4d 实例中多达 4,096 个 A100 40GB GPUs。

软件

Falcon-180B 是基于定制的分布式训练代码库 Gigatron 进行训练的。 它采用了 3D 并行方法,并结合了 ZeRO 和高性能的 Triton 内核(如 FlashAttention 等)。

引用

将很快推出 😊 (实际上这次). 同时,您可以使用以下信息进行引用:

@article{falcon,
  title={The Falcon Series of Language Models: Towards Open Frontier Models},
  author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Alhammadi, Maitha and Daniele, Mazzotta and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
  year={2023}
}

想要了解有关预训练数据集的更多信息, 请参阅 📓 RefinedWeb paper.

@article{refinedweb,
  title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
  author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
  journal={arXiv preprint arXiv:2306.01116},
  eprint={2306.01116},
  eprinttype = {arXiv},
  url={https://arxiv.org/abs/2306.01116},
  year={2023}
}

联系

falconllm@tii.ae

Model Card的模板

Model Card for {{ model_id | default(“Model ID”, true) }}

{{ model_summary | default(“”, true) }}

Model Details

Model Description

{{ model_description | default(“”, true) }}

  • Developed by: {{ developers | default(“[More Information Needed]”, true)}}
  • Funded by [optional]: {{ funded_by | default(“[More Information Needed]”, true)}}
  • Shared by [optional]: {{ shared_by | default(“[More Information Needed]”, true)}}
  • Model type: {{ model_type | default(“[More Information Needed]”, true)}}
  • Language(s) (NLP): {{ language | default(“[More Information Needed]”, true)}}
  • License: {{ license | default(“[More Information Needed]”, true)}}
  • Finetuned from model [optional]: {{ base_model | default(“[More Information Needed]”, true)}}

Model Sources [optional]

  • Repository: {{ repo | default(“[More Information Needed]”, true)}}
  • Paper [optional]: {{ paper | default(“[More Information Needed]”, true)}}
  • Demo [optional]: {{ demo | default(“[More Information Needed]”, true)}}

Uses

Direct Use

{{ direct_use | default(“[More Information Needed]”, true)}}

Downstream Use [optional]

{{ downstream_use | default(“[More Information Needed]”, true)}}

Out-of-Scope Use

{{ out_of_scope_use | default(“[More Information Needed]”, true)}}

Bias, Risks, and Limitations

{{ bias_risks_limitations | default(“[More Information Needed]”, true)}}

Recommendations

{{ bias_recommendations | default(“Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.”, true)}}

How to Get Started with the Model

Use the code below to get started with the model.

{{ get_started_code | default(“[More Information Needed]”, true)}}

Training Details

Training Data

{{ training_data | default(“[More Information Needed]”, true)}}

Training Procedure

Preprocessing [optional]

{{ preprocessing | default(“[More Information Needed]”, true)}}

Training Hyperparameters
  • Training regime: {{ training_regime | default(“[More Information Needed]”, true)}}
Speeds, Sizes, Times [optional]

{{ speeds_sizes_times | default(“[More Information Needed]”, true)}}

Evaluation

Testing Data, Factors & Metrics

Testing Data

{{ testing_data | default(“[More Information Needed]”, true)}}

Factors

{{ testing_factors | default(“[More Information Needed]”, true)}}

Metrics

{{ testing_metrics | default(“[More Information Needed]”, true)}}

Results

{{ results | default(“[More Information Needed]”, true)}}

Summary

{{ results_summary | default(“”, true) }}

Model Examination [optional]

{{ model_examination | default(“[More Information Needed]”, true)}}

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: {{ hardware_type | default(“[More Information Needed]”, true)}}
  • Hours used: {{ hours_used | default(“[More Information Needed]”, true)}}
  • Cloud Provider: {{ cloud_provider | default(“[More Information Needed]”, true)}}
  • Compute Region: {{ cloud_region | default(“[More Information Needed]”, true)}}
  • Carbon Emitted: {{ co2_emitted | default(“[More Information Needed]”, true)}}

Technical Specifications [optional]

Model Architecture and Objective

{{ model_specs | default(“[More Information Needed]”, true)}}

Compute Infrastructure

{{ compute_infrastructure | default(“[More Information Needed]”, true)}}

Hardware

{{ hardware_requirements | default(“[More Information Needed]”, true)}}

Software

{{ software | default(“[More Information Needed]”, true)}}

Citation [optional]

BibTeX:

{{ citation_bibtex | default(“[More Information Needed]”, true)}}

APA:

{{ citation_apa | default(“[More Information Needed]”, true)}}

Glossary [optional]

{{ glossary | default(“[More Information Needed]”, true)}}

More Information [optional]

{{ more_information | default(“[More Information Needed]”, true)}}

Model Card Authors [optional]

{{ model_card_authors | default(“[More Information Needed]”, true)}}

Model Card Contact

{{ model_card_contact | default(“[More Information Needed]”, true)}}

  • 5
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值