CoolFace
Modelpublic

AyoubChLin/lfm2.5-8b-saudi-dialect

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes36downloads
Model Card

LFM2.5-8B Saudi Dialect

AyoubChLin/lfm2.5-8b-saudi-dialect is a Saudi Arabic conversational fine-tune of LiquidAI/LFM2.5-8B-A1B.

The model was fine-tuned to produce more natural Saudi dialect responses in chat-style conversations. It is intended for Arabic dialogue, informal Saudi phrasing, and assistant-style responses using a Saudi Arabic system prompt.

Model Details

FieldValue
Base modelLiquidAI/LFM2.5-8B-A1B
Fine-tuned modelAyoubChLin/lfm2.5-8b-saudi-dialect
DatasetHeshamHaroon/saudi-dialect-conversations
Dataset size3,545 examples
Train split3,474 examples
Evaluation split71 examples
Fine-tuning methodSupervised fine-tuning with LoRA
Final formatMerged model
Precisionbf16
QuantizationNone
Max sequence length10,244 tokens
LanguageArabic
Dialect focusSaudi Arabic
LicenseApache 2.0

Intended Use

This model is intended for Saudi Arabic conversational use cases, including:

  • Saudi dialect chatbots
  • Arabic assistant responses with Saudi phrasing
  • Dialogue generation
  • Informal Saudi Arabic conversation
  • Domain-specific Saudi Arabic assistant prototypes

Example system prompt used during fine-tuning:

text
أنت مساعد مفيد يتحدث باللهجة السعودية.

Dataset

The model was fine-tuned on:

text
HeshamHaroon/saudi-dialect-conversations

The dataset contains multi-turn Saudi Arabic conversations with metadata such as scenario, topic, complexity, and English summary. During preprocessing, each conversation was rendered with the model chat template. A Saudi Arabic system message was injected when missing.

Example conversational style includes casual Saudi phrases such as:

text
هلا والله
وش سالفتك؟
ايه والله
الله يعطيك العافية

Training Setup

The model was trained with supervised fine-tuning using LoRA adapters. The base model was loaded in bf16 without 4-bit quantization, and Flash Attention 2 was enabled.

LoRA Configuration

ParameterValue
LoRA rank128
LoRA alpha254
LoRA dropout0.05
Biasnone
Task typeCausal LM
Trainable parameters38,535,168
Total parameters8,506,391,296
Trainable percentage0.4530%

Target Modules

LoRA was applied to the following modules:

text
q_proj
k_proj
v_proj
out_proj
in_proj
conv.in_proj
conv.out_proj
gate_proj
up_proj
down_proj

Training Hyperparameters

ParameterValue
Epochs6
Per-device train batch size8
Per-device eval batch size8
Gradient accumulation steps8
Effective batch size64
Learning rate2e-4
LR schedulercosine
Warmup ratio0.05
Optimizeradamwtorchfused
Precisionbf16
FP16false
Max sequence length10,244
Evaluation strategysteps
Eval steps70
Save steps70
Save total limit2
Logging steps10
Dataset packingfalse
Dataloader workers4
Seed42
Flash Attention 2enabled
Gradient checkpointingdisabled
Quantizationnone

Training Environment

ComponentValue
GPUNVIDIA H200
VRAM150.1 GB
PyTorch2.8.0+cu129
CUDA12.9
Transformers5.12.1
PEFT0.19.1
Attention implementationFlash Attention 2
Training trackerWeights & Biases
Runtime756 seconds
Runtime~12.6 minutes
Throughput27.6 samples/sec
Note: The notebook was prepared for an A100 target, but the recorded run was executed on an NVIDIA H200 with 150.1 GB VRAM.

Training Results

Training completed successfully for 6 epochs and 330 optimization steps.

MetricValue
Final training loss, logged step 3301.0633
Overall train loss reported by trainer1.5250
Final validation loss, step 3301.7088
Best validation loss1.6409 at step 140
Final train mean token accuracy0.7597
Final eval mean token accuracy0.6545
Best eval mean token accuracy0.6584 at step 210
Total training steps330
Final epoch6
Total tokens seen at final eval3,736,326

Evaluation Progress

StepTraining LossValidation LossEval Mean Token AccuracyTokens Seen
701.68871.74740.6430793,936
1401.42191.64090.65401,588,892
2101.24291.64420.65842,384,614
2801.08331.68630.65623,171,273
3301.06331.70880.65453,736,326

Notes on the Results

The training loss decreased consistently during the run, from 4.6616 at the first logged step to 1.0633 at step 330. Train mean token accuracy also improved steadily, reaching 0.7597 at the final logged step.

Validation performance improved early in training, with the best validation loss appearing at step 140 and the best evaluation mean token accuracy appearing at step 210. After that point, the training loss continued to decrease while validation loss increased slightly. This suggests that the final checkpoint is more strongly adapted to the training distribution, while an earlier checkpoint around steps 140–210 may generalize slightly better on the small held-out validation split.

Because the evaluation split contains only 71 examples, these metrics should be treated as training diagnostics rather than a full benchmark. A stronger evaluation should include human review by native Saudi Arabic speakers, dialect naturalness scoring, response helpfulness scoring, safety checks, and comparisons against the base model.

Usage

python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "AyoubChLin/lfm2.5-8b-saudi-dialect"

tokenizer = AutoTokenizer.from_pretrained(
    model_id,
    trust_remote_code=True,
)

model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

messages = [
    {
        "role": "system",
        "content": "أنت مساعد مفيد يتحدث باللهجة السعودية."
    },
    {
        "role": "user",
        "content": "هلا، وش تنصحني أسوي إذا أبي أتعلم برمجة؟"
    }
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=256,
    temperature=0.7,
    top_p=0.9,
    do_sample=True,
    repetition_penalty=1.05,
)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Recommended Generation Settings

For natural Saudi conversational responses:

python
generation_config = {
    "max_new_tokens": 256,
    "temperature": 0.7,
    "top_p": 0.9,
    "do_sample": True,
    "repetition_penalty": 1.05,
}

For more deterministic assistant-style responses:

python
generation_config = {
    "max_new_tokens": 256,
    "temperature": 0.3,
    "top_p": 0.8,
    "do_sample": True,
    "repetition_penalty": 1.05,
}

Limitations

This model is a specialized Saudi dialect fine-tune and may not be optimal for:

  • Non-Saudi Arabic dialects
  • Formal Modern Standard Arabic tasks
  • Safety-critical domains
  • Legal, medical, or financial advice
  • Factual questions requiring up-to-date information
  • Long-context reasoning beyond the fine-tuning distribution

The model may also reflect biases, inaccuracies, or style artifacts present in the training dataset.

Evaluation

The reported evaluation used validation loss and mean token accuracy on a small held-out split of 71 examples.

For future releases, stronger evaluation should include:

  • Human evaluation by native Saudi Arabic speakers
  • Dialect naturalness scoring
  • Response helpfulness scoring
  • Safety evaluation
  • Comparison against the base model
  • Saudi dialect benchmark prompts
  • Evaluation on prompts outside the training dataset distribution

Citation

Base model:

bibtex
@misc{liquidai_lfm25_8b_a1b,
  title = {LFM2.5-8B-A1B},
  author = {Liquid AI},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/LiquidAI/LFM2.5-8B-A1B}}
}

Dataset:

bibtex
@misc{saudi_dialect_conversations,
  title = {Saudi Dialect Conversations},
  author = {HeshamHaroon},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/HeshamHaroon/saudi-dialect-conversations}}
}

Disclaimer

This model is provided for research and development purposes. Outputs should be reviewed before use in production systems, especially in sensitive or high-stakes applications.