🚀 Llama3-8B-1.58模型
Llama3-8B-1.58 模型是基于 BitNet 1.58b架构 微调的大语言模型,其基础模型为 Llama-3-8B-Instruct。若想深入了解相关方法和结果,请查看我们的 博客文章。
🚀 快速开始
你可以在 Transformers
库中轻松加载并测试我们的模型。只需按照以下代码操作:
首先,安装带有正确配置的 transformers
版本,以加载 BitNet 模型:
pip install git+https://github.com/huggingface/transformers.git@refs/pull/33410/head
然后,加载模型:
model = AutoModelForCausalLM.from_pretrained("HF1BitLLM/Llama3-8B-1.58-100B-tokens", device_map="cuda", torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
input_text = "Daniel went back to the the the garden. Mary travelled to the kitchen. Sandra journeyed to the kitchen. Sandra went to the hallway. John went to the bedroom. Mary went back to the garden. Where is Mary?\nAnswer:"
input_ids = tokenizer.encode(input_text, return_tensors="pt").cuda()
output = model.generate(input_ids, max_length=10, do_sample=False)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
✨ 主要特性
模型详情
模型来源
训练详情
训练数据
该模型在 FineWeb-edu 的一个子集上进行训练。
训练过程
- 起始点:使用线性 lambda 调度器在 100 亿 token 运行中表现最佳的检查点。
- 训练时长:额外微调 45,000 步,总共达到 100 亿 token。
- 数据集:FineWeb-edu 数据集。
- 批次大小:每步 200 万 token,每次运行总计 45,000 步 * 200 万 token = 90 亿 token,加上初始的 10 亿 token 达到 100 亿。
- 学习率实验:测试了各种学习率以找到最佳设置,根据实验,表现最佳的峰值学习率为 1e - 5。
- 性能表现:在某些指标上接近 Llama3 8B,但整体平均性能略逊于 Llama3 8B。
- 评估指标:包括困惑度、MMLU 分数和其他标准基准。
这些在 100 亿 token 上的扩展训练运行突破了高度量化模型的界限,使性能更接近 Llama3 等半精度模型。
评估
模型在 Nanotron 检查点上使用 LightEval 进行评估:

📄 许可证
引用信息
@misc{,
title={1.58-Bit LLM: A New Era of Extreme Quantization},
author={Mohamed Mekkouri and Marc Sun and Leandro von Werra and Thomas Wolf},
year={2024},
}