/ Модель

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

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

TeenyTinyLlama-460m

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

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

123скачиваний за 30 дней12лайковвеса обновлены15 янв 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

TeenyTinyLlama-460m — компактная языковая модель, разработанная авторами семейства TeenyTinyLlama для генерации текста на бразильском португальском языке. Это плотная Transformer-модель архитектуры Llama с авторегрессионным обучением; в метаданных указано 435,4 млн параметров, контекст — 2048 токенов. Модель обучали на корпусе Pt-Corpus Instruct объёмом 6,2 млрд токенов.

Модель предназначена прежде всего для исследований языковых моделей для языков с ограниченными ресурсами, контролируемых экспериментов и дальнейшего дообучения. Она генерирует продолжение текста по текстовому запросу и рассчитана на стандартный бразильский португальский. Лицензия Apache 2.0 разрешает адаптацию и использование с соблюдением её условий.

Карточка прямо предостерегает от развёртывания модели для взаимодействия с пользователями: она не дообучена для типичных прикладных сценариев. Возможны фактические ошибки, токсичные и предвзятые ответы, ненадёжный код, повторы и многословие; другие языки модель понимает хуже. Для применения после дообучения авторы рекомендуют самостоятельно оценить риски и смещения и модерировать ответы.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

TeenyTinyLlama-460m

Model Summary

Large language models (LLMs) have significantly advanced natural language processing, but their progress has yet to be equal across languages. While most LLMs are trained in high-resource languages like English, multilingual models generally underperform monolingual ones. Additionally, aspects of their multilingual foundation sometimes restrict the byproducts they produce, like computational demands and licensing regimes. Hence, we developed the TeenyTinyLlama pair: two compact models for Brazilian Portuguese text generation.

Read our article here.

Details

  • Architecture: a Transformer-based model pre-trained via causal language modeling
  • Size: 468,239,360 parameters
  • Context length: 2048 tokens
  • Dataset: Pt-Corpus Instruct (6.2B tokens)
  • Language: Portuguese
  • Number of steps: 1,200,000
  • GPU: 1 NVIDIA A100-SXM4-40GB
  • Training time: ~ 280 hours
  • Emissions: 41.1 KgCO2 (Germany)
  • Total energy consumption: 115.69 kWh

This repository has the source code used to train this model. The main libraries used are:

Intended Uses

The primary intended use of TeenyTinyLlama is to research the challenges related to developing language models for low-resource languages. Checkpoints saved during training are intended to provide a controlled setting for performing scientific experiments. You may also further fine-tune and adapt TeenyTinyLlama for deployment, as long as your use is following the Apache 2.0 license. If you decide to use pre-trained TeenyTinyLlama as a basis for your fine-tuned model, please conduct your own risk and bias assessment.

Out-of-scope Use

TeenyTinyLlama is not intended for deployment. It is not a product and should not be used for human-facing interactions.

TeenyTinyLlama models are Brazilian Portuguese language only and are not suitable for translation or generating text in other languages.

TeenyTinyLlama has not been fine-tuned for downstream contexts in which language models are commonly deployed.

Basic usage

Using the pipeline:

from transformers import pipeline

generator = pipeline("text-generation", model="nicholasKluge/TeenyTinyLlama-460m")

completions  = generator("Astronomia é a ciência", num_return_sequences=2, max_new_tokens=100)

for comp in completions:
  print(f"🤖 {comp['generated_text']}")

Using the AutoTokenizer and AutoModelForCausalLM:

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Load model and the tokenizer
tokenizer = AutoTokenizer.from_pretrained("nicholasKluge/TeenyTinyLlama-460m", revision='main')
model = AutoModelForCausalLM.from_pretrained("nicholasKluge/TeenyTinyLlama-460m", revision='main')

# Pass the model to your device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model.eval()
model.to(device)

# Tokenize the inputs and pass them to the device
inputs = tokenizer("Astronomia é a ciência", return_tensors="pt").to(device)

# Generate some text
completions = model.generate(**inputs, num_return_sequences=2, max_new_tokens=100)

# Print the generated text
for i, completion in enumerate(completions):
    print(f'🤖 {tokenizer.decode(completion)}')

Limitations

Like almost all other language models trained on large text datasets scraped from the web, the TTL pair exhibited behavior that does not make them an out-of-the-box solution to many real-world applications, especially those requiring factual, reliable, nontoxic text generation. Our models are all subject to the following:

  • Hallucinations: This model can produce content that can be mistaken for truth but is, in fact, misleading or entirely false, i.e., hallucination.

  • Biases and Toxicity: This model inherits the social and historical stereotypes from the data used to train it. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities.

  • Unreliable Code: The model may produce incorrect code snippets and statements. These code generations should not be treated as suggestions or accurate solutions.

  • Language Limitations: The model is primarily designed to understand standard Brazilian Portuguese. Other languages might challenge its comprehension, leading to potential misinterpretations or errors in response.

  • Repetition and Verbosity: The model may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given.

Hence, even though our models are released with a permissive license, we urge users to perform their risk analysis on these models if intending to use them for real-world applications and also have humans moderating the outputs of these models in applications where they will interact with an audience, guaranteeing users are always aware they are interacting with a language model.

Evaluations

During our training runs, both models showed consistent convergence. At no point did our evaluation curves show signs of overfitting or saturation. In the case of our 460m parameter model, we intentionally trained past the optimal point by approximately 75,000 steps to assess if there were any signs of saturation, but our evaluations consistently gave better results. We hypothesize that our models are under-trained but can improve if further trained to pass the Chinchilla optimal range.

