Downloads · 30 days
40
11% of all-time downloads
azeddinShr/LFM2-1.2B-RAG-ARABIC-AdaLoRA
LFM2-1.2B-RAG-ARABIC-AdaLoRA is a question answering model from azeddinShr. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as other.
Fine-tuned version of LiquidAI/LFM2-1.2B-RAG for Arabic reading comprehension and question answering tasks using AdaLoRA (Adaptive Low-Rank Adaptation) technique.
Downloads · 30 days
40
11% of all-time downloads
All-time downloads
357
Public
Parameters
1.2B
7 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors4.7 GB · 100%
From the Hugging Face model README
Fine-tuned version of LiquidAI/LFM2-1.2B-RAG for Arabic reading comprehension and question answering tasks using AdaLoRA (Adaptive Low-Rank Adaptation) technique.
Evaluated using the official ABB benchmark evaluation script on RAG QA category:
| Metric | Score |
|---|---|
| RAG QA | 5.39/10 |
| Test Questions | 41 |
| Focus | RAG QA Category |
Performance Context:
Comparing with publicly reported scores from the ABL Leaderboard "🏅 Top by Skill → RAG QA" section:
| Model | Size | RAG QA Score | Difference |
|---|---|---|---|
| ibm-granite/granite-3.3-8b-instruct | 8B | 5.49 | -0.10 |
| openai/gpt-4.1-nano | Large | 5.41 | -0.02 |
| This model (local eval) | 1.2B | 5.39 | baseline |
| meta-llama/Llama-3.1-8B-Instruct | 8B | 5.02 | +0.37 |
| microsoft/Phi-4-mini-instruct | Small | 4.93 | +0.46 |
| openai/gpt-oss-20b | 20B | 4.32 | +1.07 |
| inceptionai/jais-adapted-13b-chat | 13B | 4.1 | +1.29 |
Key Achievement: Competitive RAG performance with only 1.2B parameters - significantly smaller than most comparable models, making it ideal for edge deployment and resource-constrained environments.
Note: This is a local evaluation. The official leaderboard submission has not been made yet.
This model specializes in extractive question answering for Arabic text with adaptive parameter allocation. It has been fine-tuned on the Arabic Reading Comprehension Dataset (ARCD) using AdaLoRA, which dynamically adjusts the rank of different layers during training for optimal performance.
Key Features:
Can be further fine-tuned for:
Not recommended for:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model_id = "azeddinShr/LFM2-1.2B-RAG-ARABIC-AdaLoRA"
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
# Prepare input
context = "نيوم هو مشروع ضخم في شمال غرب السعودية بتكلفة 500 مليار دولار."
question = "ما هي تكلفة مشروع نيوم؟"
prompt = f"استخدم السياق التالي للإجابة على السؤال:\n\n{context}\n\nالسؤال: {question}"
# Generate answer
messages = [{"role": "user", "content": prompt}]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
input_ids,
max_new_tokens=150,
temperature=0.0,
do_sample=False,
pad_token_id=tokenizer.eos_token_id
)
answer = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=True)
print(answer) # Output: 500 مليار دولار
Fine-tuning method: AdaLoRA (Adaptive Low-Rank Adaptation)
Hyperparameters:
AdaLoRA Configuration:
Training infrastructure:
AdaLoRA (Adaptive Low-Rank Adaptation) extends LoRA by dynamically allocating parameter budgets across different weight matrices based on their importance during training. This results in:
If you use this model in your research or application, please cite:
@misc{lfm2-arabic-qa-adalora,
author = {Azeddin Sahir},
title = {LFM2-1.2B-RAG Arabic (AdaLoRA Fine-tuned)},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/azeddinShr/lfm2-1.2b-arabic-qa-adalora}}
}
Base model License
For questions, issues, or collaboration opportunities, please open an issue in the model repository, contact via Hugging Face, or email me directly at [email protected].
Note: This is a research model. Always validate outputs for your specific use case and domain.