Gamunu-4b-Instruct-Alpha
เทเทเถเทเถฝ instruct LLM โ Experimental Release
Gamunu-4b-Instruct-Alpha is the first experimental checkpoint of the Gamunu Project, a Sinhala-centric bilingual Large Language Model. Built through continued pre-training on Sinhala-rich academic and domain-specific data, it's fine-tuned for instruction following, reasoning, and culturally grounded interactions.
โ ๏ธ Alpha Notice
This is an experimental research model.
It demonstrates strong Sinhala fluency, reasoning, and broad NLP coverage โ but is single-turn only and not yet RLHF-aligned for multi-turn dialogue.
Use for research, benchmarking, and controlled deployments โ not production.
๐งช Live Demo
Now you can try Gamunu-4b-Instruct-Alpha instantly on Hugging Face Spaces for free ๐
๐ Gamunu ZeroGPU Demo
โก Capabilities
๐ค Language & Reasoning
- Fluent, idiomatic Sinhala generation
- Robust Sinhala โ English bilingual understanding
- Solid mathematical reasoning (percentages, word problems, arithmetic)
- Logical, step-by-step reasoning in QA tasks
- Structured, concise, and context-aware responses
๐ญ Roleplay & Instruction
- Accurate adherence to single-turn instructions
- Expert persona simulation (teacher, scientist, analyst, advisor)
- Balanced, formal, and culturally aware tone
๐งฉ Supported NLP Tasks
- Text generation & completion
- Summarization (educational / contextual)
- Translation (Sinhala โ English)
- Paraphrasing and rewriting
- Question answering (factoid + reasoning)
- Instruction-based classification
- Role-specific expert responses
๐ซ Limitations
- No conversational memory
- Occasional factual drift
- No RLHF or safety tuning yet
- Reasoning quality may degrade with ambiguous prompts
๐ฏ Intended Use
Best for
- Research & evaluation of Sinhala LLMs
- Educational assistants and analytical Q&A
- Cultural, marketing, and academic content generation
- Benchmarking instruction following in low-resource languages
Not for
- Medical, legal, or financial decision-making
- Production systems requiring factual reliability
- Processing sensitive or personal data
๐งฉ Training Details
Phase 1 โ Continued Pre-training (CPT)
Focused on enhancing Sinhala linguistic coverage and contextual understanding for semantic depth.
Phase 2 โ Supervised Fine-tuning (SFT)
Fine-tuned on a custom Sinhala instruction dataset emphasizing reasoning, roleplay, and assistant-style behavior.
| Setting | Value |
|---|---|
| Framework | Unsloth + Transformers |
| Optimizer | AdamW + cosine scheduler |
| Hardware | NVIDIA H100 (80 GB) |
| Epochs | 5 |
| LoRA Rank / ฮฑ / Dropout | 128 / 128 / 0.05 |
๐ Model Summary
| Property | Description |
|---|---|
| Stage | Alpha (Experimental) |
| Pipeline | CPT โ Custom SFT (LoRA) |
| Base Model | Google Gemma 3 4B |
| Languages | Sinhala (primary), English (secondary) |
| Dialogue Type | Single-turn instruction |
| Context Length | 2048 tokens |
๐งฉ Base Model License
This model was fine-tuned from Google Gemma 3 4B, distributed under the
Gemma Terms of Use.
All rights to Gemma 3 4B remain with Google LLC.
The Gamunu-Instruct-4B-Alpha weights, datasets, and training code are released by
Manthila Mallawa (The Gamunu Project) under the Apache 2.0 License.
Use of the base model remains subject to Google's policies.
๐ฌ Example Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
model_name = "manthilaffs/Gamunu-4B-Instruct-Alpha"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32,
device_map="auto"
)
# Sinhala prompt template
sinhala_prompt = """เถดเทเถญ เถฏเทเถเทเทเทเถฑเทเถฑเท เถบเถธเท เถเทเถปเทเถบเถบเถเท เถดเทเท
เทเถถเถณ เทเทเทเทเถญเถป เถเถปเถฑ เถเถดเถฏเทเทเถเท เทเท เถเถบเถง เถ
เถฏเทเท
เถญเทเถปเถญเทเถปเท เถเถญเทเท
เถญเท เถเถฏเทเถฑเถบเถเท. เถเถฝเทเถฝเท เถเทเถปเทเถบเถบ เถฑเทเทเทเถปเถฏเทเท เทเถธเทเถดเทเถปเทเถซ เถเท
เทเทเถเท เถดเทโเถปเถญเทเถ เทเถปเถบเถเท เทเถดเถบเถฑเทเถฑ.
### เถเถดเถฏเทเท:
เถเถถ เถเทเถธเทเถซเท (Gamunu) เถฑเถธเท AI เทเทเทเถบเถเถบเทเถบเท.
เถเถถเท เถเทเถปเทเถบเถบ เทเถฑเทเถฑเท เถดเถปเทเทเทเถฝเถเถบเถฑเทเถเท เถเถดเถฏเทเทเท เถฑเทเทเทเถปเถฏเทเท เถดเทเถฝเทเถดเทเถฏเทเถธ เทเท เถ
เทเท เถเถญเท เถดเทโเถปเทเทเถฑเทเถฝเถง เถฑเทเทเทเถปเถฏเทเท เถดเทเท
เทเถญเทเถปเท เทเถดเถบเถธเทเถฑเท เถเทเทเถฑเทเถง เทเทเถบ เทเทเถธเถบเท.
### เถเถฏเทเถฑเถบ:
{}
### เถดเทโเถปเถญเทเถ เทเถปเถบ:
{}"""
# Example input
user_query = "เทเทเถฝเท เถเทเถธเทเถซเท! เถธเถธ เทเถธเถฑเท, เถเถบเทเถง เถเทเทเทเถธเถฏ?"
prompt = sinhala_prompt.format(user_query, "")
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# Generate
with torch.inference_mode():
outputs = model.generate(**inputs, max_new_tokens=250)
# Decode and clean output
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
if "### เถดเทโเถปเถญเทเถ เทเถปเถบ:" in text:
text = text.split("### เถดเทโเถปเถญเทเถ เทเถปเถบ:")[-1].strip()
print(text)
๐งพ How to Cite
If you use Gamunu-Instruct-4B-Alpha in your work, please cite as follows:
APA
Mallawa, M. (2025). Gamunu-Instruct-4B-Alpha: A Sinhala-centric bilingual instruction-tuned language model. The Gamunu Project. Retrieved from https://huggingface.co/manthilaffs/Gamunu-Instruct-4B-Alpha
BibTeX
@misc{mallawa_gamunu_instruct_4b_alpha_2025,
author = {Mallawa, Manthila},
title = {Gamunu-Instruct-4B-Alpha: A Sinhala-centric bilingual instruction-tuned language model},
year = {2025},
publisher = {The Gamunu Project},
howpublished = {\url{https://huggingface.co/manthilaffs/Gamunu-Instruct-4B-Alpha}}
}
- Downloads last month
- 21