🚀 TinyLlama-1.1B
TinyLlama项目旨在预训练一个在3万亿个标记上训练的11亿参数的Llama模型。通过适当的优化,使用16块A100 - 40G GPU,我们可以在“仅”90天内完成这一目标🚀🚀。训练已于2023年9月1日启动。
项目GitHub链接
✨ 主要特性
- 架构和分词器与Llama 2完全相同,这意味着TinyLlama可以在许多基于Llama构建的开源项目中即插即用。
- 模型紧凑,仅包含11亿参数,适用于对计算和内存要求有限的多种应用场景。
🚀 快速开始
本模型是一个经过715K步、1.49T标记训练的中间检查点。建议不要直接用于推理。
📦 安装指南
你需要安装transformers>=4.31
,更多信息请查看 TinyLlama 的GitHub页面。
💻 使用示例
基础用法
from transformers import AutoTokenizer
import transformers
import torch
model = "PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
sequences = pipeline(
'The TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.',
do_sample=True,
top_k=10,
num_return_sequences=1,
repetition_penalty=1.5,
eos_token_id=tokenizer.eos_token_id,
max_length=500,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
📚 详细文档
评估结果
模型 |
预训练标记数 |
HellaSwag |
Obqa |
WinoGrande |
ARC_c |
ARC_e |
boolq |
piqa |
平均分 |
Pythia-1.0B |
300B |
47.16 |
31.40 |
53.43 |
27.05 |
48.99 |
60.83 |
69.21 |
48.30 |
TinyLlama-1.1B-intermediate-step-50K-104b |
103B |
43.50 |
29.80 |
53.28 |
24.32 |
44.91 |
59.66 |
67.30 |
46.11 |
TinyLlama-1.1B-intermediate-step-240k-503b |
503B |
49.56 |
31.40 |
55.80 |
26.54 |
48.32 |
56.91 |
69.42 |
48.28 |
TinyLlama-1.1B-intermediate-step-480k-1007B |
1007B |
52.54 |
33.40 |
55.96 |
27.82 |
52.36 |
59.54 |
69.91 |
50.22 |
TinyLlama-1.1B-intermediate-step-715k-1.5T |
1.49T |
53.68 |
35.20 |
58.33 |
29.18 |
51.89 |
59.08 |
71.65 |
51.29 |
📄 许可证
本项目采用Apache-2.0许可证。
训练数据集
- cerebras/SlimPajama - 627B
- bigcode/starcoderdata