/ Модель

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

Лицензия
Gemma
Базовая модель
translategemma-4b-it
Библиотека
transformers
Опубликована
19 окт 2026

nordlyd-translate-gemma4B-nov26preview

ПереводТекст → текст4 профессии

Предварительная модель Национальной библиотеки Норвегии для перевода текста между датским, английским, букмолом, шведским и между букмолом и нюнорском.

31скачиваний за 30 дней2лайкавеса обновлены19 ноя 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Nordlyd Translate Gemma 4B — предварительная модель для перевода текста, разработанная Национальной библиотекой Норвегии на основе Google TranslateGemma-4B-IT. Модель дообучена на переводных данных с последующим обучением с подкреплением. Она предназначена для перевода между датским, английским, норвежским букмолом и шведским, а также между букмолом и нюнорском.

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

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

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

  • перевод датских текстов на английский, букмол или шведский
  • перевод английских текстов на датский, букмол или шведский
  • перевод букмола на датский, английский, шведский или нюнорск
  • перевод шведских текстов на датский, английский или букмол
  • перевод нюнорска на букмол и обратно

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Nordlyd Translate Gemma 4B · November 2026 preview

Nordlyd is a family of speech and language models developed by the National Library of Norway. This 4B text translation model supports all translation directions among Danish, English, Norwegian Bokmål, and Swedish, plus translation between Bokmål and Nynorsk. It is based on Google's TranslateGemma-4B-IT, with supervised fine-tuning followed by reinforcement learning.

Preview release: evaluate the model on your own texts before relying on its translations. It can omit content, alter names or numbers, and choose wording that differs from your intended meaning.

Contents

Model at a glance

ItemDetails
DeveloperNational Library of Norway
Modelnordlyd-translate-gemma4B-nov26preview
Base modelgoogle/translategemma-4b-it
Model size4B
TaskText translation, including Bokmål ↔ Nynorsk
Translation directions14; see supported directions
InferenceHugging Face Transformers
Example hardwareCUDA GPU with bfloat16 support; see setup
AccessPublic download; no access approval required
TermsGemma Terms of Use

Supported translation directions

SourceSupported targets
DanishEnglish, Norwegian Bokmål, Swedish
EnglishDanish, Norwegian Bokmål, Swedish
Norwegian BokmålDanish, English, Swedish, Norwegian Nynorsk
SwedishDanish, English, Norwegian Bokmål
Norwegian NynorskNorwegian Bokmål

These are 14 directed translation tasks, not 14 languages. Nynorsk ↔ English, Danish, or Swedish is not included in this release's training and evaluation coverage.

Use the following language codes with the examples below:

Language or written standardCode
Danishda
Englishen
Norwegian Bokmålno
Norwegian Nynorsknn
Swedishsv

Use no for Bokmål to follow the Norwegian prompt naming in the earlier model's usage example. These are the translation template's language codes; the nob, nno, and eng arguments used by the Nordlyd ASR helper are a separate interface.

Quick start: translate a sentence

1. Prepare your environment

The example uses a CUDA-capable NVIDIA GPU with bfloat16 support and a compatible PyTorch installation. Install PyTorch using its installation guide, then create or activate an isolated Python environment for the remaining dependencies.

For example, with Python 3.12:

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
# Install the appropriate PyTorch build in this environment first.
python -m pip install "transformers>=5.6.1" accelerate sentencepiece pillow huggingface_hub

The checkpoint was exported with Transformers 5.6.1; the installation command uses that as its starting version. A minimum GPU memory requirement and CPU or Apple Silicon performance have not been established for this preview.

Check that PyTorch can see the GPU:

python -c "import torch; print('CUDA available:', torch.cuda.is_available())"

Expected result: CUDA available: True for the GPU workflow shown here.

2. Model download

The model and processor files are publicly downloadable from Hugging Face. No access approval or login is required. The Python example below downloads and caches them automatically on first use; you do not need to clone the repository. See local download if you prefer to download the files in advance.

