mk-gemma-4-e4b-pt
mk-gemma-4-e4b-pt is an open foundation language model adapted to Macedonian. It is built by continued pre-training of Gemma 4 E4B on Macedonian text. It is a base model: it completes a given text rather than following instructions, and it is intended for further fine-tuning. It is neither instruction-tuned nor safety-tuned.
Training
Data
The model was trained on LVSTCK/macedonian-corpus-cleaned-dedup, a Macedonian corpus of 1.47 billion words (16.78 GB) released under CC BY 4.0. The corpus was filtered for quality and language, deduplicated with MinHash, and filtered for personally identifiable information, which removed email addresses, IP addresses, and phone numbers. It is described in Krsteski et al. (2025).
| Source | Words | Share |
|---|---|---|
| FineWeb-2 | 0.73 B | 49.55% |
| HPLT-2 | 0.54 B | 36.87% |
| MaCoCu-mk 2.0 (CLARIN) | 0.18 B | 12.39% |
| Macedonian Wikipedia | 0.01 B | 0.83% |
| Other documents parsed with MMORE | 0.004 B | 0.25% |
| Common Voice | 0.002 B | 0.12% |
Method and Hyperparameters
The model was trained by continued pre-training of the language model of
Gemma 4 E4B with the Hugging Face Transformers Trainer. The vision and audio
encoders are those of the base model.
| Hyperparameter | Value |
|---|---|
| Epochs | 3 |
| Optimizer steps | 25,596 |
| Training tokens | About 10.1 billion over 3 epochs (3.35 billion per epoch), estimated from the Trainer's floating-point operation count. |
| Sequence length | 8,192 tokens, with the corpus packed into full sequences. |
| Batch size per device | 1 |
| Gradient accumulation steps | 16 |
| Effective batch size | 48 sequences (1 per device, 16 accumulation steps, and 3 GPUs). |
| Optimizer | AdamW (fused PyTorch implementation), with β₁ = 0.9, β₂ = 0.999, and ε = 1e-6. |
| Weight decay | 0.001 |
| Gradient clipping | Maximum norm of 1.0. |
| Peak learning rate | 2e-5 |
| Learning rate schedule | Linear warmup over 1,500 steps, then cosine decay to zero. |
| Precision | bfloat16 mixed precision |
| Final evaluation loss | 1.232 |
Compute
Training ran on three NVIDIA A100 80 GB GPUs with Fully Sharded Data Parallel
(FSDP) and took 8.96 × 10¹⁹ floating-point operations, as estimated by the
Trainer. It used about 2,700 to 3,700 GPU hours, estimated from the
evaluation throughput logged during training.
Evaluation
The model and its base model were evaluated zero-shot on the Macedonian LLM evaluation suite, which was machine-translated from the Serbian LLM evaluation suite. The table reports accuracy with its standard error.
| Benchmark | gemma-4-E4B | mk-gemma-4-e4b-pt |
|---|---|---|
| ARC Easy | 0.4958 ± 0.0103 | 0.5265 ± 0.0102 |
| ARC Challenge | 0.3131 ± 0.0136 | 0.3413 ± 0.0139 |
| BoolQ | 0.7645 ± 0.0074 | 0.7352 ± 0.0077 |
| HellaSwag | 0.4292 ± 0.0049 | 0.4526 ± 0.0050 |
| OpenBookQA | 0.2700 ± 0.0199 | 0.2940 ± 0.0204 |
| PIQA | 0.6665 ± 0.0110 | 0.6926 ± 0.0108 |
| WinoGrande | 0.6156 ± 0.0137 | 0.6014 ± 0.0138 |

Intended Use and Limitations
Intended Uses
- The model serves as a base for fine-tuning Macedonian language models, such as instruction-following, chat, or domain-specific models.
- The model supports research on language modelling for Macedonian and other low-resource languages.
- The model can complete Macedonian text from a prompt.
Out-of-Scope Uses
- The model is not suited to use as a chat assistant or to following instructions without further fine-tuning.
- The model must not be used for decisions that affect people's health, legal standing, finances, or access to services without human review.
- The model must not be used in breach of applicable law or to cause harm to people.
Known Limitations
- The model has no safety tuning and can produce false, offensive, or harmful text.
- The model can state incorrect facts fluently, so its output needs checking before it is relied on.
- The evaluation covers text only. The image and audio abilities of the model have not been evaluated for Macedonian.
- The evaluation suite was machine-translated, so its scores include translation noise and do not measure open-ended generation.
Bias and Risks
More than 86% of the training corpus comes from web crawls (FineWeb-2 and HPLT-2). The model can therefore reproduce the stereotypes, biases, and inaccuracies of Macedonian web text, including those about gender, ethnicity, religion, and politics. The personal-information filtering removes common identifiers but cannot guarantee that no personal information remains in the corpus.
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "vezilka-ai/mk-gemma-4-e4b-pt"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = "Главниот град на Македонија е "
outputs = generator(prompt, max_new_tokens=128, do_sample=True, temperature=0.7)
print(outputs[0]["generated_text"])
Citation
@misc{mkgemma4e4bpt2026,
title = {{mk-gemma-4-e4b-pt}: A Foundation Language Model for {Macedonian}},
author = {Gajdov, Hristijan and Ristevska, Ekaterina and Veljanovski, Kiril and
Ilioska, Veronika and Peshevski, Dimitar and Trajanov, Dimitar},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/vezilka-ai/mk-gemma-4-e4b-pt}
}
Funding Acknowledgement and Disclaimer
This project has received co-funding from the European High-Performance Computing Joint Undertaking (JU) under grant agreement No 101263128. The JU receives support from the Horizon Europe research and innovation programme and from the Participating States, including the Republic of North Macedonia. Additional support is provided by the Faculty of Computer Science and Engineering, Ss. Cyril and Methodius University in Skopje, and the Ministry of Digital Transformation of North Macedonia.
Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European High Performance Computing Joint Undertaking (JU). Neither the European Union nor the granting authority can be held responsible for them.