/ Модель

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

Контекст
2 048 токенов
Параметры
3,4 млрд
Лицензия
Apache 2.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
12 июн 2023

llama-3b-finnish

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

Авторегрессионная модель Llama с 3,4 млрд параметров для генерации и продолжения текста на финском языке.

105скачиваний за 30 дней4лайкавеса обновлены3 июл 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Finnish-NLP разработала llama-3b-finnish — плотную авторегрессионную модель семейства Llama с 3,4 млрд параметров по метаданным (в README указано 3,6 млрд). Модель обучена с нуля на финских текстах для предсказания следующего токена; контекст составляет 2048 токенов. Для токенизации используется BPE на SentencePiece с словарём из 64 256 токенов, регистр учитывается.

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

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

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

This is the Llama-3b for Finnish model described in the paper Scaling Data-Constrained Language Models.

Llama-3b for Finnish

Pretrained Llama model on Finnish language using a causal language modeling (CLM) objective. Llama model was introduced in this paper and first released at this page.

There are two different sized Llama models, all pretrained from scratch for 131B tokens:

ModelContext lengthLayersDimHeadsParams
llama-3b-finnish2048263200323.6B
llama-7b-finnish2048324096327.0B

Note: this model is pretrained, not fine-tuned for instruction following or chat use. For instruction tuned models, you can check models listed in this collection: https://huggingface.co/collections/Finnish-NLP/instruction-tuned-models-65c08db79fa020161be2e942

Model description

Finnish Llama is a GPT-style model pretrained on a very large corpus of Finnish data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to predict the next word in sentences.

More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence, shifted one token (word or piece of word) to the right. The model uses internally a mask-mechanism to make sure the predictions for the token i only uses the inputs from 1 to i but not the future tokens.

This way, the model learns an inner representation of the Finnish language that can then be used to extract features useful for downstream tasks. The model is best at what it was pretrained for however, which is generating texts from a prompt.

Intended uses & limitations

This model was only pretrained in a self-supervised way excluding any supervised training. You can use the this model for text generation or fine-tune it to a downstream task, like instruction following. Fine-tuning is recommended to get better results.

How to use

Here is an example of using this model in PyTorch with some generation arguments you can modify:

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Finnish-NLP/llama-3b-finnish")
model = AutoModelForCausalLM.from_pretrained("Finnish-NLP/llama-3b-finnish")

inputs = tokenizer("Olipa kerran tekoälylaama", return_tensors="pt")
generated_ids = model.generate(inputs.input_ids, **{
      "temperature": 0.8,
      "penalty_alpha": 0.6,
      "top_k": 4,
      "do_sample": True,
      "repetition_penalty": 1.2,
      "min_length": 20,
      "max_length": 2048
    })
generated_text = tokenizer.batch_decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]

Limitations and bias

The training data used for this model contains a lot of content from the internet, which is far from neutral. Therefore, the model can have biased predictions. This bias will also affect all fine-tuned versions of this model.

To reduce toxic content, training data was filtered with a toxicity classifier but it cannot truly eliminate all toxic text.

Training data

This Finnish Llama model was pretrained on the combination of 12 datasets:

Raw datasets were automatically cleaned to filter out bad quality and non-Finnish examples. Also, a perplexity score was calculated for all texts with a KenLM model which was trained with very clean Finnish texts only. This perplexity score can then be used to determine how "clean" Finnish language the text contains. To reduce toxic text, we used Finnish toxicity classifier TurkuNLP/bert-large-finnish-cased-toxicity released by TurkuNLP to classify all text examples. Classified toxicity label scores can then be used to determine how toxic the text is.

All datasets were concatenated and the whole dataset deduplicated. Top 95% perplexity score was used as a filtering threshold to filter out the worst quality 5% of texts. To reduce amount of toxic content, the dataset was filtered to include text examples having lower than 80% score for the toxicity labels "label_identity_attack", "label_insult", "label_threat" and "label_severe_toxicity".

Finally, 20,000 text examples from each of the Wikipedia, Yle, STT, Suomi24, and Reddit datasets were randomly selected for evaluation dataset in addition to the existing validation split of the mc4_3.1.0_fi_cleaned dataset.

The final training dataset had 19 billion words and the evaluation dataset had 25 million words. After tokenization, the training dataset had 28 billion tokens and the evaluation dataset had 38 million tokens. Training dataset is divided between different datasets as follows:

