📋 Model Description


language:
  • 'no'
  • nb
  • nn
inference: true tags:
  • mistral
  • gpt
  • generative
license: apache-2.0 pipeline_tag: text-generation datasets:
  • uonlp/CulturaX
  • NbAiLab/NCC
  • vikp/starcoder_filtered

NorMistral-7b-warm

NorMistral-7b-warm is a large Norwegian language model initialized from Mistral-7b-v0.1 and
continuously pretrained on a total of 260 billion subword tokens (using six repetitions of open Norwegian texts).

This model is a part of the NORA.LLM family developed in collaboration between the Language Technology Group at the University of Oslo, the High Performance Language Technologies (HPLT) project, the National Library of Norway, and the University of Turku.
All the models are pre-trained on the same dataset and with the same tokenizer.
NorMistral-7b-warm has over 7 billion parameters and is based on the Mistral architecture.

The NORA.LLM language model family includes (as of now):

*Disclaimer: This model is pretrained on raw (mostly web-based) textual data.
It is not finetuned to follow instructions, and it can generate harmful completions after inappropriate user prompts.
It is primarily intended for research purposes.*

_

Pretraining corpus

The model is continually pretrained exclusively on publicly available data. We combine the resources from the public part of the NCC corpus, from the cleaned HPLT corpus, and from CulturaX.
This resulted in over 34B subword tokens of Norwegian (Bokmål or Nynorsk) in total, which amounts to about 26.7B whitespace-separated tokens.
We also augment the corpus with Starcoder; 20% of the 260B tokens are sampled from this code corpus.
The natural language data is repeated six times to get the pretraining budget of 260B tokens, in accordance with findings from Muennighoff et al. (2023).

_

Model details

Model Developers: Language Technology Group at the University of Oslo.

Variations: NorMistral is currently published as two 7B variants: one trained entirely from scratch and one warm-started from the Mistral model.

Input: Textual input.

Output: Generated text.

Model Architecture: NorMistral is an auto-regressive language model that uses an optimized transformer architecture based on the Mistral/Llama language models.

Training DataParamsContext LengthTokensLR
NorMistral-7b-warmNCC+HPLT+CulturaX+Starcoder7B2k260B1.0 x 10-4
NorMistral-7b-scratchNCC+HPLT+CulturaX+Starcoder7B2k260B3.0 x 10-4
NorBLOOM-7b-scratchNCC+HPLT+CulturaX+Starcoder7B2k260B1.2 x 10-4
Tokenizer: Byte-based BPE tokenizer trained on the same Norwegian corpus as this model. The vocabulary size is 32,768 tokens.

Training FLOPs The approximate amount is 1.22e+22 FLOPs; calculated as in Chowdhery et al. (2022).

Model Dates: The models were pretrained between December 2023 and January 2024.

Status: These are only pretrained language models; instruction-finetuned models will follow soon.

License: Apache-2.0

Research Paper: Forthcoming

_

Initial evaluation

*Disclaimer: our model evaluation is an ongoing phase and is not claimed to be exhaustive. We provide our initial evaluation results on standard natural language understanding and generation tasks, and our evaluation design will be extended.
The user should perform evaluation for their particular model application scenario, including safety and bias evaluations.*

The perplexity on the heldout validation set from the Norwegian Colossal Corpus (NCC) is 7.43 and the final training perplexity is 4.76.

Our initial downstream evaluation is conducted on reading comprehension, sentiment analysis and machine translation tasks using open-source peer-reviewed datasets and benchmarks in native Norwegian.
We release our codebase here. We compare against other pretrained generative language models that officially support Norwegian: NB-GPT-J, GPT-Sw3 6.7B, GPT-Sw3 6.7B v2, and Falcon-7B; we also include evaluation of Mistral-7b-v0.1.

Sentiment analysis

