Run this model with HF Jobs

Run K-Ai-Official/MiRAI-2.5 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/K-Ai-Official/MiRAI-2.5. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/K-Ai-Official/MiRAI-2.5 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/K-Ai-Official/MiRAI-2.5. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/K-Ai-Official/MiRAI-2.5. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

MiRAI 2.5 7B

Multilingual. Fast. Reasoning. Developed by K-Ai.

MiRAI 2.5 is the successor to MiRAI-4B. It is a 7B decoder-only language model fine-tuned from Mistral-7B-v0.3 for Indonesian, English, and Japanese. It was trained with QLoRA on a single NVIDIA T4, and the adapter was then merged into the base weights.

Model Details

Developer K-Ai
Predecessor MiRAI-4B
Base model mistralai/Mistral-7B-v0.3
Parameters 7B
Type Decoder-only causal language model
Languages Indonesian, English, Japanese
Method Supervised fine-tuning with QLoRA, merged
License Apache-2.0 (see the dataset licenses below)

Strengths

Based on the small internal evaluation below, compared with the untuned base model:

  • Step-by-step math in English: GSM8K subset went from 0.05 to 0.60.
  • Reading comprehension: higher in all three languages, with the largest gain in Japanese (0.25 to 0.55).
  • Instruction format: trained to answer in a consistent [INST] prompt format.
  • Trilingual coverage: one model for Indonesian, English, and Japanese.
  • Accessible training recipe: trained on free-tier class hardware.

Intended Use

  • Experiments with Indonesian, English, and Japanese instruction following
  • Question answering over a provided passage
  • Simple English word problems, with answers verified by the user
  • A starting point for further fine-tuning

Not intended for medical, legal, financial, or other high-stakes decisions, or for unsupervised public-facing deployment.

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "K-Ai-Official/MiRAI-2.5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")

messages = [{"role": "user", "content": "Jelaskan fotosintesis secara singkat."}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to(model.device)
output = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9,
                        pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

On a 16 GB GPU, load the model in 4-bit:

from transformers import BitsAndBytesConfig

quant = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
                           bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.float16)
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quant, device_map="auto")

Prompt Format

<s>[INST] question [/INST]answer</s>

Training Data

Dataset Role License Revision Examples in mixture
CohereLabs/aya_dataset Human-annotated instructions (ID, EN, JA) Apache-2.0 f9ea04583f 8040
google-research-datasets/tydiqa Reading comprehension (ID, EN, JA) Apache-2.0 (Wikipedia text: CC BY-SA) da78f23f91 10489
openai/gsm8k Math word problems (EN) MIT 740312add8 3230
google-research-datasets/mbpp Python coding (EN) CC-BY-4.0 4bb6404fdc 237

Counts are for the sampled mixture and include repeated examples. The short training run saw only about 4,000 of them.

Training Procedure

Setting Value
Quantization during training 4-bit NF4 with double quantization
LoRA rank 16
Max sequence length 1024
Optimizer steps 250 (about 4,000 examples)
Hardware 1x NVIDIA T4

Loss was computed on assistant responses only.

Evaluation

Automatic evaluation on random subsets with n = 20 per task and greedy decoding. These numbers are a rough indication only: one question equals 5 percentage points. They are not official benchmark or leaderboard scores.

Metric Base MiRAI 2.5
MMLU Indonesian (MMMLU) 0.00 0.20
MMLU English 0.40 0.25
MMLU Japanese (MMMLU) 0.10 0.20
Math English (GSM8K) 0.05 0.60
Math Japanese (MGSM) 0.10 0.20
Reading Indonesian (TyDi QA, contains answer) 0.55 0.65
Reading English (TyDi QA, contains answer) 0.50 0.70
Reading Japanese (TyDi QA, contains answer) 0.25 0.55
Validation loss 2.0713 0.6613
Perplexity 7.93 1.94
Latency per response (s) 5.00 5.13
Tokens per second 13.3 7.6
Peak VRAM (GB) 5.43 5.51

How to read this

  • The base model is not instruction-tuned, so part of the gain likely comes from learning the answer format.
  • MMLU scores are low: apart from the base model in English, all are at or below the 25% random-guess level. MMLU English dropped after fine-tuning.
  • Validation loss is measured on data from the same sources and format as training.
  • Speed and memory were measured on a T4 in 4-bit with the LoRA adapter attached, before merging. The merged weights were not benchmarked.

Limitations

  • Weak general knowledge: multiple-choice knowledge scores are low in all three languages.
  • Short training: 250 steps is very limited for a general-purpose model.
  • Math: no native Indonesian or Japanese math data was used, and Japanese math remains weak. Always verify calculations.
  • Coding: very little coding data, and coding ability was not evaluated.
  • Conversation: little conversational data, especially informal Indonesian. No human evaluation is reported.
  • Safety: no dedicated safety alignment. The model may produce incorrect, biased, or harmful content.
  • Hallucination: it can state false information with confidence.
  • Contamination: overlap with the base model's pretraining data could not be checked.

Roadmap

Possible next steps: longer training, more native Indonesian and Japanese data (math and conversation), larger evaluation sets, human evaluation, and safety tuning.

License and Attribution

The model is released under Apache-2.0, following the base model. Each dataset remains subject to its own license.

  • Aya Dataset: Singh et al., 2024
  • TyDi QA: Clark et al., 2020 (passages from Wikipedia)
  • GSM8K: Cobbe et al., 2021
  • MBPP: Austin et al., 2021
Downloads last month
137
Safetensors
Model size
7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 2 Ask for provider support

Model tree for K-Ai-Official/MiRAI-2.5

Finetuned
(459)
this model
Quantizations
2 models

Datasets used to train K-Ai-Official/MiRAI-2.5

Collection including K-Ai-Official/MiRAI-2.5