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
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
(288)
this model
Quantizations
3 models

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

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