/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
1 млрд
Лицензия
Apache 2.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
25 фев 2024

MobiLlama-1B-Chat

Генерация текстаТекст → текст5 профессий

Компактная англоязычная чат-модель MBZUAI для выполнения текстовых инструкций и диалоговых ответов.

110скачиваний за 30 дней25лайковвеса обновлены28 фев 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

MBZUAI/MobiLlama-1B-Chat — англоязычная чат-модель для следования инструкциям, дообученная на MBZUAI/MobiLlama-1B. Она использует плотную авторегрессионную архитектуру семейства LLaMA и содержит около 1 млрд параметров; README также называет вариант 1.2B-Chat, поэтому обозначение размера в карточке неоднозначно. Модель предназначена для диалоговых ответов и выполнения текстовых инструкций, в том числе на устройствах с ограниченными ресурсами.

Для дообучения использованы наборы WizardLM Evol Instruct и ShareGPT. Модель принимает и генерирует текст, поддерживает английский язык и имеет контекстное окно 2048 токенов. Репозиторий распространяется по лицензии Apache 2.0. В приведённых оценках результаты различаются между бенчмарками, поэтому их не следует трактовать как гарантию качества для конкретного сценария.

Сценарии применения

  • ответы на текстовые инструкции
  • диалоговый помощник на английском языке
  • локальный чат на устройстве с ограниченными ресурсами
  • генерация текстовых ответов в приложениях

Ограничения

Контекстное окно ограничено 2048 токенами, а заявленный размер неоднозначен: метаданные указывают 1B параметров, тогда как README использует обозначения 1B и 1.2B. Карточка описывает английский язык; результаты бенчмарков сами по себе не гарантируют качество в прикладных задачах.

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

MobiLlama-1B-Chat

We present MobiLlama-1.2B-Chat, an instruction following model finetuned on MBZUAI/MobiLlama-1B.

Model Summary

"Bigger the better" has been the predominant trend in recent Large Language Models (LLMs) development. However, LLMs do not suit well for scenarios that require on-device processing, energy efficiency, low memory footprint, and response efficiency. These requisites are crucial for privacy, security, and sustainable deployment. This paper explores the ‘less is more’ paradigm by addressing the challenge of designing accurate yet efficient Small Language Models (SLMs) for resource-constrained devices. Our primary contribution is the introduction of an accurate and fully transparent open-source 0.5 billion (0.5B) parameter SLM, named MobiLlama, catering to the specific needs of resource-constrained computing with an emphasis on enhanced performance with reduced resource demands. MobiLlama is a SLM design that initiates from a larger model and applies a careful parameter sharing scheme to reduce both the pre-training and the deployment cost. Our work strives to not only bridge the gap in open-source SLMs but also ensures full transparency, where complete training data pipeline, training code, model weights, and over 300 checkpoints along with evaluation codes are available on our Github.

Arxiv Paper Link

Model Description

Loading 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())

Alternatively, you may use FastChat:

python3 -m fastchat.serve.cli --model-path MBZUAI/MobiLlama-1B-Chat

MobiLlama-1B-Chat Finetuning Details

DataMix

SubsetNumber of rowsLicense
WizardLM/WizardLM_evol_instruct_V2_196k143k
icybee/share_gpt_90k_v190kcc0-1.0
Total233k

Hyperparameters

HyperparameterValue
Total Parameters1.2B
Hidden Size2048
Intermediate Size (MLPs)5632
Number of Attention Heads32
Number of Hidden Lyaers22
RMSNorm ɛ1e^-5
Max Seq Length2048
Vocab Size32000
Training HyperparameterValue
learning_rate2e-5
num_train_epochs3
per_device_train_batch_size2
gradient_accumulation_steps16
warmup_ratio0.04
model_max_length2048

Evaluation

Evaluation BenchmarkMobiLlama-05B-ChatMobiLlama-1.2B-Chat
HellaSwag0.50420.6244
MMLU0.26770.2635
Arc Challenge0.29350.3558
TruthfulQA0.39970.3848
CrowsPairs0.56940.679
PIQA0.70780.7557
Race0.33200.3598
SIQA0.41650.4396
Winogrande0.56590.5966

Citation

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}
} 

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
MobiLlamaForCausalLM
Ревизия весов
821a5ef

0 моделей