Downloads · 30 days
12
4% of all-time downloads
Omartificial-Intelligence-Space
Omartificial-Intelligence-Space/Diraya-3B-Instruct-Ar
Diraya-3B-Instruct-Ar is a text generation model from Omartificial-Intelligence-Space. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Downloads · 30 days
12
4% of all-time downloads
All-time downloads
320
Public
Repo size
734 MB
Likes
3
Public
Click a slice to open those files.
.safetensors479 MB · 65%
From the Hugging Face model README

Diraya-3B-Instruct-Ar is an Arabic reasoning-specialized language model fine-tuned from Qwen2.5-3B .
This model is part of the DIRA (Diraya Arabic Reasoning AI) collection, which focuses on enhancing the logical inference and mathematical reasoning capabilities of Arabic language models.
Base Model: Qwen2.5-3B via unsloth/Qwen2.5-3B-Instruct-unsloth-bnb-4bit
Model Type: Instruction-tuned causal language model
Architecture:
Training Approach:
GPROLoRA Configuration:
{
"peft_type": "LORA",
"r": 64,
"lora_alpha": 64,
"lora_dropout": 0,
"target_modules": [
"k_proj", "gate_proj", "o_proj", "down_proj",
"v_proj", "up_proj", "q_proj"
],
"bias": "none",
"inference_mode": true
}
The model is designed to output structured reasoning in the following format:
<reasoning>
[Step-by-step reasoning process in Arabic]
</reasoning>
<answer>
[Final answer in Arabic]
</answer>
from unsloth import FastLanguageModel
max_seq_length = 1024 # Can increase for longer reasoning traces
lora_rank = 64 # Larger rank = smarter, but slower
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Omartificial-Intelligence-Space/Diraya-3B-Instruct-Ar",
max_seq_length = max_seq_length,
load_in_4bit = True, # False for LoRA 16bit
fast_inference = True, # Enable vLLM fast inference
max_lora_rank = lora_rank,
)
# System prompt to enforce XML structure
system_prompt = """
Respond in the following format in Arabic language only:
<reasoning>
...
</reasoning>
<answer>
...
</answer>
"""
# Prepare user question
user_question = "كل يوم، تُطعم وندي كل دجاجة من دجاجاتها ثلاث أكواب من العلف المختلط. تقدم الدجاجات وجباتهم في ثلاث وجبات منفصلة. في الصباح، تعطي قطيعها من الدجاج 15 كوبًا من العلف. في فترة ما بعد الظهر، تعطي دجاجاتها 25 كوبًا أخرى من العلف. كم عدد أكواب العلف التي تحتاجها لتقديمها لدجاجاتها في الوجبة الأخيرة من اليوم إذا كان حجم قطيع وندي 20 دجاجة؟"
# Prepare input for the model
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_question}
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate response
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.95
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
This model was primarily fine-tuned on:

Figure: Composition of Rewards over Training Steps showing the evolution of model performance across different reward functions
The training utilized multiple reward functions to optimize different aspects of the model's performance:
As shown in the visualization, the model demonstrated consistent improvement across all reward dimensions throughout the training process. The upper values in rewards indicate higher-quality outputs that simultaneously satisfy multiple optimization criteria. This multi-objective training approach resulted in a model that not only produces correct answers but does so with clear, well-structured reasoning.
The model demonstrates strong performance on Arabic mathematical reasoning tasks, with particular strengths in:
If you use this model in your research, please cite:
@misc{diraya3b,
title={Diraya-3B-Instruct-Ar: An Arabic Reasoning-Specialized Language Model},
author={Omartificial-Intelligence-Space},
year={2025},
howpublished={\url{https://huggingface.co/Omartificial-Intelligence-Space/Diraya-3B-Instruct-Ar}}
}
This model builds upon the Qwen2.5-3B model by the Qwen Team and utilizes optimization techniques from Unsloth. We acknowledge their valuable contributions to the field of language modeling.
@misc{qwen2.5,
title = {Qwen2.5: A Party of Foundation Models},
url = {https://qwenlm.github.io/blog/qwen2.5/},
author = {Qwen Team},
month = {September},
year = {2024}
}
@article{qwen2,
title={Qwen2 Technical Report},
author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
journal={arXiv preprint arXiv:2407.10671},
year={2024}
}