NoReC (Øvrelid et al., 2020) is a dataset for sentence-level sentiment analysis derived from the Norwegian Review Corpus (Velldal et al., 2018).
We use the binary formulation of this task (positive vs. negative).


Method (click to expand)

  • Evaluation setting: zero-shot and few-shot perplexity-based evaluation.
  • Prompt:
    "Tekst: {text}\nSentiment:{label}"
    , where the
    is either "positiv" or "negativ".
  • Few-shot results show the average scores across 5 repetitions
  • Evaluation script: https://github.com/ltgoslo/norallm/blob/main/initialevaluation/sentimentanalysis.py
  • Performance metric: macro-averaged F1-score.


Macro-averaged F1-scores on the sentence-level sentiment analysis task (NoReC)

Model0-shot (macro F1)1-shot (macro F1)16-shot (macro F1)
NorMistral-7b-warm60.677.887.3
NorMistral-7b-scratch47.362.280.1
NorBLOOM-7b75.773.865.5
NB-GPT-J48.456.565.2
GPT-Sw3-6.7B61.572.276.5
GPT-Sw3-6.7B-v242.469.183.4
Falcon-7B53.361.674.9
Mistral-7B-v0.170.272.984.8

Reading comprehension

NorQuAD (Ivanova et al., 2023) is a dataset for extractive question answering in Norwegian designed similarly to SQuAD (Rajpurkar et al., 2016).


Method (click to expand)

  • Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
  • Prompt:
    "Tittel: {title}\n\nTekst: {text}\n\nSpørsmål: {question}\n\nSvar:{answer}"
    Based on Brown et al. (2020).
  • Few-shot results show the average scores across 5 repetitions
  • Evaluation script: https://github.com/ltgoslo/norallm/blob/main/initialevaluation/norquad.py
  • Performance metrics: macro-averaged F1-score and exact match (EM).


Performance results on the extractive question answering task (NorQuAD)

Model0-shot (F1/EM)1-shot (F1/EM)2-shot (F1/EM)
NorMistral-7b-warm48.6/24.863.6/40.066.5/43.8
NorMistral-7b-scratch34.0/15.746.5/25.848.5/27.8
NorBLOOM-7b35.0/13.347.7/28.049.3/30.1
NB-GPT-J24.4/6.832.8/11.635.0/12.3
GPT-Sw3-6.7B46.5/22.055.9/32.058.1/34.3
GPT-Sw3-6.7B-v246.9/22.561.1/38.966.0/44.5
Falcon-7B15.8/7.027.3/13.927.4/13.1
Mistral-7B-v0.146.4/22.464.9/41.171.7/49.4

Grammatical error correction

ASK-RAW is dataset for Norwegian grammatical error correction (GEC) created by Matias Jentoft (2023).


Method (click to expand)

  • Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
  • Prompt:
    "Her er eksempler på perfekt korrigering av grammatiske feil:\n\nTekst: {sourcetext}\nKorreksjon:{targettext}"
  • Few-shot results show the average scores across 5 repetitions
  • Evaluation script: https://github.com/ltgoslo/norallm/blob/main/initialevaluation/gec.py
  • Performance metrics: the evaluation metric uses ERRANT, which identifies edit-spans and then calculates the F_{0.5} scores between the gold edits and predicted edits.


Results on the ASK corpus (ERRANT F{0.5})

Model0-shot (F0.5)1-shot (F0.5)32-shot (F0.5)
NorMistral-7b-warm40.841.848.5
NorMistral-7b-scratch22.128.842.1
NorBLOOM-7b8.724.532.0
NB-GPT-J9.128.230.6
GPT-Sw3-6.7B30.542.950.6
GPT-Sw3-6.7B-v240.643.449.8
Falcon-7B10.812.415.5
Mistral-7B-v0.126.027.430.6

Machine translation

Tatoeba (Tiedemann, 2020) is a benchmark for machine translation, which includes hundreds of language pairs. We consider six language pairs (English <-> Bokmål, English <-> Nynorsk, and Bokmål <-> Nynorsk).