3. Translate Danish into Bokmål

Save this as translate_example.py and run python translate_example.py. The translate function reuses the loaded model, so you can call it for several texts without reloading the weights.

import torch
from transformers import AutoProcessor, AutoModelForImageTextToText

MODEL_ID = "NbAiLab/nordlyd-translate-gemma4B-nov26preview"

processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForImageTextToText.from_pretrained(
    MODEL_ID,
    dtype=torch.bfloat16,
    device_map="auto",
)
model.eval()


def translate(text, source_lang, target_lang):
    messages = [{
        "role": "user",
        "content": [{
            "type": "text",
            "source_lang_code": source_lang,
            "target_lang_code": target_lang,
            "text": text,
        }],
    }]
    inputs = processor.apply_chat_template(
        messages,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
    ).to(model.device)
    input_length = inputs["input_ids"].shape[-1]
    with torch.inference_mode():
        generated = model.generate(
            **inputs,
            max_new_tokens=512,
            do_sample=False,
        )
    return processor.decode(
        generated[0][input_length:],
        skip_special_tokens=True,
    ).strip()


print(translate(
    "Jordskælv og tsunami raserer ø i Indonesien.",
    source_lang="da",
    target_lang="no",
))

Expected result: a Bokmål translation printed as plain text, without the prompt or additional commentary. A possible translation is:

Jordskjelv og tsunami raserer øy i Indonesia.

The first run also downloads and loads the model, so it takes longer than subsequent runs. Review the result against the source; greedy decoding (do_sample=False) does not guarantee accuracy.

Bokmål, Nynorsk, and NormForm

For Bokmål → Nynorsk, change the source and target codes. Add this call to the script above:

print(translate(
    "Vi skal være hjemme og sette oss ned for å lese.",
    source_lang="no",
    target_lang="nn",
))

For the reverse direction, use source_lang="nn" and target_lang="no".

Prompt format

Use the repository's processor and bundled chat template. For text translation, provide a user message with exactly one content item:

FieldValue
role"user"
type"text"
source_lang_codeSource language code, such as "da"
target_lang_codeTarget language code, such as "no"
textOnly the source text to translate

The template builds the translation instruction and language names for you. Do not put a complete translation instruction inside text, or omit the language-code fields. Call apply_chat_template(..., add_generation_prompt=True) and decode only the newly generated tokens, as in the quick start.

TranslateGemma uses an image-text model class and processor, which is why the example loads AutoModelForImageTextToText. This card documents text translation; inherited image-processing components do not establish evaluated image-translation capability for this fine-tuned checkpoint.

The bundled template contains more language names than this release's 14 supported directions. A code being accepted by the template does not establish training or evaluation coverage for that pair. See the base model card for upstream template documentation.

Long texts and troubleshooting

Translate sentences or manageable paragraphs rather than entire documents. The earlier model's recipe used a 512-token completion limit; the quick start retains that budget. The new checkpoint's card does not establish a validated maximum document length.

SymptomWhat to check
Model download failsCheck your network connection and the repository ID.
Model class or configuration is not recognisedCheck the installed Transformers version against the checkpoint's exported version (5.6.1).
Missing language-code errorInclude source_lang_code and target_lang_code in the single text content item.
The prompt appears in the outputDecode tokens after the input length, rather than the full generated sequence.
The translation stops earlyCheck whether generation exhausted max_new_tokens; treat the result as potentially incomplete. Split the source into shorter units.
Repetition, omissions, or changed numbersCompare with the source and try shorter, coherent excerpts. The training rewards do not guarantee error-free output.
GPU runs out of memoryShorten the input, reduce batch size if your application batches requests, and check device placement.

Increasing the output budget is not a substitute for checking a translation. When splitting documents, preserve paragraph order and review names, terminology, and context across segment boundaries.

Evaluation

