Mobillama 1B Chat
MobiLlama-1B-Chat是基於MobiLlama-1B微調的指令跟隨模型,專為資源受限設備設計,強調高效、低內存佔用和快速響應。
下載量 44
發布時間 : 2/25/2024
模型概述
這是一個小型語言模型(SLM),適用於需要設備端處理、能效高、內存佔用低和響應效率高的場景,特別關注隱私、安全和可持續部署。
模型特點
資源高效
專為資源受限設備設計,參數共享方案降低了預訓練和部署成本
完全透明
提供完整的訓練數據管道、訓練代碼、模型權重和評估代碼
指令跟隨
經過微調能夠有效理解和執行人類指令
模型能力
文本生成
指令理解
對話系統
使用案例
教育
兒童活動建議
為家長提供適合兒童的活動創意和建議
生成詳細的活動方案和注意事項
健康
正念冥想指導
提供正念冥想的方法和好處說明
詳細解釋冥想技巧和科學依據
🚀 MobiLlama-1B-Chat
我們推出了 MobiLlama-1.2B-Chat,這是一個在 MBZUAI/MobiLlama-1B 基礎上微調的指令跟隨模型。它旨在滿足資源受限設備的特定需求,在降低資源需求的同時提升性能。

🚀 快速開始
加載 MobiLlama-1B-Chat
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("MBZUAI/MobiLlama-1B-Chat", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("MBZUAI/MobiLlama-1B-Chat", trust_remote_code=True)
model.to('cuda')
#template adapated from fastchat
template= "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n### Human: Got any creative ideas for a 10 year old’s birthday?\n### Assistant: Of course! Here are some creative ideas for a 10-year-old's birthday party:\n1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.\n2. Science Party: Plan a science-themed party where kids can engage in fun and interactive experiments. You can set up different stations with activities like making slime, erupting volcanoes, or creating simple chemical reactions.\n3. Outdoor Movie Night: Set up a backyard movie night with a projector and a large screen or white sheet. Create a cozy seating area with blankets and pillows, and serve popcorn and snacks while the kids enjoy a favorite movie under the stars.\n4. DIY Crafts Party: Arrange a craft party where kids can unleash their creativity. Provide a variety of craft supplies like beads, paints, and fabrics, and let them create their own unique masterpieces to take home as party favors.\n5. Sports Olympics: Host a mini Olympics event with various sports and games. Set up different stations for activities like sack races, relay races, basketball shooting, and obstacle courses. Give out medals or certificates to the participants.\n6. Cooking Party: Have a cooking-themed party where the kids can prepare their own mini pizzas, cupcakes, or cookies. Provide toppings, frosting, and decorating supplies, and let them get hands-on in the kitchen.\n7. Superhero Training Camp: Create a superhero-themed party where the kids can engage in fun training activities. Set up an obstacle course, have them design their own superhero capes or masks, and organize superhero-themed games and challenges.\n8. Outdoor Adventure: Plan an outdoor adventure party at a local park or nature reserve. Arrange activities like hiking, nature scavenger hunts, or a picnic with games. Encourage exploration and appreciation for the outdoors.\nRemember to tailor the activities to the birthday child's interests and preferences. Have a great celebration!\n### Human: {prompt}\n### Assistant:"
prompt = "What are the key benefits of practicing mindfulness meditation?"
input_str = template.format(prompt=prompt)
input_ids = tokenizer(input_str, return_tensors="pt").to('cuda').input_ids
outputs = model.generate(input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
或者,你可以使用 FastChat:
python3 -m fastchat.serve.cli --model-path MBZUAI/MobiLlama-1B-Chat
✨ 主要特性
在近期大語言模型(LLM)的發展中,“越大越好”一直是主流趨勢。然而,大語言模型並不適合需要設備端處理、能源效率、低內存佔用和響應效率的場景。這些要求對於隱私、安全和可持續部署至關重要。本文通過應對為資源受限設備設計準確且高效的小語言模型(SLM)這一挑戰,探索了“少即是多”的範式。我們的主要貢獻是推出了一個準確且完全透明的開源 5 億(0.5B)參數的小語言模型 MobiLlama,它滿足資源受限計算的特定需求,強調在降低資源需求的同時提升性能。MobiLlama 是一種小語言模型設計,它從一個更大的模型開始,並應用了一種謹慎的參數共享方案,以降低預訓練和部署成本。我們的工作不僅努力填補開源小語言模型的空白,還確保了完全透明,完整的訓練數據管道、訓練代碼、模型權重以及 300 多個檢查點和評估代碼都可以在我們的 Github 上找到。
📚 詳細文檔
模型描述
屬性 | 詳情 |
---|---|
模型類型 | 基於 LLaMA - 7B 架構設計構建的小語言模型(SLM) |
語言(NLP) | 英語 |
許可證 | Apache 2.0 |
更多信息資源 | - 訓練代碼 - 數據準備 - 完全處理後的 Amber 預訓練數據 |
MobiLlama-1B-Chat 微調詳情
DataMix
子集 | 行數 | 許可證 |
---|---|---|
WizardLM/WizardLM_evol_instruct_V2_196k | 143k | |
icybee/share_gpt_90k_v1 | 90k | cc0 - 1.0 |
總計 | 233k |
超參數
超參數 | 值 |
---|---|
總參數 | 1.2B |
隱藏層大小 | 2048 |
中間層大小(MLPs) | 5632 |
注意力頭數量 | 32 |
隱藏層數量 | 22 |
RMSNorm ɛ | 1e^ - 5 |
最大序列長度 | 2048 |
詞表大小 | 32000 |
訓練超參數 | 值 |
---|---|
學習率 | 2e - 5 |
訓練輪數 | 3 |
每個設備的訓練批次大小 | 2 |
梯度累積步數 | 16 |
熱身比例 | 0.04 |
模型最大長度 | 2048 |
評估
評估基準 | MobiLlama - 05B - Chat | MobiLlama - 1.2B - Chat |
---|---|---|
HellaSwag | 0.5042 | 0.6244 |
MMLU | 0.2677 | 0.2635 |
Arc Challenge | 0.2935 | 0.3558 |
TruthfulQA | 0.3997 | 0.3848 |
CrowsPairs | 0.5694 | 0.679 |
PIQA | 0.7078 | 0.7557 |
Race | 0.3320 | 0.3598 |
SIQA | 0.4165 | 0.4396 |
Winogrande | 0.5659 | 0.5966 |
引用
BibTeX:
@misc{thawakar2024mobillama,
title={MobiLlama: Towards Accurate and Lightweight Fully Transparent GPT},
author={Omkar Thawakar and Ashmal Vayani and Salman Khan and Hisham Cholakkal and Rao Muhammad Anwer and Michael Felsberg and Timothy Baldwin and Eric P. Xing and Fahad Shahbaz Khan},
year={2024},
eprint={2402.16840},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
📄 許可證
本模型使用 Apache 2.0 許可證。
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