Method (click to expand)

  • Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
  • Prompt:
    "{sourcelanguage}: {sourcetext}\n{targetlanguage}:{targettext}"
    , where the
    and
    are
    ,
    ål
    , or
    . Based on Garcia et al. (2023).
  • Few-shot results show the average scores across 5 repetitions
  • Evaluation script: https://github.com/ltgoslo/norallm/blob/main/initialevaluation/machinetranslation.py
  • Performance metrics: BLEU (Papineni et al., 2002) and chrF++ (Popović, 2015).


English → Norwegian Bokmål

Model0-shot (BLEU/chrF++)1-shot (BLEU/chrF++)5-shot (BLEU/chrF++)
NorMistral-7b-warm55.8/70.756.7/71.557.7/72.4
NorMistral-7b-scratch46.4/62.950.4/66.352.1/67.6
NorBLOOM-7b37.1/53.650.1/65.852.0/67.6
NB-GPT-J8.6/39.135.9/64.547.2/68.7
GPT-Sw3-6.7B21.8/55.254.5/69.658.6/73.2
GPT-Sw3-6.7B-v220.6/53.251.2/66.658.4/73.0
Falcon-7B19.1/40.120.6/41.822.1/43.6
Mistral-7B-v0.132.5/51.935.4/55.136.3/56.0


English → Norwegian Nynorsk

Model0-shot (BLEU/chrF++)1-shot (BLEU/chrF++)5-shot (BLEU/chrF++)
NorMistral-7b-warm43.6/62.044.2/63.244.3/63.7
NorMistral-7b-scratch38.0/56.939.2/57.940.7/59.3
NorBLOOM-7b35.6/54.736.6/56.338.1/57.4
NB-GPT-J1.7/14.76.3/34.135.2/60.4
GPT-Sw3-6.7B13.4/44.343.6/62.544.5/63.5
GPT-Sw3-6.7B-v214.8/45.543.7/62.344.0/63.6
Falcon-7B6.4/28.68.3/30.59.3/32.1
Mistral-7B-v0.111.6/35.713.5/38.715.0/40.0


Norwegian Bokmål → English

Model0-shot (BLEU/chrF++)1-shot (BLEU/chrF++)5-shot (BLEU/chrF++)
NorMistral-7b-warm56.7/70.657.7/71.758.5/72.2
NorMistral-7b-scratch48.1/62.951.5/66.652.6/67.6
NorBLOOM-7b46.0/61.551.3/66.751.7/66.9
NB-GPT-J23.9/55.332.3/63.148.5/68.7
GPT-Sw3-6.7B47.9/67.852.4/70.650.0/70.7
GPT-Sw3-6.7B-v238.8/59.649.0/68.650.7/70.6
Falcon-7B42.4/58.547.3/62.348.6/63.3
Mistral-7B-v0.153.8/68.254.6/69.056.9/70.7


Norwegian Nynorsk → English

Model0-shot (BLEU/chrF++)1-shot (BLEU/chrF++)5-shot (BLEU/chrF++)
NorMistral-7b-warm55.1/68.455.5/69.556.0/69.8
NorMistral-7b-scratch47.1/61.949.4/64.252.3/66.2
NorBLOOM-7b45.0/59.348.3/64.049.0/64.7
NB-GPT-J2.9/19.510.1/41.044.4/66.9
GPT-Sw3-6.7B47.8/66.249.1/68.149.6/69.4
GPT-Sw3-6.7B-v246.3/67.548.9/69.358.2/72.8
Falcon-7B21.6/40.631.7/47.436.6/57.1
Mistral-7B-v0.140.7/57.146.2/60.749.9/63.8


Norwegian Bokmål → Norwegian Nynorsk