DatasetWordsRatio
mc4_3.1.0_fi_cleaned11.462B60.7%
oscar_2301_fi_cleaned3.295B17.4%
Suomi243.045B16.1%
multilingual_cc_news0.295B1.6%
STT0.249B1.3%
Yle0.201B1.1%
Reddit_fi_2006_20220.138B0.7%
wikipedia_20230501_fi_cleaned0.096B0.5%
Project Lönnrot0.078B0.4%
Finnish parliament speeches0.021B0.1%
fi-news-corpus0.004B0.1%
TOTAL18.884B100.0%

Training procedure

Preprocessing

Texts are tokenized using Byte Pair Encoding (BPE) based on sentencepiece with a vocabulary size of 64,256. Inputs are sequences of 2048 consecutive tokens. Texts are not lower cased so this model is case-sensitive: it makes a difference between finnish and Finnish.

Pretraining

The model was trained on TPUv4-32 VM, sponsored by the Google TPU Research Cloud. The model was trained for 131B tokens which is about 4.7 epochs of data, inspired by the findings of this paper. The optimizer used was a Lion, linear learning rate warmup for 2K steps to a peak learning rate of 3e-5, and then cosine decay to 3e-6.

Training was conducted with a slightly modified Jax/Flax based EasyLM framework, and inspired by the OpenLLaMA project.

Evaluation results

This model was evaluated using FIN-bench by TurkuNLP with zero-shot setting, but the evaluation script had some problems running succesfully, so the results reported below should perhaps be viewed with some caution.

llama-3b-finnish:

TaskVersionMetricValueStderr
bigbench_analogies0multiple_choice_grade0.3308±0.0414
bigbench_arithmetic_1_digit_addition0multiple_choice_grade0.2000±0.0402
bigbench_arithmetic_1_digit_division0multiple_choice_grade0.3478±0.1015
bigbench_arithmetic_1_digit_multiplication0multiple_choice_grade0.2500±0.0435
bigbench_arithmetic_1_digit_subtraction0multiple_choice_grade0.1800±0.0386
bigbench_arithmetic_2_digit_addition0multiple_choice_grade0.0900±0.0288
bigbench_arithmetic_2_digit_division0multiple_choice_grade0.2200±0.0416
bigbench_arithmetic_2_digit_multiplication0multiple_choice_grade0.0100±0.0100
bigbench_arithmetic_2_digit_subtraction0multiple_choice_grade0.0900±0.0288
bigbench_arithmetic_3_digit_addition0multiple_choice_grade0.0000±0.0000
bigbench_arithmetic_3_digit_division0multiple_choice_grade0.1500±0.0359
bigbench_arithmetic_3_digit_multiplication0multiple_choice_grade0.0000±0.0000
bigbench_arithmetic_3_digit_subtraction0multiple_choice_grade0.0100±0.0100
bigbench_arithmetic_4_digit_addition0multiple_choice_grade0.0000±0.0000
bigbench_arithmetic_4_digit_division0multiple_choice_grade0.1500±0.0359
bigbench_arithmetic_4_digit_multiplication0multiple_choice_grade0.0000±0.0000
bigbench_arithmetic_4_digit_subtraction0multiple_choice_grade0.0100±0.0100
bigbench_arithmetic_5_digit_addition0multiple_choice_grade0.0000±0.0000
bigbench_arithmetic_5_digit_division0multiple_choice_grade0.0900±0.0288
bigbench_arithmetic_5_digit_multiplication0multiple_choice_grade0.0000±0.0000
bigbench_arithmetic_5_digit_subtraction0multiple_choice_grade0.0000±0.0000
bigbench_cause_and_effect_one_sentence0multiple_choice_grade0.4510±0.0704
bigbench_cause_and_effect_one_sentence_no_prompt0multiple_choice_grade0.7255±0.0631
bigbench_cause_and_effect_two_sentences0multiple_choice_grade0.5294±0.0706
bigbench_emotions0multiple_choice_grade0.2437±0.0340
bigbench_empirical_judgments0multiple_choice_grade0.3232±0.0472
bigbench_general_knowledge0multiple_choice_grade0.1286±0.0403
bigbench_hhh_alignment_harmless0multiple_choice_grade0.3966±0.0648
bigbench_hhh_alignment_helpful0multiple_choice_grade0.3051±0.0605
bigbench_hhh_alignment_honest0multiple_choice_grade0.4068±0.0645
bigbench_hhh_alignment_other0multiple_choice_grade0.5814±0.0761
bigbench_intent_recognition0multiple_choice_grade0.0838±0.0105
bigbench_misconceptions0multiple_choice_grade0.5373±0.0432
bigbench_paraphrase0multiple_choice_grade0.4900±0.0354
bigbench_sentence_ambiguity0multiple_choice_grade0.5500±0.0648
bigbench_similarities_abstraction0multiple_choice_grade0.3553±0.0553

