/ Модель

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

Контекст
4 096 токенов
Параметры
34 млрд
Размер весов
69,6 ГБ
Лицензия
Своя лицензия
Архитектура
inflm · dense
Опубликована
17 июл 2024

INF-34B-Base

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

INF-34B-Base — англо-китайская базовая языковая модель на 34 млрд параметров для генерации текста и дальнейшей адаптации.

15скачиваний за 30 дней7лайковвеса обновлены25 июл 2024

Бенчмарки

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

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

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

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

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

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

INF-34B-Base — базовая плотная языковая модель с 34 млрд параметров, разработанная командой INF и построенная на архитектуре LLaMA. Для стабилизации обучения вместо RMSNorm используется LayerNorm с gamma, центрированной относительно нуля. Модель предварительно обучена примерно на 3,5 трлн очищенных токенов из англо-китайского корпуса. README сообщает о контексте до 32K токенов, тогда как метаданные Hugging Face указывают native context в 4096 токенов.

Модель предназначена для генерации текста и служит основой для последующей адаптации под диалоговые и прикладные сценарии. В обучении уделялось внимание общим знаниям, математике и программированию, а разработчики также отмечают потенциал в финансах и здравоохранении. В README приведены результаты базовой модели на академических тестах, включая MMLU, CMMLU и GSM8K.

Модель опубликована в формате safetensors. В метаданных указана лицензия other; README допускает коммерческое применение на условиях раздела лицензии, но сам текст условий здесь не приведён. Заявление о работе квантованной версии на видеокартах с 24 ГБ видеопамяти относится к отдельной квантованной версии, а не непосредственно к этому базовому репозиторию.

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

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

Ограничения

Модель базовая, поэтому для диалогового использования может потребоваться дополнительная настройка. Контекст заявлен как 32K в README, однако метаданные указывают native context 4096 токенов; условия лицензии other следует проверить перед использованием.

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

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

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

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

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

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

Открыть на Hugging Face

1. Introduction

INF-34B has 34 billion parameters with a context window length of 32K, and is trained on about 3.5T well-processed tokens from English and Chinese bilingual corpus. Compared with open source models of the comparable size, INF-34B not only provides competitive performance in the OpenCompass evaluation, but also has impressive potential on both finance and healthcare domains. Besides, the quantized INF-34B runs on graphics cards of 24GB VRAM with negligible accuracy loss, which facilitates commercial applications, especially low-resource scenarios.

  • Detailed for Training GPT Model: We provide comprehensive details about our model pretraining and alignment, including high-quality data pipeline, instruction data preparation, and quantization results etc.

  • Superior Performance on Benchmarks: We demonstrate superior performance of the INF-34B models by comparing against two competitors with comparable model size, Qwen1.5-32B and Yi1.5-34B, on the public OpenCompass benchmarks.

2. Models

We release the base and chat models with 34B parameters based on the LLaMA framework, while using LayerNorm with zero-centered gamma instead of RMSNorm for training stability. Please note that you could use our models for commercial applications under the terms outlined in License section.

Huggingface

ModelSequence LengthDownload
INF-34B-Base32K🤗 HuggingFace
Inf-34B-Chat32K🤗 HuggingFace
Inf-34B-Chat-GPTQ-4bits32K🤗 HuggingFace
Inf-34B-Chat-GPTQ-8bits32K🤗 HuggingFace
Inf-34B-Chat-AWQ32K🤗 HuggingFace

3. Benchmarks

Note: If you want to reproduce the evaluation results, please refer to the details of evaluation, including prompts, postprocess scripts and version of inference frameworks.

Base Model

We evaluate our model on several academic benchmarks then compare with other similar-sized open access model. INF-34B has stronger performance in the fields that we chose to optimize while simultaneously preserves the general capabilities of LLM such as commonsense, world knowledge, math and coding.

modelQWen1.5-32BYi1.5-34BINF-34B
MMLU(5-shot)73.6077.8676.11
CMMLU(5-shot)81.8781.8580.08
GSM8K(4-shot)72.8680.0683.02
MATH(4-shot)36.8033.8838.34
HumanEval(0-shot)44.5147.5665.24
MBPP(3-shot)51.0065.6064.00
BBH(3-shot)70.6074.8371.20
HellaSwag(0-shot)82.0381.5783.32

Note: To facilitate reproduction, the results of common benchmarks are generated by OpenCompass except humaneval and mbpp as we experience code timeout and postprocess issues.

Chat Model

We present the performance results of our chat model and other LLM on various standard benchmarks, as well as two domain-specific benchmarks.

modelQWen1.5-32B-ChatYi1.5-34B-ChatINF-34B-Chat
MT-bench8.38.58.3
AlignBench7.17.27.1
IFEval49.5458.0459.70
Arena-Hard24.242.643.1
GSM8K81.4279.4584.04
MATH42.2854.0651.48

