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
16
Safetensors
Model size
4B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ 1 Ask for provider support

Model tree for manthilaffs/Gamunu-4B-Instruct-Alpha

Finetuned
(267)
this model
Quantizations
3 models

Space using manthilaffs/Gamunu-4B-Instruct-Alpha 1

Collection including manthilaffs/Gamunu-4B-Instruct-Alpha