MediArabic
Small models. Specialized intelligence.
Overview
MediArabic is a research and development project exploring resource-efficient Arabic language models for medical education.
At its core is a custom decoder-only Transformer trained entirely from scratch, without relying on pretrained foundation model weights. The system combines local language model inference with medical concept resolution, reviewed information retrieval, deterministic risk routing, and post-generation quality control.
Its architecture is designed to explain medical terminology, laboratory test concepts, and general health-related information in accessible Arabic while maintaining explicit boundaries around diagnosis, prescriptions, and clinical decision-making.
MediArabic investigates how smaller, specialized language models can operate within structured and safety-aware intelligent systems, particularly in resource-constrained environments.
System Architecture & Pipeline
- 1Pre-generation risk & intent routing (deterministic safety gate)
- 2Arabic question understanding & concept resolution (227 concepts)
- 3Reviewed medical knowledge retrieval
- 4Local 60.14M-parameter decoder-only SLM inference
- 5Post-generation quality gate -> educational response or grounded fallback
Documented Capabilities
- Custom 60.14M-parameter (60,140,160) decoder-only Transformer trained from scratch: 8 layers, d_model 640, RoPE, RMSNorm, SwiGLU, tied embeddings, 32k SentencePiece BPE
- Deterministic pre-generation risk routing to escalate urgent requests and refuse diagnosis, prescriptions, or dosages
- Medical concept resolution across a 227-concept registry with Arabic alias and typo handling
- Reviewed knowledge retrieval paired with local SLM inference and post-generation quality gating
- Educational explanation of medical terminology, laboratory tests, and bounded specialty direction
Internal sampled engineering evaluation (21M fallback vs. 60M candidate)
| Evaluation Metric | 21M-Class Fallback | 60M Candidate |
|---|---|---|
| Concept pass rate | 7.1% | 39.3% |
| Alias & typo pass rate | 32.1% | 46.4% |
| Model-visible response rate | 53.6% | 62.5% |
Figures reflect internal sampled engineering evaluations from the model card, not clinical accuracy or generalized safety benchmarks. Overfitting risk and wrong-concept drift remain documented concerns; the quality gate intercepted measured wrong-concept cases in the sampled comparison.
Technical Stack
Python · Decoder-Only Transformers · SentencePiece BPE · RoPE / RMSNorm / SwiGLU · Local SLM Inference · Arabic NLP · Deterministic Safety Gating
Scope, Evidence & Limitations
- Local-first Arabic medical education prototype only; NOT for clinical diagnosis, treatment, prescriptions, dosages, emergency triage, or replacing clinicians.
- Not clinically validated; model card documents overfitting risk and wrong-concept drift requiring deterministic quality gating.