Long Context

We employed a long context SFT dataset of various length. Specifically, 37.7% shorter than 8k tokens, 40.5% falling within 8k to 16k tokens and 21.8% ranging from 16k to 32k tokens. And Our model has demonstrated superior performance on LongBench(via OpenCompass) tasks compared to Qwen1.5-32B.

modelSingle-DocQAMulti-DocQASummari-zationFew-shotLearningSyntheticCode
QWen1.5-32B-Chat45.640.423.152.667.343.8
INF-34B-Chat47.443.224.166.066.857.2

Note: All the reported results on the table are the average of sub-tasks for different categories.

INF-34B-32k also performs well across context window lengths up to 32k on Single-Needle RetrievalTask(S-RT) as visualized below.

4. Training Details

Data Pipeline

We propose different data pipelines for general, domain and code data to ensure the richness, variety and quality of training samples. The general data pipeline involves general processing methods. For the domain data of interest, e.g., math, wiki, code, we propose a domain-specific data pipeline to extract the domain data from Common Crawl (CC). We also devise a code-specific pipeline to handle massive code data, since the code data has proven its effectiveness in improving the model’s reasoning and comprehension ability.

  • General Data Pipeline: Our text cleaning pipeline mainly includes two stages: filtering and deduplication. The filtering involves language identification, URL filtering, and heuristic filtering rules. The deduplication includes both fuzzy deduplication and exact deduplication techniques.

  • Domain Data Pipeline: We propose an iterative high-quality data retrieval method that recalls relevant data from the Common Crawl (CC) dataset for various target domains. It comprises three main component: FastText training, Performing recall and Human annotation.

  • Code Data Pipeline: The code-specific data processing pipeline includes modules of preprocessing, heuristic filtering, deduplication, transformation and data mixture.

Training Settings

The architecture choices of INF-34B follows LLaMA framework. Specifically, we opt Rotary Embedding for positional encoding, SwiGLU for activation function, Grouped Query Attention (GQA) and LayerNorm with zero-centered gamma instead of RMSNorm for training stability.

Motivated by the idea of first training on relatively large but less polished corpus to equip the model with language understanding and world knowledge and then improves model’s domain knowledge and reasoning ability, our training process is split into 3 stages:

  • Stage 1: The dataset mainly includes web text, paper, Wikipedia and source code. In this early stage, we aim at larger data and higher diversity.
  • Stage 2: For second stage we seek to gradually challenge the model with longer and more complex texts. We up-weight long texts in the same data distribution of stage 1. We tune the rope base and extend our context window to 32k for more sophisticated comprehension of human knowledge.
  • Stage 3: The final stage is composed of domain data recalled from Web text and synthetic data.

5. Inference

Installation

Please clone our GitHub, and install the dependencies for Python >= 3.8 by running the following command:

git clone https://github.com/infly-ai/INF-LLM
cd INF-LLM
pip install -r requirements.txt

Inference with Huggingface's Transformers

We provide the inference examples with Huggingface's Transformers.

Text Generation with Base Model

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig

model_name = "infly-ai/INF-34B-Base"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name,
                                             torch_dtype=torch.bfloat16,
                                             device_map="auto",
                                             trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained(model_name)
model.generation_config.pad_token_id = model.generation_config.eos_token_id

inputs = tokenizer("对酒当歌,", return_tensors="pt")
outputs = model.generate(**inputs.to(model.device), max_new_tokens=100)

result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)

Text Generation with Chat Model

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig

model_name = "infly-ai/INF-34B-Chat"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name,
                                             torch_dtype=torch.bfloat16,
                                             device_map="auto",
                                             trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained(model_name)
model.generation_config.pad_token_id = model.generation_config.eos_token_id

messages = [
    {"role": "user", "content": "Who are you?"}
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)

result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
print(result)

You can also interact with our model following the sample template without apply_chat_template. You should tokenize the completed templates as the base model does for more flexible usage.

<|start|>user
messages[0]['content']<|end|>
<|start|>assistant<|message|>{messages[1]['content']}<|end|>
<|start|>user
messages[2]['content']<|end|>
<|start|>assistant<|message|>

6. License

INF-34B series (including Base and Chat) support commercial applications under a permissive License.

7. Citation

@article{inf-llm,
  author = {INF-Team},
  title = {INF’s Open-Source Large Language Models},
  year = {2024},
  url = {https://github.com/infly-ai/INF-LLM}
}

8. Contact

If you have any questions or seek for cooperation, please contact us at bd@infteach.ai.

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

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

GPU в ailist

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

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

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

Класс архитектуры
INFLMForCausalLM
Ревизия весов
0a5f7fb

0 моделей