/ Модель

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

Контекст
2 048 токенов
Размер весов
13,2 ГБ
Лицензия
Apache 2.0
Архитектура
crystalcoder · dense
Библиотека
transformers
Опубликована
8 янв 2024

CrystalChat

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

CrystalChat — англоязычная инструкцияная модель LLM360 для диалога, генерации текста и помощи с программированием.

766скачиваний за 30 дней38лайковвеса обновлены4 окт 2024

Бенчмарки

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

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

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

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

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

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

CrystalChat — англоязычная инструкцияная языковая модель от LLM360 из серии Pebble, дообученная на основе LLM360/Crystal с контрольной точки CrystalCoder второго этапа. Модель имеет плотную архитектуру CrystalCoder, совместимую по описанию с LLaMA-7B, и рассчитана на генерацию текста по инструкциям, диалог и задачи программирования. Контекст модели составляет 2048 токенов; доступен формат PyTorch.

Модель обучалась на смесях диалоговых, общих инструкционных и кодовых данных, включая наборы SlimOrca, ShareGPT, CodeAlpaca и данные по программированию; в обучении также использован созданный LLM360 набор инструкций по HTML. В карточке приведены результаты языковых и кодовых бенчмарков, включая HumanEval и MBPP. Модель ориентирована прежде всего на английский язык.

CrystalChat выпущена под лицензией Apache 2.0. Разработчики отмечают, что модель не прошла RLHF-выравнивание по человеческим предпочтениям и не имеет фильтрации ответов, поэтому может выдавать проблемный контент; приведённые оценки не гарантируют качество для конкретного применения.

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

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

Ограничения

Модель не прошла RLHF-выравнивание и не использует фильтрацию ответов, поэтому может генерировать проблемный контент. Контекст ограничен 2048 токенами; показатели бенчмарков не гарантируют качество в прикладных сценариях.

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

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

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

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

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

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

Открыть на Hugging Face

CrystalChat

We present CrystalChat, an instruction following model finetuned from LLM360/Crystal.

CrystalChat pushes the Llama 2 frontier for models excelling at both langauge and coding tasks. CrystalChat is part of LLM360's Pebble model series.

CrystalChat Performance

ModelTrained TokensAvg. of Avg.Language Avg.Coding Avg.
CrystalChat 7B1.275T44.9653.2936.62
Mistral-7B-Instruct-v0.1-44.3454.8630.62
CodeLlama-7b-Instruct2.5T40.9145.2936.52
Llama-2-7b-Chat2T34.1152.8615.35
AmberChat 7B1.25T-44.76-
ModelTrained TokensARCHellaSwagMMLU (5-shot)GSM8KWinogrande(5-shot)TruthfulQAHumanEval (pass@1)MBPP (pass@1)
CrystalChat 7B1.275T51.7176.1253.2228.0570.6447.2934.1239.11
Mistral-7B-Instruct-v0.1-58.0575.7155.5632.0074.2755.9029.2731.96
CodeLlama-7b-Instruct2.5T43.3566.1442.7515.9264.3339.2334.1238.91
Llama-2-7b-Chat2T53.0778.3948.4218.8873.0945.3013.2617.43
AmberChat 7B1.25T42.8374.0338.885.3166.7740.72--
Combined Language and Coding Ability
Performance on Standard Benchmarks
Perforamnce on Language Benchmarks

Instruction Tuning Training

CrystalChat is using the last CrystalCoder checkpoint of phase2 (CrystalCoder_phase2_checkpoint_214387) as the initialization checkpoint. We then finetune the model using the dataset mentioned below.

We also performed the same finetuning on the last CrystalCoder checkpoint of phase3 (CrystalCoder_phase3_checkpoint_027728). The phase2 and phase3 finetuning results are very similar, but phase2 finetuning exhibits slightly better performance on the English language benchmarks. We choose the phase2 finetuning result as the final model for CrystalChat.

Instruction Tuning Data

The fine-tuning data is a mix of publicly available language and code datasets, plus a orginally created dataset called WebAlpaca on HTML coding instructions. The WebAlpaca dataset is created by us and is used as part of our instruction tuning training data. We will release the WebAlpaca dataset in a separate repository soon.

The summary of the fine-tuning data is as follows:

Subset#TokensAvg. #QAvg. Query LenAvg. #RAvg. Reply Len
OASST1-guanaco4,464,6401.3638.281.36271.69
SlimOrca225,628,1601.00259.161.00151.12
ShareGPT112,914,4323.2894.533.64365.81
Evol-ShareGPT85,954,5601.00145.991.00425.17
ChatLogs29,337,6003.3995.583.24191.42
CodeAlpaca2,623,4881.0032.461.0067.68
Rosetta Code7,987,2001.00450.091.00533.52
Evol-CodeAlpaca 173,803,7761.00210.331.00437.92
Evol-CodeAlpaca 234,910,2081.00114.991.00300.29
WebAlpaca43,673,6001.0096.291.00746.52
General Textbooks85,590,016Not instruction data
Programming Books395,628,544Not instruction data
Total1,102,516,224

