🚀 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