llama-7b-finnish:

| Task |Version| Metric |Value | |Stderr| |------------------------------------------------|------:|---------------------|-----:|---|-----:|
|bigbench_analogies | 0|multiple_choice_grade|0.2692|± |0.0391| |bigbench_arithmetic_1_digit_addition | 0|multiple_choice_grade|0.2600|± |0.0441| |bigbench_arithmetic_1_digit_division | 0|multiple_choice_grade|0.3043|± |0.0981| |bigbench_arithmetic_1_digit_multiplication | 0|multiple_choice_grade|0.2100|± |0.0409| |bigbench_arithmetic_1_digit_subtraction | 0|multiple_choice_grade|0.1300|± |0.0338| |bigbench_arithmetic_2_digit_addition | 0|multiple_choice_grade|0.0800|± |0.0273| |bigbench_arithmetic_2_digit_division | 0|multiple_choice_grade|0.2400|± |0.0429| |bigbench_arithmetic_2_digit_multiplication | 0|multiple_choice_grade|0.0300|± |0.0171| |bigbench_arithmetic_2_digit_subtraction | 0|multiple_choice_grade|0.1100|± |0.0314| |bigbench_arithmetic_3_digit_addition | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_3_digit_division | 0|multiple_choice_grade|0.1300|± |0.0338| |bigbench_arithmetic_3_digit_multiplication | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_3_digit_subtraction | 0|multiple_choice_grade|0.0300|± |0.0171| |bigbench_arithmetic_4_digit_addition | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_4_digit_division | 0|multiple_choice_grade|0.1300|± |0.0338| |bigbench_arithmetic_4_digit_multiplication | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_4_digit_subtraction | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_5_digit_addition | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_5_digit_division | 0|multiple_choice_grade|0.0800|± |0.0273| |bigbench_arithmetic_5_digit_multiplication | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_arithmetic_5_digit_subtraction | 0|multiple_choice_grade|0.0000|± |0.0000| |bigbench_cause_and_effect_one_sentence | 0|multiple_choice_grade|0.4510|± |0.0704| |bigbench_cause_and_effect_one_sentence_no_prompt| 0|multiple_choice_grade|0.7647|± |0.0600| |bigbench_cause_and_effect_two_sentences | 0|multiple_choice_grade|0.5098|± |0.0707| |bigbench_emotions | 0|multiple_choice_grade|0.3688|± |0.0383| |bigbench_empirical_judgments | 0|multiple_choice_grade|0.3434|± |0.0480| |bigbench_general_knowledge | 0|multiple_choice_grade|0.1429|± |0.0421| |bigbench_hhh_alignment_harmless | 0|multiple_choice_grade|0.3793|± |0.0643| |bigbench_hhh_alignment_helpful | 0|multiple_choice_grade|0.3051|± |0.0605| |bigbench_hhh_alignment_honest | 0|multiple_choice_grade|0.4068|± |0.0645| |bigbench_hhh_alignment_other | 0|multiple_choice_grade|0.5814|± |0.0761| |bigbench_intent_recognition | 0|multiple_choice_grade|0.1850|± |0.0148| |bigbench_misconceptions | 0|multiple_choice_grade|0.5373|± |0.0432| |bigbench_paraphrase | 0|multiple_choice_grade|0.5000|± |0.0354| |bigbench_sentence_ambiguity | 0|multiple_choice_grade|0.5333|± |0.0649| |bigbench_similarities_abstraction | 0|multiple_choice_grade|0.4474|± |0.0574|

Acknowledgements

This project would not have been possible without compute generously provided by Google through the TPU Research Cloud.

Team Members

Feel free to contact us for more details 🤗

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей