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es
|
| 9 |
+
- fr
|
| 10 |
+
- it
|
| 11 |
+
- pt
|
| 12 |
+
- pl
|
| 13 |
+
- nl
|
| 14 |
+
- tr
|
| 15 |
+
- sv
|
| 16 |
+
- cs
|
| 17 |
+
- el
|
| 18 |
+
- hu
|
| 19 |
+
- ro
|
| 20 |
+
- fi
|
| 21 |
+
- uk
|
| 22 |
+
- sl
|
| 23 |
+
- sk
|
| 24 |
+
- da
|
| 25 |
+
- lt
|
| 26 |
+
- lv
|
| 27 |
+
- et
|
| 28 |
+
- bg
|
| 29 |
+
- 'no'
|
| 30 |
+
- ca
|
| 31 |
+
- hr
|
| 32 |
+
- ga
|
| 33 |
+
- mt
|
| 34 |
+
- gl
|
| 35 |
+
- zh
|
| 36 |
+
- ru
|
| 37 |
+
- ko
|
| 38 |
+
- ja
|
| 39 |
+
- ar
|
| 40 |
+
- hi
|
| 41 |
+
library_name: transformers
|
| 42 |
+
base_model:
|
| 43 |
+
- utter-project/EuroLLM-9B
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
[](https://hf.co/QuantFactory)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
# QuantFactory/EuroLLM-9B-Instruct-GGUF
|
| 51 |
+
This is quantized version of [utter-project/EuroLLM-9B-Instruct](https://huggingface.co/utter-project/EuroLLM-9B-Instruct) created using llama.cpp
|
| 52 |
+
|
| 53 |
+
# Original Model Card
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
# Model Card for EuroLLM-9B-Instruct
|
| 57 |
+
|
| 58 |
+
This is the model card for EuroLLM-9B-Instruct. You can also check the pre-trained version: [EuroLLM-9B-Instruct](https://huggingface.co/utter-project/EuroLLM-9B-Instruct).
|
| 59 |
+
|
| 60 |
+
- **Developed by:** Unbabel, Instituto Superior Técnico, Instituto de Telecomunicações, University of Edinburgh, Aveni, University of Paris-Saclay, University of Amsterdam, Naver Labs, Sorbonne Université.
|
| 61 |
+
- **Funded by:** European Union.
|
| 62 |
+
- **Model type:** A 9B parameter multilingual transfomer LLM.
|
| 63 |
+
- **Language(s) (NLP):** Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Arabic, Catalan, Chinese, Galician, Hindi, Japanese, Korean, Norwegian, Russian, Turkish, and Ukrainian.
|
| 64 |
+
- **License:** Apache License 2.0.
|
| 65 |
+
|
| 66 |
+
## Model Details
|
| 67 |
+
|
| 68 |
+
The EuroLLM project has the goal of creating a suite of LLMs capable of understanding and generating text in all European Union languages as well as some additional relevant languages.
|
| 69 |
+
EuroLLM-9B is a 9B parameter model trained on 4 trillion tokens divided across the considered languages and several data sources: Web data, parallel data (en-xx and xx-en), and high-quality datasets.
|
| 70 |
+
EuroLLM-9B-Instruct was further instruction tuned on EuroBlocks, an instruction tuning dataset with focus on general instruction-following and machine translation.
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
### Model Description
|
| 74 |
+
|
| 75 |
+
EuroLLM uses a standard, dense Transformer architecture:
|
| 76 |
+
- We use grouped query attention (GQA) with 8 key-value heads, since it has been shown to increase speed at inference time while maintaining downstream performance.
|
| 77 |
+
- We perform pre-layer normalization, since it improves the training stability, and use the RMSNorm, which is faster.
|
| 78 |
+
- We use the SwiGLU activation function, since it has been shown to lead to good results on downstream tasks.
|
| 79 |
+
- We use rotary positional embeddings (RoPE) in every layer, since these have been shown to lead to good performances while allowing the extension of the context length.
|
| 80 |
+
|
| 81 |
+
For pre-training, we use 400 Nvidia H100 GPUs of the Marenostrum 5 supercomputer, training the model with a constant batch size of 2,800 sequences, which corresponds to approximately 12 million tokens, using the Adam optimizer, and BF16 precision.
|
| 82 |
+
Here is a summary of the model hyper-parameters:
|
| 83 |
+
| | |
|
| 84 |
+
|--------------------------------------|----------------------|
|
| 85 |
+
| Sequence Length | 4,096 |
|
| 86 |
+
| Number of Layers | 42 |
|
| 87 |
+
| Embedding Size | 4,096 |
|
| 88 |
+
| FFN Hidden Size | 12,288 |
|
| 89 |
+
| Number of Heads | 32 |
|
| 90 |
+
| Number of KV Heads (GQA) | 8 |
|
| 91 |
+
| Activation Function | SwiGLU |
|
| 92 |
+
| Position Encodings | RoPE (\Theta=10,000) |
|
| 93 |
+
| Layer Norm | RMSNorm |
|
| 94 |
+
| Tied Embeddings | No |
|
| 95 |
+
| Embedding Parameters | 0.524B |
|
| 96 |
+
| LM Head Parameters | 0.524B |
|
| 97 |
+
| Non-embedding Parameters | 8.105B |
|
| 98 |
+
| Total Parameters | 9.154B |
|
| 99 |
+
|
| 100 |
+
## Run the model
|
| 101 |
+
|
| 102 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 103 |
+
|
| 104 |
+
model_id = "utter-project/EuroLLM-9B-Instruct"
|
| 105 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 106 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 107 |
+
|
| 108 |
+
messages = [
|
| 109 |
+
{
|
| 110 |
+
"role": "system",
|
| 111 |
+
"content": "You are EuroLLM --- an AI assistant specialized in European languages that provides safe, educational and helpful answers.",
|
| 112 |
+
},
|
| 113 |
+
{
|
| 114 |
+
"role": "user", "content": "What is the capital of Portugal? How would you describe it?"
|
| 115 |
+
},
|
| 116 |
+
]
|
| 117 |
+
|
| 118 |
+
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
| 119 |
+
outputs = model.generate(inputs, max_new_tokens=1024)
|
| 120 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 121 |
+
|
| 122 |
+
## Results
|
| 123 |
+
|
| 124 |
+
### EU Languages
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
**Table 1:** Comparison of open-weight LLMs on multilingual benchmarks. The borda count corresponds to the average ranking of the models (see ([Colombo et al., 2022](https://arxiv.org/abs/2202.03799))). For Arc-challenge, Hellaswag, and MMLU we are using Okapi datasets ([Lai et al., 2023](https://aclanthology.org/2023.emnlp-demo.28/)) which include 11 languages. For MMLU-Pro and MUSR we translate the English version with Tower ([Alves et al., 2024](https://arxiv.org/abs/2402.17733)) to 6 EU languages.
|
| 129 |
+
\* As there are no public versions of the pre-trained models, we evaluated them using the post-trained versions.
|
| 130 |
+
|
| 131 |
+
The results in Table 1 highlight EuroLLM-9B's superior performance on multilingual tasks compared to other European-developed models (as shown by the Borda count of 1.0), as well as its strong competitiveness with non-European models, achieving results comparable to Gemma-2-9B and outperforming the rest on most benchmarks.
|
| 132 |
+
|
| 133 |
+
### English
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
|
| 138 |
+
**Table 2:** Comparison of open-weight LLMs on English general benchmarks.
|
| 139 |
+
\* As there are no public versions of the pre-trained models, we evaluated them using the post-trained versions.
|
| 140 |
+
|
| 141 |
+
The results in Table 2 demonstrate EuroLLM's strong performance on English tasks, surpassing most European-developed models and matching the performance of Mistral-7B (obtaining the same Borda count).
|
| 142 |
+
|
| 143 |
+
## Bias, Risks, and Limitations
|
| 144 |
+
|
| 145 |
+
EuroLLM-9B has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
|