File size: 7,839 Bytes
7fbb83c 6294b7a 7fbb83c a615f9d 7fbb83c a615f9d 7fbb83c a615f9d 7fbb83c 462fbc6 7fbb83c 1446173 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
---
datasets:
- HuggingFaceFW/fineweb-2
- HuggingFaceFW/fineweb-edu
- bigcode/starcoderdata
- HuggingFaceTB/finemath
language:
- fi
- en
license: llama3.1
library_name: transformers
pipeline_tag: text-generation
---
# Poro 2 8B Base Model Card
Poro 2 8B Base is an 8B parameter decoder-only transformer created through continued pretraining of Llama 3.1 8B to add Finnish language capabilities. It was trained on 165B tokens using a carefully balanced mix of Finnish, English, code, and math data. Poro 2 is a fully open source model and is made available under the Llama 3.1 Community License.
Poro 2 was created in a collaboration between [AMD Silo AI](https://www.amd.com/en/solutions/ai/silo-ai.html), the [TurkuNLP group](https://turkunlp.org/) of the University of Turku, and [High Performance Language Technologies](https://hplt-project.org/) (HPLT). Training was conducted on the [LUMI supercomputer](https://www.lumi-supercomputer.eu/), using compute resources generously provided by [CSC](https://csc.fi/) - IT Center for Science, Finland.
This model demonstrates how continued pretraining can efficiently add new language capabilities to existing models while maintaining performance in the original domains. Through the combination of English and Finnish training data, we achieve a model that substantially outperforms the base Llama 3.1 8B model in Finnish while maintaining solid English proficiency.
For more details on our training and data curation process, check out our [Continued Pretraining Playbook](https://rocm.blogs.amd.com/artificial-intelligence/multilingual-continued-pretraining/README.html).
## Poro 2 Model Family
The Poro 2 model family includes both 8B and 70B models, and there are three different versions released of the Poro 2 models: a base model, a post-training SFT-only checkpoint, and the final instruct model which is the SFT model plus a round of DPO.
| Model | Based on | Base Model | SFT | Instruct |
| :---: | :------: | :--------: | :-: | :------- |
| Poro 2 8B | Llama 3.1 8B | [Poro 2 8B Base](https://huggingface.co/LumiOpen/Llama-Poro-2-8B-base) | [Poro 2 8B SFT](https://huggingface.co/LumiOpen/Llama-Poro-2-8B-SFT) | [Poro 2 8B Instruct](https://huggingface.co/LumiOpen/Llama-Poro-2-8B-Instruct) |
| Poro 2 70B | Llama 3.1 70B | [Poro 2 70B Base](https://huggingface.co/LumiOpen/Llama-Poro-2-70B-base) | [Poro 2 70B SFT](https://huggingface.co/LumiOpen/Llama-Poro-2-70B-SFT) | [Poro 2 70B Instruct](https://huggingface.co/LumiOpen/Llama-Poro-2-70B-Instruct) |
_What does Poro mean?_ Poro is the Finnish word for Reindeer! 🦌 These animals are native to Finland and hold a significant and historical role in Finnish culture.
## Model Overview
**NOTE:** This is a base model which needs further fine tuning for most use cases.
Poro 2 8B is based on the Llama 3.1 8B architecture and uses continued pretraining to add Finnish language capabilities.
| Hyperparameter | Value |
| :------------- | :----: |
| n_parameters | 8.03B |
| n_layers | 32 |
| n_heads | 32 |
| n_kv_heads | 8 |
| d_model | 4096 |
| vocab_size | 128256 |
| max_sequence_length | 8192 |
| base_model | Llama-3.1-8B |
## Training
Poro 2 8B was created through continued pretraining on the LUMI supercomputer, using AMD MI250X GPUs. Training used a 3D parallelism strategy with TP=2, PP=1.
Training was conducted using a custom version of the Megatron-LM framework. Our code is available at [https://github.com/LumiOpen/Megatron-LM-lumi](https://github.com/LumiOpen/Megatron-LM-lumi).
## Training Hyperparameters
| Hyperparameter | Value | Comment |
| :------------: | :---: | :------:|
| Precision | bfloat16 | |
| Optimizer | AdamW | |
| Learning rate | 3e-4 | |
| LR scheduler | cosine | Warmup ratio 0.05, min LR 1e-8 |
| Weight decay | 1e-1 | |
| Global batch size | 512 | |
| Micro batch size | 1 | |
| Max sequence length | 8192 | |
| Total tokens | 165B | 1 epoch |
## Dataset
Poro 2 8B was trained on a balanced 165B token dataset designed to maintain English, code, and math capabilities while adding Finnish proficiency.
| Dataset | Source | Percentage | Tokens |
| :-----: | :----: | :--------: | :----: |
| Finnish | FineWeb2 | 30% | 50B |
| English | FineWeb-Edu | 30% | 50B |
| Code | StarCoder | 30% | 50B |
| Math | FineMath | 10% | 16B |
| **Total** | | **100%** | **165B** |
## Evaluation Results
Poro 2 8B shows substantial improvements in Finnish capabilities over Llama 3.1 8B, while maintaining English performance:
### Finnish Performance
| | Poro 2 8B | Llama 3.1 8B |
|-----------------|------------------|----------------|
| ARC Challenge | **48.90** | 38.82 |
| HellaSwag | **50.49** | 30.97 |
| MMLU | **56.25** | 49.64 |
| TruthfulQA | **49.78** | 45.54 |
### English Performance
| | Poro 2 8B | Llama 3.1 8B |
|-----------------|--------|----------------|
| ARC Challenge | **60.75** | 57.94 |
| HellaSwag | **80.55** | 80.05 |
| MMLU | 63.48 | **65.08** |
| TruthfulQA | 48.06 | **54.02** |
### Translation Performance
| | Poro 2 8B | Llama 3.1 8B |
|--------------------|--------|----------------|
| EN→FI BLEU | **36.48** | 23.92 |
| FI→EN BLEU | **40.71** | 37.42 |
**Overall**: ~10 percentage point average improvement in Finnish benchmarks with only ~1 percentage point decrease in English performance.
## Usage
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "LumiOpen/Poro-2-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Example usage
prompt = "Kerro minulle Suomesta." # "Tell me about Finland" in Finnish
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=200, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
```
## Ethical Considerations and Limitations
Poro 2 8B is an advanced language model optimized for English and Finnish, with additional capabilities in code and mathematics. As with most AI-driven systems, Poro 2 is a product of the vast data it has been trained on, which may reflect the imperfections, biases, and idiosyncrasies of the wider web. The model may, at times, produce outputs that can be considered inaccurate, prejudiced, or controversial.
Key limitations:
- Limited proficiency in languages other than English and Finnish
- Potential for generating biased or inappropriate content
- May produce factually incorrect information
Users and developers engaging with Poro 2 should exercise discretion and consider additional evaluation and customization to ensure the model's responses align with their specific needs.
## License
Built with Llama
Poro 2 8B is released under the Llama 3.1 Community License. Please review the license terms before use.
## Citation
```bibtex
@misc{poro2_2025,
title={Poro 2: Continued Pretraining for Language Acquisition},
author={Elaine Zosa and Jouni Luoma and Kai Hakala and Antti Virtanen and Mika Koistinen and Risto Luukkonen and Akseli Reunamo and Sampo Pyysalo and Jonathan Burdge},
year={2025},
howpublished={LumiOpen}
}
```
## Acknowledgments
We thank CSC - IT Center for Science, Finland for providing access to the LUMI supercomputer. This work was supported by the High Performance Language Technologies (HPLT) project and conducted in collaboration with TurkuNLP from the University of Turku. This project has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement No 101070350. |