/ Модель

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

Контекст
2 048 токенов
Параметры
200 млн
Архитектура
llama_moe · dense
Опубликована
24 мар 2024

llama-265m

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

Компактная языковая модель LLaMA-265M, обученная с нуля для генерации текста и исследовательских экспериментов.

41скачиваний за 30 дней1лайквеса обновлены25 мар 2024

Бенчмарки

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

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

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

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

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

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

LLaMA-265M — компактная авторегрессионная языковая модель, разработанная автором репозитория JuncaiL и обученная с нуля. По README, обучение проходило в FP32: один проход по Wikipedia, затем один проход по 10% набора C4. Модель не дообучалась на инструкционных парах, поэтому может продолжать текст, но не рассчитана на надёжную работу в роли чат-бота.

В метаданных указаны архитектура LlamaMoEForCausalLM, около 199,8 млн параметров, контекст 2048 токенов и формат PyTorch; README округляет размер до 265 млн. Модель предназначена для генерации текста, компактного развертывания и исследовательских экспериментов. В README приведены результаты оценки MoE-варианта серии на совпадение предсказаний с LLaMA-7B; эти показатели не описывают качество данной модели 265M. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Модель не обучалась на инструкционных данных и может быть недостаточно пригодна для диалогов и ответов на запросы как чат-бот. В предоставленных данных лицензия не указана.

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

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

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

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

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

Открыть на Hugging Face

LLaMA-265M

💻 Code

👋 Very nice to meet you here~

❤️ This repo contains the model LLaMA-265M. This model is trained from scratch with FP32 precision. We firstly train the model through wikipedia dataset with 1 epoch and then through 10% of C4 dataset (10 data shards among 1024 data shards) with 1 epoch. This is NOT fine-tuned by instruction pairs, so it may not be good enough to act like a chatbot. The model size is only 265M, which is very convenient for deployment and research usage.

📢 This series also includes a MoE version, see 🤗this repo.

1. 🚀QuickStart

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_dir = "JuncaiL/llama-265m"
tokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_dir, trust_remote_code=True)
model.eval()
model.to("cuda:0")

input_text = "Beijing is a famous city"
inputs = tokenizer(input_text, return_tensors="pt",return_token_type_ids=False)
inputs = inputs.to("cuda:0")

pred = model.generate(**inputs, max_length=50, temperature=0.0)
print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))
# Beijing is a famous city in China. 
# The city is famous for its beaches, the most famous of which is the most famous and famous of the Beijing. It is also the home for the famous Beijing Opera 

2. 📑Checkpoint Details and Evaluation

Model Parameter

Model#Experts#Activated Experts#Params# Activated ParamsFlops(T) per sample (se q=2048)Model Weights
265M--265M265M0.48🤗 llama-265m
8 $\times$ 265M MoE82970M332M0.76🤗 llama-8x265m-moe
llama-7b--7B7B25.29

Model Evaluation

We use the "Average number of tokens verified" $N$ ( see reference link ) as the metric to evaluate these models. This metric demonstrates that giving the same input to the small speculative model and llama-7b, counting from the first predicted tokens, how many successive tokens in the output sentence of the small speculative model are the same as the output sentence of the llama-7b.

  • Average number of tokens verified
Dataset8 $\times$ 265M MoEGPT without MoE
tatsu-lab/alpaca3.23623.0334
alespalla/chatbot_instruction_prompts3.20313.0823
web_questions2.72012.5541
MohamedRashad/ChatGPT-prompts3.09542.9768

Supposed that the small speculative model can have a hit rate $p$ for the next token when giving the same input. Then we have

$$ 1p + 2p^2 + 3p^3 + ... = N $$

We can get the hit rate as follow.

$$ p = 1 + \frac{1-\sqrt{1+4N}}{2N}$$

  • Hit Rate
Dataset8 $\times$ 265M MoEGPT without MoE
tatsu-lab/alpaca0.5780.567
alespalla/chatbot_instruction_prompts0.5760.570
web_questions0.5500.540
MohamedRashad/ChatGPT-prompts0.5710.565

Acknowledgment

  1. My implementation of MoE structure is based on the repo https://huggingface.co/llama-moe/LLaMA-MoE-v1-3_5B-2_8
  2. My inspiration for Speculative Inference comes from the paper "SpecInfer: Accelerating Generative Large Language Model Serving with Tree-based Speculative Inference and Verification" (link) . I am very appreciative of the help and suggestions from the SpecInfer group. ❤️

Citation

@misc{specmoe-2024,
  title={SpecMoE: Building A Speculative MoE Model To Accelerate Inference},
  author={Juncai Liu},
  year={2024},
  month={March},
  url={https://github.com/JuncaiL/SpecMoE/}
}

Contact

If you have any interest or question about this project, please feel free to contact me.

liujc19@mails.tsinghua.edu.cn (before June 30, 2024) or liujc19@tsinghua.org.cn (After June 30, 2024)

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

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

GPU в ailist

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

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
LlamaMoEForCausalLM
Ревизия весов
a26cc97

0 моделей