Views
No views yet
meta-llama/Llama-3.2-1B for the Romanian language, produced under a constrained compute budget (single RTX 3090). It was trained with QLoRA on 2.4B Romanian tokens (FineWeb2-Edu-Ro, quality-filtered) mixed with English (80/20) to limit catastrophic forgetting.Designed for 4-bit (QLoRA) inference under constrained VRAM. The adapter was trained on a 4-bit (nf4) base and is intended to run in that configuration. Reported metrics use 4-bit inference — its deployment precision.
meta-llama/Llama-3.2-1Bembed_tokens + lm_head, WSD scheduler, no sequence packing1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
3from peft import PeftModel
4
5base_model = "meta-llama/Llama-3.2-1B"
6adapter = "OpenLLM-Ro/RoLlama-3.2-1B"
7
8bnb = BitsAndBytesConfig(
9 load_in_4bit=True,
10 bnb_4bit_quant_type="nf4",
11 bnb_4bit_compute_dtype=torch.bfloat16,
12)
13
14tok = AutoTokenizer.from_pretrained(adapter)
15model = AutoModelForCausalLM.from_pretrained(base_model, quantization_config=bnb, device_map="auto")
16model = PeftModel.from_pretrained(model, adapter)
17
18inputs = tok("Capitala României este", return_tensors="pt").to(model.device)
19out = model.generate(**inputs, max_new_tokens=40)
20print(tok.decode(out[0], skip_special_tokens=True))| Model | Average | ARC | MMLU | Winogrande | HellaSwag | GSM8k | TruthfulQA |
|---|---|---|---|---|---|---|---|
| Llama-3.2-1B (base) | 31.25 | 29.45 | 24.50 | 51.82 | 35.75 | 1.21 | 44.76 |
| RoLlama-3.2-1B | 32.55 | 31.33 | 23.59 | 54.14 | 40.21 | 0.18 | 45.82 |
acc_norm; MMLU/Winogrande/TruthfulQA report acc; GSM8k reports exact_match. Scores from the final 2.4B-token checkpoint of the FineWeb2-Edu-Ro run, 4-bit inference (deployment precision).| Model | Binary (Few-shot) | Binary (Finetuned) | Multiclass (Few-shot) | Multiclass (Finetuned) |
|---|---|---|---|---|
| Llama-3.2-1B (base) | 50.84 | - | 33.42 | - |
| RoLlama-3.2-1B | 67.54 | - | 25.63 | - |
| Model | EN→RO (Few-shot) | EN→RO (Finetuned) | RO→EN (Few-shot) | RO→EN (Finetuned) |
|---|---|---|---|---|
| Llama-3.2-1B (base) | 6.11 | - | 15.60 | - |
| RoLlama-3.2-1B | 2.10 | - | 2.94 | - |
| Model | EM (Few-shot) | F1 (Few-shot) | EM (Finetuned) | F1 (Finetuned) |
|---|---|---|---|---|
| Llama-3.2-1B (base) | 20.88 | 31.11 | - | - |
| RoLlama-3.2-1B | 13.51 | 25.21 | - | - |
| Model | Spearman (Few-shot) | Pearson (Few-shot) | Spearman (Finetuned) | Pearson (Finetuned) |
|---|---|---|---|---|
| Llama-3.2-1B (base) | 0.019 | 0.018 | - | - |
| RoLlama-3.2-1B | -0.004 | -0.005 | - | - |
| Metric | Llama-3.2-1B (base) | RoLlama-3.2-1B | Note |
|---|---|---|---|
| RoWiki perplexity ↓ | 60.44 | 32.47 | primary Romanian fluency signal |
| RO Belebele (acc_norm) | 26.47 | 27.22 | reading comprehension |
| RO Grammar (acc) | 28.37 | 27.74 |
| Metric | Llama-3.2-1B (base) | RoLlama-3.2-1B |
|---|---|---|
| WikiText perplexity ↓ | 12.35 | 14.87 |
| ARC-Challenge (acc_norm) | 34.64 | 33.70 |
| Winogrande (acc) | 61.25 | 59.67 |
| Hyperparameter | Value |
|---|---|
| LoRA rank / alpha | 64 / 64 |
| Target modules | attn + MLP + embed_tokens + lm_head |
| Learning rate / embedding LR | 1e-4 / 2e-5 |
| Effective batch size | 128 (BS 4 × GA 32) |
| Data mix | 80% RO (FineWeb2-Edu-Ro) / 20% EN |
| Sequence packing | disabled |
| Scheduler | warmup_stable_decay (6% warmup, 5% decay) |
| Precision | BF16 + QLoRA 4-bit + FlashAttention 2 + grad checkpointing |
| Tokens | 2.4B (8 milestones × 300M) |
1@misc{parii2026rollama32,
2 title = {RoLlama-3.2-1B: Continual Pretraining of a Small Language Model for Romanian under Compute Constraints},
3 author = {Parii, Dan},
4 year = {2026},
5 howpublished = {\url{https://dan1180627.substack.com/p/rollama32-1b-cpt-of-a-small-language}}
6}