Model0-shot (BLEU/chrF++)1-shot (BLEU/chrF++)5-shot (BLEU/chrF++)
NorMistral-7b-warm75.8/87.574.0/86.975.3/87.5
NorMistral-7b-scratch38.0/56.939.2/57.940.7/59.3
NorBLOOM-7b71.5/84.470.1/84.171.9/85.1
NB-GPT-J6.6/35.59.6/41.026.0/64.7
GPT-Sw3-6.7B63.6/82.874.7/86.075.8/86.9
GPT-Sw3-6.7B-v257.5/81.175.3/86.776.7/87.6
Falcon-7B28.7/59.229.8/60.832.1/62.3
Mistral-7B-v0.132.0/62.232.9/62.635.2/63.9


Norwegian Nynorsk → Norwegian Bokmål

Model0-shot (BLEU/chrF++)1-shot (BLEU/chrF++)5-shot (BLEU/chrF++)
NorMistral-7b-warm88.1/93.689.2/94.389.3/94.6
NorMistral-7b-scratch85.1/91.486.6/92.487.4/93.0
NorBLOOM-7b78.7/88.584.2/90.787.4/93.0
NB-GPT-J2.7/18.56.9/35.652.9/84.3
GPT-Sw3-6.7B652.3/82.486.1/92.587.8/93.6
GPT-Sw3-6.7B-v272.0/88.686.1/92.588.2/93.9
Falcon-7B36.7/61.638.3/63.545.8/68.1
Mistral-7B-v0.157.0/74.859.9/77.562.6/79.1

_

Hardware and Software

Training Factors: The models were pretrained using the Megatron-DeepSpeed library on the LUMI cluster in Finland.

Carbon Footprint: Pretraining one model took approximately 70k GPU hours of computation on AMD MI250X GPUs (assuming 2 GPUs per one AMD MI250X device), each of which draws 500W.
LUMI is one of the most eco-efficient data centers in the world, and its energy consumption is covered 100% with renewable electricity.

_

Example usage

Let's try to use this model for English-to-Norwegian machine translation using simple zero-shot prompting:

from transformers import AutoTokenizer, AutoModelForCausalLM

First, we will have to import the tokenizer and the language model

tokenizer = AutoTokenizer.from_pretrained("norallm/normistral-7b-warm") model = AutoModelForCausalLM.from_pretrained("norallm/normistral-7b-warm").cuda().eval()

Now we will define the zero-shot prompt template

prompt = """Engelsk: {0} Bokmål:"""

A function that will take care of generating the output

@torch.no_grad() def generate(text): text = prompt.format(text) inputids = tokenizer(text, returntensors='pt').input_ids.cuda() prediction = model.generate( input_ids, maxnewtokens=64, do_sample=False, eostokenid=tokenizer('\n').input_ids ) return tokenizer.decode(prediction[0, input_ids.size(1):]).strip()

Now you can simply call the generate function with an English text you want to translate:

generate("I'm super excited about this Norwegian NORA model! Can it translate these sentences?")

> this should output: 'Jeg er super spent på denne norske NORA modellen! Kan den oversette disse setningene?'

Example usage on a GPU with ~16GB VRAM (try for yourself in Google Colab)

Install bitsandbytes if you want to load in 8bit
pip install bitsandbytes
pip install accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained(
"norallm/normistral-7b-warm"
)

This setup needs about 8gb VRAM

Setting loadin8bit=False -> 15gb VRAM

Using torch.float32 and loadin8bit=False -> 21gb VRAM

model = AutoModelForCausalLM.from_pretrained( "norallm/normistral-7b-warm", device_map='auto', loadin8bit=True, torch_dtype=torch.bfloat16 )

_

Quantization

Provided files

NameQuant methodBits Per WeightSizeMax RAM/VRAM requiredUse case
normistral-7b-warm-Q3KM.ggufQ3K_M3.893.28 GB5.37 GBvery small, high loss of quality
normistral-7b-warm-Q4KM.ggufQ4K_M4.834.07 GB6.16 GBmedium, balanced quality
normistral-7b-warm-Q5KM.ggufQ5K_M5.674.78 GB6.87 GBlarge, very low quality loss
normistral-7b-warm-Q6K.ggufQ6K6.565.54 GB7.63 GBvery large, extremely low quality loss
normistral-7b-warm-Q80.ggufQ808.507.17 GB9.26 GBvery large, extremely low quality loss