Processed TokensPerplexityEnergy Consumption (kWh)Emissions (KgCO2eq)
8.1M20.499.403.34
1.6B16.9018.826.70
2.4B15.4328.5910.16
3.2B14.6438.2013.57
4.0B14.0848.0417.07
4.9B13.6157.7420.52
5.7B13.2567.3223.92
6.5B12.8776.8427.30
7.3B12.5786.4030.70
8.1B12.2796.1934.18
9.0B11.96106.0637.70
9.8B11.77115.6941.31

Benchmarks

Evaluations on benchmarks were performed using the Language Model Evaluation Harness (by EleutherAI). Laiviet translated the tasks from the LM-Evaluation-Harness we used. The results of models marked with an "*" were extracted from the Open LLM Leaderboard.

ARCHellaSwagMMLUTruthfulQAAverage
Pythia-410m24.83*41.29*25.99*40.95*33.26
TTL-460m29.4033.0028.5541.1033.01
Bloom-560m24.74*37.15*24.22*42.44*32.13
Xglm-564M25.5634.64*25.18*42.5331.97
OPT-350m23.55*36.73*26.02*40.83*31.78
TTL-160m26.1529.2928.1141.1231.16
Pythia-160m24.06*31.39*24.86*44.34*31.16
OPT-125m22.87*31.47*26.02*42.87*30.80
GPorTuguese-222.4829.6227.3641.4430.22
Gpt2-small21.48*31.60*25.79*40.65*29.97
Multilingual GPT23.8126.37*25.17*39.6228.73

Evaluations on Brazilian Portuguese benchmarks were performed using a Portuguese implementation of the EleutherAI LM Evaluation Harness (created by Eduardo Garcia).

ASSIN2 RTEASSIN2 STSBLUEXENEMFAQUAD NLIHateBROAB ExamsAverage
Qwen-1.8B64.8319.5326.1530.2343.9733.3327.2035.03
TinyLlama-1.1B58.9313.5722.8122.2543.9736.9223.6431.72
TTL-460m53.9312.6622.8119.8749.0133.5927.0631.27
XGLM-564m49.6122.9119.6119.3843.9733.9923.4230.41
Bloom-1b753.604.8121.4218.9643.9734.8923.0528.67
TTL-160m53.362.5821.8418.7543.9736.8822.6028.56
OPT-125m39.772.0021.8417.4243.9747.0422.7827.83
Pythia-16033.3312.8116.1316.6650.3641.0922.8227.60
OLMo-1b34.129.2818.9220.2943.9741.3322.9627.26
Bloom-560m33.338.4818.9219.0343.9737.0723.0526.26
Pythia-410m33.334.8019.4719.4543.9733.3323.0125.33
OPT-350m33.333.6520.7217.3544.7133.3323.0125.15
GPT-2 small33.260.0010.4311.2043.5233.6813.1220.74
GPorTuguese33.333.8514.743.0128.8133.3321.2319.75
Samba-1.1B33.331.308.0710.2217.7235.7915.0317.35

Fine-Tuning Comparisons

To further evaluate the downstream capabilities of our models, we decided to employ a basic fine-tuning procedure for our TTL pair on a subset of tasks from the Poeta benchmark. We apply the same procedure for comparison purposes on both BERTimbau models, given that they are also LLM trained from scratch in Brazilian Portuguese and have a similar size range to our models. We used these comparisons to assess if our pre-training runs produced LLM capable of producing good results ("good" here means "close to BERTimbau") when utilized for downstream applications.

ModelsIMDBFaQuAD-NLIHateBrAssin2AgNewsAverage
BERTimbau-large93.5892.2691.5788.9794.1192.10
BERTimbau-small92.2293.0791.2887.4594.1991.64
TTL-460m91.6491.1892.2886.4394.4291.19
TTL-160m91.1490.0090.7185.7894.0590.34

All the shown results are the higher accuracy scores achieved on the respective task test sets after fine-tuning the models on the training sets. All fine-tuning runs used the same hyperparameters, and the code implementation can be found in the model cards of our fine-tuned models.

Cite as 🤗

@misc{correa24ttllama,
  title = {TeenyTinyLlama: open-source tiny language models trained in Brazilian Portuguese},
  author = {Corr{\^e}a, Nicholas Kluge and Falk, Sophia and Fatimah, Shiza and Sen, Aniket and De Oliveira, Nythamar},
  journal={arXiv preprint arXiv:2401.16640},
  year={2024}
}

@misc{correa24ttllama,
  doi = {10.1016/j.mlwa.2024.100558},
  url = {https://www.sciencedirect.com/science/article/pii/S2666827024000343},
  title = {TeenyTinyLlama: open-source tiny language models trained in Brazilian Portuguese},
  author = {Corr{\^e}a, Nicholas Kluge and Falk, Sophia and Fatimah, Shiza and Sen, Aniket and De Oliveira, Nythamar},
  journal={Machine Learning With Applications},
  publisher = {Springer},
  year={2024}
}

Funding

This repository was built as part of the RAIES (Rede de Inteligência Artificial Ética e Segura) initiative, a project supported by FAPERGS - (Fundação de Amparo à Pesquisa do Estado do Rio Grande do Sul), Brazil.

License

TeenyTinyLlama-460m is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей