/ Модель

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

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

TeenyTinyLlama-460m-Chat

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

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

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

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

TeenyTinyLlama-460m-Chat — чат-версия компактной языковой модели TeenyTinyLlama, разработанной для бразильского португальского. Это плотная авторегрессионная модель семейства Llama с 435,4 млн параметров, дообученная на Instruct-Aira Dataset версии 2.0. Она принимает текстовые запросы и генерирует текст; родной контекст составляет 2048 токенов.

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

В README отмечены риски галлюцинаций, токсичных и предвзятых ответов, ненадёжной генерации кода и повторов. Качество не гарантирует надёжность для прикладных сценариев; перед адаптацией следует оценить риски и смещения. Модель распространяется по лицензии Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

TeenyTinyLlama-460m-Chat

TeenyTinyLlama is a pair of small foundational models trained in Brazilian Portuguese.

This repository contains a version of TeenyTinyLlama-460m (TeenyTinyLlama-460m-Chat) fine-tuned on the Instruct-Aira Dataset version 2.0.

Details

  • Number of Epochs: 3
  • Batch size: 4
  • Optimizer: torch.optim.AdamW (warmup_steps = 1e3, learning_rate = 1e-5, epsilon = 1e-8)
  • GPU: 1 NVIDIA A100-SXM4-40GB
  • Carbon emissions stats are logged in this file.

This repository has the source code used to train this model.

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.

Usage

The following special tokens are used to mark the user side of the interaction and the model's response:

<instruction>What is a language model?</instruction>A language model is a probability distribution over a vocabulary.</s>

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

tokenizer = AutoTokenizer.from_pretrained('nicholasKluge/TeenyTinyLlama-460m-Chat')
model = AutoModelForCausalLM.from_pretrained('nicholasKluge/TeenyTinyLlama-460m-Chat')

model.eval()
model.to(device)

question =  input("Entre seu prompt aqui: ")

inputs = tokenizer("<instruction>" + question + "</instruction>", return_tensors="pt").to(device)

responses = model.generate(**inputs, num_return_sequences=2)

print(f"Pergunta: 👤 {question}\n")

for i, response in  enumerate(responses):
  print(f'Resposta {i+1}: 🤖 {tokenizer.decode(response, skip_special_tokens=True).replace(question, "")}')

The model will output something like:

>>>Question: 👤 Qual a capital do Brasil?

>>>Response 1: 🤖 A capital do Brasil é Brasília.
>>>Response 2: 🤖 A capital do Brasil é Brasília.

The chat template for this model is:

{{bos_token}}
{% for message in messages %}
    {% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}
        {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
    {% endif %}
    {% if message['role'] == 'user' %}
        {{ '<instruction>' + message['content'].strip() + '</instruction>'}}
    {% elif message['role'] == 'assistant' %}
        {{ message['content'].strip() + eos_token}}
    {% else %}
        {{ raise_exception('Only user and assistant roles are supported!') }}
    {% endif %}
{% endfor %}

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-Chat is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей