/ Модель

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

Контекст
2 048 токенов
Параметры
1 млрд
Лицензия
CC BY-NC 4.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
13 июн 2023

APT-1B-Base

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

Базовая польскоязычная языковая модель Azurro на 1,06 млрд параметров для генерации текста и последующего дообучения.

407скачиваний за 30 дней4лайкавеса обновлены14 июн 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

APT-1B-Base — базовая авторегрессионная языковая модель Azurro, обученная с нуля для генерации польского текста. Она использует плотную архитектуру Transformer типа decoder-only, совместимую с семейством LLaMA, и обучалась с помощью фреймворка ALLaMo. Размер модели — около 1,06 млрд параметров, контекст — 2048 токенов; для токенизации применяется BPE-токенизатор с словарём из 8000 токенов.

Модель предназначена прежде всего для исследований и последующего дообучения: она может продолжать польский текст и служить базой для специализированных моделей. Обучение проводилось на польском корпусе объёмом около 3 млрд токенов, включавшем книги, польскую Википедию и веб-данные; всего использовано 20 млрд токенов обучения. Модель принимает и выдаёт текст.

APT-1B-Base не рассчитана на непосредственное применение в диалоге или пользовательских системах без дообучения и дополнительных защитных механизмов. Она может генерировать фактические ошибки, предвзятые, оскорбительные или непристойные ответы. Лицензия CC BY-NC 4.0 разрешает использование на некоммерческих условиях.

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

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

Ограничения

Модель не предназначена для прямого пользовательского применения без дообучения и дополнительных защитных механизмов; она может выдавать фактически неверный, предвзятый, оскорбительный или непристойный текст. Лицензия CC BY-NC 4.0 ограничивает использование некоммерческими условиями.

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

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

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

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

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

Открыть на Hugging Face

APT-1B-Base

Introduction

At Azurro, we consistently place importance on using the Open Source technologies, both while working on the projects and in our everyday lives. We have decided to share a base language model trained by us. We are confident that smaller language models have great potential, and direct access to them for all people that are interested in such models democratizes this significant and dynamically changing field even more.

Statements

Training large language models requires a lot of computing power and it is meant for the major players on the market. However, does it mean that individuals or small companies cannot train language models capable of performing specific tasks? We decided to answer this question and train our own language model from scratch. We have made the following statements:

  • we use 1 consumer graphic card
  • we train the model only with the Polish corpus
  • we use manually selected, high quality texts for training the model.

Why have we made such statements? It is worth noting that training a model requires several times more resources than using it. To put it simply, it can be assumed that it is about 3-4 times more. Therefore, if a model can be run with a graphic card that has 6 GB VRAM, then training this model requires about 24 GB VRAM (this is the minimum value).

Many consumer computers are equipped with good quality graphic cards that can be used for training a model at one’s own home. This is why we have decided to use a top consumer graphic card - Nvidia’s RTX 4090 24GB VRAM.

All the currently available language models have been trained mainly with English corpora with a little bit of other languages, including Polish. The effect is that these models are not the best at dealing with the Polish texts. Even the popular GPT-3.5 model from OpenAI often has issues with correct forms. Therefore we have decided to prepare a model based only on the Polish corpus. An additional advantage of using only the Polish corpus is the size of the model - it is better to focus on one language in the case of smaller models.

It is important to remember that models are as good as the data with which they are trained. Having regard to the small size of the model, we trained it with carefully selected texts. This is why we have not used corpora such as Common Crawl that contain a lot of poor quality data. Our team has prepared a set of sources that then have been processed and used for training the model.

Model

APT-1B-Base is a base model introducing a new series of the APT (Azurro Pretrained Transformer) models. It has been trained with the use of an original open source framework called ALLaMo. This framework allows the user to train language models similar to the Meta AI’s LLaMA models quickly and efficiently.

APT-1B-Base is an autoregressive language model based on the architecture of a transformer. It has been trained with data collected before April 2023.

20 billion tokens have been used for training, and the training dataset (the Polish corpus) has 3 billion tokens. Chinchilla’s scaling law has been applied (20 tokens per every model parameter).

A special tokenizer has been prepared and trained for the purpose of training the model.

Model description:

  • Developed by: Azurro
  • Language: Polish
  • Model type: causal decoder-only
  • License: CC BY NC 4.0 (non-commercial use)

Model details:

HyperparameterValue
Model Parameters1060M
Sequence Length2048
Vocabulary Size8000
Layers20
Heads16
d_head128
d_model2048
Dropout0.0
BiasNo
Positional EncodingRoPE
Activation FunctionSwiGLU
Normalizing FunctionRMSNorm
Intermediate Size5632
Norm Epsilon1e-06

Tokenizer details:

  • type: BPE
  • special tokens: 7
  • alphabet size: 112
  • vocabulary size: 8000

Training

Training hyperparameters:

HyperparameterValue
Micro Batch Size1
Gradient Accumulation Steps264
Batch Size540672
Learning Rate3e-04
OptimizerAdamW
β1, β20.9, 0.95
Adam_eps1e−8
Weight Decay0.1
Grad Clip1.0

Dataset

Collecting a large amount of high quality training data is a great challenge. Over the past years at Azurro, we have done a lot of projects connected with processing Big Data. Therefore, with our extensive experience, we have been able to prepare carefully selected training dataset quickly and efficiently.

Our training dataset contains:

  • ebooks: 1354 million tokens
  • Polish Wikipedia: 970 million tokens
  • web crawl data: 813 million tokens

Quickstart

This model can be easily loaded using the AutoModelForCausalLM functionality.

from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "Azurro/APT-1B-Base"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

In order to reduce the memory usage, you can use smaller precision (bfloat16).

import torch

model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)

And then you can use Hugging Face Pipelines to generate text.

import transformers

text = "Najważniejszym celem człowieka na ziemi jest"

pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer)
sequences = pipeline(max_length=100, do_sample=True, top_k=10, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

Limitations and Biases

APT-1B-Base is not intended for deployment without fine-tuning. It should not be used for human-facing interactions without further guardrails and user consent.

APT-1B-Base can produce factually incorrect output, and should not be relied on to produce factually accurate information. APT-1B-Base was trained on various public datasets. While great efforts have been taken to clean the pretraining data, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

License

Because of an unclear legal situation, we have decided to publish the model under CC BY NC 4.0 license - it allows for non-commercial use. The model can be used for scientific purposes and privately, as long as the license conditions are met.

Disclaimer

The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model.

Citation

Please cite this model using the following format:

@online{AzurroAPT1BBase,
    author    = {Krzysztof Ociepa, Azurro},
    title     = {Introducing APT-1B-Base: Polish Language Model},
    year      = {2023},
    url       = {www.azurro.pl/apt-1b-base-en},
    note      = {Accessed: 2023-06-14}, % change this date
    urldate   = {2023-06-14} % change this date
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
04c0079

0 моделей