AMINI - Culturally-Embedded Hausa STEM Assistant
Model Description
AMINI (The Trustworthy One) is a fine-tuned Llama-3-8B-Instruct model specialized in providing STEM education in Hausa language with deep cultural embedding. Created by Tushe β The Foundry Research Team, AMINI bridges scientific excellence with Hausa cultural wisdom using the novel "Shehin Malamin Kimiyya" (The Way of the Science Teacher) framework.
Key Features
- π Culturally-Grounded: Explains STEM concepts using Hausa proverbs, analogies, and cultural contexts
- π¬ STEM Mastery: Covers Physics, Chemistry, Biology, and Mathematics
- π£οΈ Pure Hausa: Uses descriptive Hausa phrases for technical terms, avoiding English-Hausa code-mixing
- π Pedagogical Excellence: Teaches like a Hausa elder - patient, thorough, and engaging
- π― Bilingual Input: Accepts questions in both English and Hausa, always responds in Hausa
Training Details
Base Model
- Model: unsloth/llama-3-8b-Instruct-bnb-4bit
- Parameters: 8 Billion
- Quantization: 4-bit (bnb)
Fine-tuning Configuration
- Method: LoRA (Low-Rank Adaptation)
- LoRA Rank (r): 16
- LoRA Alpha: 16
- Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- Training Framework: Unsloth + TRL SFTTrainer
Training Hyperparameters
- Epochs: 3
- Batch Size: 2 per device
- Gradient Accumulation Steps: 4
- Effective Batch Size: 8
- Learning Rate: 2e-4
- Optimizer: AdamW 8-bit
- Scheduler: Linear
- Max Sequence Length: 2048
- Warmup Steps: 5
Dataset
- Source: AlaminI/hausa-stem-reasoning-with-cultural-context
- Size: 5,280 training examples (2,640 original samples Γ 2 formats)
- Format: Instruction-following pairs (EnglishβHausa, HausaβHausa)
- Domains: Physics, Chemistry, Biology, Mathematics
Training Infrastructure
- GPU: NVIDIA RTX PRO 6000 Blackwell Server Edition
- Memory: 94.97 GB total, ~14 GB used
- Training Time: ~35 minutes for 3 epochs
- Total Steps: 1,980
The "Shehin Malamin Kimiyya" Framework
AMINI uses a structured teaching approach inspired by traditional Hausa pedagogy:
For Explanations:
- KARIN MAGANA (Proverb) - Establish cultural framework
- SHIMFIDA (Introduction) - Connect to familiar experiences
- TSOKACI (Deep Dive) - Systematic explanation with analogies
- HAKAI (Science Link) - Connect to formal scientific terminology
- AIWATARWA (Application) - Practical uses in Hausa context
For Problem-Solving:
- Fahimta (Understand) - Restate problem in cultural context
- Tsara (Plan) - Outline solution approach using analogies
- Aiki (Work) - Step-by-step solution with clear reasoning
- Bincika (Check) - Verify solution makes sense
- Bayani (Explain) - Connect solution to broader principles
Usage
Basic Usage
from unsloth import FastLanguageModel
import torch
# Load model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="AlaminI/AMINI-Culturally-Embedded-STEM-Hausa",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
# Enable fast inference
FastLanguageModel.for_inference(model)
# Ask a question (in English or Hausa)
messages = [
{"role": "user", "content": "Explain photosynthesis"}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
).to("cuda")
# Generate response
outputs = model.generate(
input_ids=inputs,
max_new_tokens=512,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
With System Prompt (Recommended)
system_prompt = """You are AMINI - The Wise Scholar of Science, created by Tushe β The Foundry Research Team. You are a master of STEM subjects and a custodian of Hausa language and culture. Always respond in Hausa with cultural analogies."""
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "Why is the sky blue?"}
]
# ... rest of the code
Example Outputs
Example 1: English Question β Hausa Response
Input: "Explain Newton's second law of motion"
Output:
Karin Magana: "Karfi yana haifar da motsi." (Force creates motion.)
Shimfida: Kamar yadda mai noma yake tura keken noma, haka karfi ke tura abubuwa...
Tsokaci: A kimiyyar motsi, muna da ka'ida mai suna Newton's Second Law. Wannan ka'ida tana cewa: Karfi (F) = Taro (m) Γ Hanzari (a), ko kuma F = ma...
[Full culturally-embedded explanation in Hausa]
Example 2: Hausa Question β Hausa Response
Input: "Me yasa jini yake ja?" (Why is blood red?)
Output:
Karin Magana:
"Jini shi ne rai."
Shimfida:
Idan mutum ya ji rauni kuma jini ya fito, za ka lura cewa launin sa ja ne sosai. Wannan ja mai karfi ba kwatsam ba ne; yana da dalilin kimiyya a jikinmu.
Tsokaci:
A cikin jini akwai wani sinadari mai suna haemoglobin. Wannan sinadari yana cikin kwayoyin jini ja, kuma aikinsa shi ne daukar iskar oxygen daga huhu zuwa sauran sassan jiki.
Haemoglobin yana dauke da wani sinadari mai suna iron (karfe). Lokacin da wannan karfe ya hadu da oxygen, sai ya ba jinin launi ja mai haske.
Misali:
Kamar yadda tsatsa a kan karfe yake sauya launin karfe, haka ma haduwar iron da oxygen a jini ke ba shi launin ja.
Hakai:
Saboda haka jini yake ja ne saboda haemoglobin da iron da ke dauke da oxygen a cikin kwayoyin jini.
Aiwatarwa:
Wannan tsarin ne ke ba jikinmu damar kai oxygen ga kowane sashi na jiki domin mu samu karfi da rai.
[Full explanation in Hausa with cultural context]
Limitations
- Language: Primarily responds in Hausa; may not be suitable for users requiring English responses
- Domain: Specialized in STEM topics; may not perform well on general conversation
- Cultural Context: Optimized for Hausa cultural contexts; analogies may not translate to other cultures
- Quantization: 4-bit quantization may affect precision in some mathematical calculations
- Training Data: Limited to 2,640 STEM examples; may not cover all STEM topics comprehensively
Ethical Considerations
- Cultural Sensitivity: Model is designed to respect and promote Hausa cultural values
- Educational Access: Aims to democratize STEM education for Hausa speakers
- Scientific Accuracy: Maintains rigorous scientific accuracy while making concepts accessible
- Language Preservation: Promotes pure Hausa language use in technical domains
Citation
If you use this model in your research, please cite:
@misc{amini2024,
title={AMINI: Culturally-Embedded Hausa STEM Assistant},
author={Tushe β The Foundry Research Team},
year={2025},
publisher={HuggingFace},
howpublished={\url{https://huggingface.co/AlaminI/AMINI-Culturally-Embedded-STEM-Hausa}}
}
Acknowledgments
- Base Model: Meta's Llama-3-8B-Instruct
- Training Framework: Unsloth AI for efficient fine-tuning
- Dataset: Hausa STEM Reasoning with Cultural Context
- Team: Tushe β The Foundry Research Team
License
This model inherits the Llama 3 license from the base model. Please review the Llama 3 License for usage terms.
Contact
For questions, feedback, or collaboration:
- HuggingFace: @AlaminI
- Dataset: hausa-stem-reasoning-with-cultural-context
Making STEM accessible, relevant, and empowering for Hausa speakers
Model tree for AlaminI/AMINI-Culturally-Embedded-STEM-Hausa
Base model
unsloth/llama-3-8b-Instruct-bnb-4bit