How to run from Python code

You can use GGUF models from Python using the llama-cpp-python for example.

#### How to load this model in Python code, using llama-cpp-python

For full documentation, please see: llama-cpp-python docs.

#### First install the package

Run one of the following commands, according to your system:

# Base llama-ccp-python with no GPU acceleration
pip install llama-cpp-python

With NVidia CUDA acceleration

CMAKEARGS="-DLLAMACUBLAS=on" pip install llama-cpp-python

Or with OpenBLAS acceleration

CMAKEARGS="-DLLAMABLAS=ON -DLLAMABLASVENDOR=OpenBLAS" pip install llama-cpp-python

Or with CLBLast acceleration

CMAKEARGS="-DLLAMACLBLAST=on" pip install llama-cpp-python

Or with AMD ROCm GPU acceleration (Linux only)

CMAKEARGS="-DLLAMAHIPBLAS=on" pip install llama-cpp-python

Or with Metal GPU acceleration for macOS systems only

CMAKEARGS="-DLLAMAMETAL=on" pip install llama-cpp-python

In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:

$env:CMAKEARGS = "-DLLAMAOPENBLAS=on" pip install llama-cpp-python

#### Simple llama-cpp-python example code

from llama_cpp import Llama

Directly from huggingface-hub (requires huggingface-hub to be installed)

Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.

llm = Llama.from_pretrained( repo_id="norallm/normistral-7b-warm", # HuggingFace repository containing the GGUF files. filename="*Q4KM.gguf", # suffix of the filename containing the level of quantization. n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance ngpulayers=35 # The number of layers to offload to GPU, if you have GPU acceleration available )

Simple inference example

output = llm( "Engelsk: Hello everyone! I'm a language model, how are you doing today?\nBokmål:", # Prompt max_tokens=512, # Generate up to 512 tokens stop=["</s>"], # Example stop token echo=True, # Whether to echo the prompt temperature=0.3 # Temperature to set, for Q3KM, Q4KM, Q5KM, and Q6_0 it is recommended to set it relatively low. )

Citation

@inproceedings{samuel-etal-2025-small,
    title = "Small Languages, Big Models: {A} Study of Continual Training on Languages of {Norway}",
    author = "Samuel, David  and
      Mikhailov, Vladislav  and
      Velldal, Erik  and
      {\O}vrelid, Lilja  and
      Charpentier, Lucas Georges Gabriel  and
      Kutuzov, Andrey  and
      Oepen, Stephan",
    editor = "Johansson, Richard  and
      Stymne, Sara",
    booktitle = "Proceedings of the Joint 25th Nordic Conference on Computational Linguistics and 11th Baltic Conference on Human Language Technologies (NoDaLiDa/Baltic-HLT 2025)",
    month = mar,
    year = "2025",
    address = "Tallinn, Estonia",
    publisher = "University of Tartu Library",
    url = "https://aclanthology.org/2025.nodalida-1.61/",
    pages = "573--608",
    ISBN = "978-9908-53-109-0"
}

📂 GGUF File List

📁 Filename 📦 Size ⚡ Download
normistral-7b-warm.Q3_K_M.gguf
LFS Q3
3.28 GB Download
normistral-7b-warm.Q4_K_M.gguf
Recommended LFS Q4
4.07 GB Download
normistral-7b-warm.Q5_K_M.gguf
LFS Q5
4.78 GB Download
normistral-7b-warm.Q6_K.gguf
LFS Q6
5.54 GB Download
normistral-7b-warm.Q8_0.gguf
LFS Q8
7.17 GB Download