The following are the new checkpoint's reported scores, using full test sets and greedy decoding. BLEU measures overlap with reference wording; chrF measures character-level overlap. Higher is better for both, but neither establishes that an individual translation is correct.

Evaluation setBLEUchrF
FLORES+ devtest · 12 directions45.8269.44
NTREX · 12 directions36.6662.53
National Library of Norway gold dev · 12 directions68.8685.10
NPK/NDLA test87.2894.52

The new checkpoint's card does not report human evaluation. Automatic evaluation leaves terminology, register, semantic errors, and domain-specific behaviour to be assessed for the intended use.

Training and provenance

The model starts from google/translategemma-4b-it and uses two training stages:

StageReported settings
Supervised fine-tuning (SFT)Learning rate 8e-6, batch size 128, bfloat16. The checkpoint used to start GRPO was step 70,000, epoch 1.91.
Group Relative Policy Optimization (GRPO)20,000 steps using TRL and vLLM; learning rate 2e-6, cosine schedule, 500 warmup steps, 6 generations per prompt.

The Bokmål ↔ Nynorsk portion contains 807,164 parallel pairs from the CC0 NPK/NDLA dataset, used in both directions. Both sides of each retained pair are CC0-licensed. The remaining language pairs use the National Library of Norway's gold parallel corpus, as in the earlier iteration.

GRPO uses 49,152 gold prompts plus 4,096 CC0 prompts for each Bokmål–Nynorsk direction. Its reward components are:

RewardWeight
Chunked xCOMET-XL1.0
chrF0.5
Repetition0.2
Numeric stability0.2

The CC0 restriction describes the Bokmål–Nynorsk training subset. It does not mean that all training data or the model weights are CC0.

Local download

To download the model and processor for local loading:

hf download NbAiLab/nordlyd-translate-gemma4B-nov26preview \
  --local-dir ./nordlyd-translate-gemma4B-nov26preview

Then set MODEL_ID = "./nordlyd-translate-gemma4B-nov26preview" in the quick start. For repeatable experiments, record the model revision and package versions; use --revision COMMIT to download a specific snapshot.

Limitations and responsible use

  • Meaning and factual details: translations can omit or add material, change names or numbers, or alter tone. Check important content against the source.
  • Language coverage: Nynorsk is covered through Bokmål ↔ Nynorsk. Direct Nynorsk translation with English, Danish, or Swedish is outside the reported coverage.
  • Domain variation: reported general-domain scores are lower than the gold development-set scores. Evaluate your domain rather than assuming the highest score applies to it.
  • Long documents: segment longer texts and check consistency across excerpts. A large inherited context window does not establish validated document-level translation quality.
  • Task scope: this is a translation model. General conversation, instruction following, and image translation are not evaluated by this card.

Handle source texts and translations according to your organisation's privacy and data-handling requirements. Use human review where translation errors could affect people.

License, feedback, and acknowledgements

This model is derived from TranslateGemma and is subject to the Gemma Terms of Use. The CC0 status of the Bokmål–Nynorsk training pairs is separate from the terms governing the model.

Report reproducible issues through this repository's Community tab. Include the model revision, package versions, language direction, generation settings, source text, and unexpected output. Share text only when you have permission to do so. For issues that cannot be described publicly, email ai-lab@nb.no.

When referring to this preview, use Nordlyd Translate Gemma 4B — November 2026 preview, National Library of Norway, together with the repository and revision used.

Nordlyd is a research project at the National Library of Norway. The National Library of Norway retains full ownership of the models and associated research outputs. Research contributions were made by Phoebe Parsons, Freddy Wetjen, Thea Tollersud, and Per Egil Kummervold, who take responsibility for any remaining errors and shortcomings.

We would like to acknowledge Sigma2 for providing computational and storage resources on the Olivia/LUMI HPC system under project NN30001K.

The model builds on Google's TranslateGemma. Training uses Hugging Face TRL for GRPO and Unbabel XCOMET-XL as a reward model.

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
6d294b9

0 моделей