For more details, check out the data table.

Instruction Format

We've added some new special tokens to the CrystalCoder tokenizer to support the instruction tuning.

List special tokens used in the instruction tuning:

bos: <s> 
eos: </s>
system_start: <|sys_start|>
system_end: <|sys_end|>
user_start: <|im_start|>
user_end: <|im_end|>

The instruction format is as follows:

<s> <|sys_start|> system prompt <|sys_end|> <|im_start|> first user utterance <|im_end|> first model response <|im_start|> next user utterance <|im_end|> next model response </s>

Reproducing the Results

We will release the training code and the training data soon. Our training code is based on Megatron-LM, with some modifications to support our training data format and Maximal Update Parametrization (μP).

Model Description

Loading CrystalChat

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda:0" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained("LLM360/CrystalChat", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("LLM360/CrystalChat", trust_remote_code=True).to(device)

prompt = '<s> <|sys_start|> You are an AI assistant. You will be given a task. You must generate a detailed and long answer. <|sys_end|> <|im_start|> Write a python function that takes a list of integers and returns the squared sum of the list. <|im_end|>'


input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
gen_tokens = model.generate(input_ids, do_sample=True, max_length=400)

print("-"*20 + "Output for model"  + 20 * '-')
print(tokenizer.batch_decode(gen_tokens)[0])

Response:

Here's a Python function named `squared_sum_list` that takes a list of integers as input and returns the squared sum of the list:

```python
def squared_sum_list(lst):
    return sum([num ** 2 for num in lst])
```

The function `squared_sum_list` uses a list comprehension to iterate over each number in the input list `lst` and calculate its square. Then, it uses the `sum` function to accumulate all the squared numbers in a single value - the squared sum of the list.

For example:

```python
numbers = [1, 2, 3, 4, 5]
print(squared_sum_list(numbers))  # Outputs: 55
```

In the above code, the list `[1, 2, 3, 4, 5]` is passed as an argument to the `squared_sum_list` function. The function calculates the sum of the squares of the elements in the list, which is `1 + 4 + 9 + 16 + 25 = 55`. The function then returns this result, which is printed to the console.</s>

Another chat example:

# ...
prompt = '<s> <|sys_start|> You are an AI assistant. You will be given a task. You must generate a detailed \
and long answer. <|sys_end|> <|im_start|> Give me a one-sentence description of crystal. And tell me what \
might the name "Crystal" mean for a transparant and open-source language model? <|im_end|>'
# ...

Response:

A crystal is an ordered, hexagonal lattice of atoms that displays a unique crystal structure resulting in transparency and diverse physical and chemical properties, and as a transparent and open-source language model, "Crystal" might represent transparency and accessibility by enabling users to understand the inner workings of the model.</s>

Bias, Risks, and Limitations

CrystalChat has not been aligned to human preferences for safety within the RLHF phase or deployed with in-the-loop filtering of responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so). The training data is known and made available here. It primarily consists of SlimPajama, StarCoder, and WebCrawl dataset.

Citation

BibTeX:

@misc{liu2023llm360,
      title={LLM360: Towards Fully Transparent Open-Source LLMs}, 
      author={Zhengzhong Liu and Aurick Qiao and Willie Neiswanger and Hongyi Wang and Bowen Tan and Tianhua Tao and Junbo Li and Yuqi Wang and Suqi Sun and Omkar Pangarkar and Richard Fan and Yi Gu and Victor Miller and Yonghao Zhuang and Guowei He and Haonan Li and Fajri Koto and Liping Tang and Nikhil Ranjan and Zhiqiang Shen and Xuguang Ren and Roberto Iriondo and Cun Mu and Zhiting Hu and Mark Schulze and Preslav Nakov and Tim Baldwin and Eric P. Xing},
      year={2023},
      eprint={2312.06550},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

About LLM360

LLM360 is an initiative for comprehensive and fully open-sourced LLMs, where all training details, model checkpoints, intermediate results, and additional analyses are made available to the community. Our goal is to advance the field by inviting the community to deepen the understanding of LLMs together. As the first step of the project LLM360, we release all intermediate model checkpoints, our fully-prepared pre-training dataset, all source code and configurations, and training details. We are committed to continually pushing the boundaries of LLMs through this open-source effort.

Visit Us

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

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

GPU в ailist

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

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

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

Класс архитектуры
CrystalCoderLMHeadModel
Ревизия весов
18091ea

0 моделей