MPLM 3.8B Instruct
MPLM 3.8B Instruct is a Norwegian chat model for Bokmål and Nynorsk. Team MPLT built it for research and teaching during IN5640 at the University of Oslo. This release is checkpoint I-e3-lr2e-5, fine-tuned from MPLM-3.8B-MathCode.
| Parameters | Architecture | Context | Weights |
|---|---|---|---|
| 3.80B | 36-layer Qwen3-style decoder with grouped-query attention | 4,096 tokens | BF16 Safetensors |
Quick start
Use Transformers 5. The files were saved with 5.6.2. Transformers 4.x raises a tokenizer-class error when loading this export's TokenizersBackend tokenizer.
This example uses a CUDA GPU with BF16 support and the model's chat template. It generates greedily with a 192-token limit.
pip install "transformers==5.6.2" torch
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Rasuluzd/MPLM-3.8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, dtype=torch.bfloat16
).to("cuda").eval()
messages = [
{"role": "user", "content": "Skriv to setningar på nynorsk om å låne bøker."}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=192, do_sample=False, use_cache=True)
reply = output[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(reply, skip_special_tokens=True))
Training
| Stage | Run | GPU-hours |
|---|---|---|
| MPLM-3.8B-Base | 36,717 steps from scratch in one job | 1,481 |
| MathCode | 8,717 steps from the Base checkpoint at step 28,000 | 353 |
| Instruct | Three epochs on two GPUs over 4 hours and 12 minutes | 8.4 |
The team used about 2,900 GPU-hours on Olivia, including ablations and evaluation.
Base was trained on Norwegian (90%) and English (10%) web text from a pre-release of HPLT 4.0. For its final 8,717 steps, MathCode used 72% Norwegian, 8% English, 12% FineMath-4+ and 8% OpenCoder web text. Both base versions reached 77.001B token positions at step 36,717.
For Instruct, we added the chat delimiters <|im_start|> and <|im_end|> to the byte-level BPE vocabulary, bringing it to 64,002 tokens. We fine-tuned all parameters and computed the loss only on assistant tokens. The run used 94,884 examples from 90,188 conversations, a 1,024-token training limit and 8,898 updates at a peak learning rate of 2e-5.
Instruction data
The instruction mixture used a token budget of 50% Norwegian instructions, 30% English instructions, 10% math and 10% code. It drew on nine datasets.
- Norwegian instructions. Norwegian Dyna Instruct, including its
norquad-wikipediasubset, Norwegian Alpaca, NorRewrite, NorSummarize and NB Samtale. - English instructions. Tülu 3 Personas Instruction Following.
- Math. Orca Math Word Problems and NuminaMath-CoT.
- Code. Magicoder-OSS-Instruct-75K.
Evaluation
NorEval
MathCode scored 0.451 and Instruct scored 0.454 on nine zero-shot Bokmål tasks from NorEval 1.1. We averaged scores across prompts within each task and then gave each task equal weight. The metric was accuracy except for NorIdiom, which used first-word exact match (em_first). The comparison covers Bokmål only. Belebele was outside this evaluation.
Chat tests
- Fresh Norwegian panel. We tested 16 cases (eight Bokmål and eight Nynorsk) with greedy decoding and a 192-token limit. With the chat template, Instruct ended 19 of 20 turns with its end-of-turn token and had a median reply of 8.5 tokens. With plain question and answer labels, MathCode hit the length limit on 7 of 20 turns. Instruct behaved more like MathCode when it received the same plain prompts.
- Team test. Instruct ended 235 of 271 turns with its end-of-turn token. A refusal-pattern check matched 0 of 15 unanswerable cases and 0 of 10 safety cases. The 190-case test also informed checkpoint selection.
Held-out loss
We measured mean negative log-likelihood (NLL) per assistant token on 96 conversation pairs screened against the instruction training data.
| Reply language | Pairs | Mean reply length | NLL per assistant token |
|---|---|---|---|
| Norwegian | 48 | 61 tokens | 1.640 |
| English | 48 | 217 tokens | 1.568 |
The two subsets differ in content and reply length, so each loss describes its own subset. This measurement covers Instruct only.
Limitations
- The model can give confident wrong answers, repeat questions, lose track of earlier turns and comply with unsafe requests. Review its answers before relying on them.
- The chat evaluations are small. Instruction training included NorRewrite and NorSummarize test rows and NorQuAD-derived passages. The training-time validation split also reused 60 of its 200 scored examples from training.
- GSM8K and HumanEval were outside the Instruct evaluation. The parent checkpoint's results are on the MathCode model card.
License
Team MPLT at the University of Oslo releases the weights under CC BY-NC 4.0 for non-commercial use with attribution. The training datasets retain their own terms.