Burmese Coder ๐น๐ฅ (SF-FT-BASE)
Model Name: Burmese Coder (Gemma-3 4B)
Author: Dr. Wai Yan Nyein Naing (waiyan.nn18@gmail.com)
Model Type: Autoregressive Language Model (Causal LM)
Base Model: Google gemma-3-4b
Languages: Burmese (my), English (en)
๐ Model Description
Burmese Coder is a state-of-the-art, fine-tuned large language model specifically optimized for professional technical software development and programming assistance in the Burmese language. Built on top of the powerful Gemma-3 4B architecture, this model bridges the gap for Myanmar developers by providing highly accurate, conversational, and culturally nuances technical explanations without language barriers.
The model underwent rigorous training phases, starting with Supervised Fine-Tuning (SFT) on an enriched MBPP (Mostly Basic Python Problems) dataset translated and expanded with step-by-step Burmese explanations. To ensure linguistic purity and eliminate multilingual hallucinations, the model was ultra-hardened using Direct Preference Optimization (DPO) with targeted On-Policy Rejections.
๐ฏ Intended Uses & Limitations
โ ๏ธ Disclaimer: This model is released strictly for educational purposes and academic testing. It is NOT production-ready and should NOT be used for commercial purposes or integrated into mission-critical applications.
Best-Suited Uses
- Educational Exploration: Learning and experimenting with fine-tuned Small Language Models (SLMs) tailored for the Burmese language.
- Code Generation & Prompt Testing: Evaluating the model's ability to write scripts and algorithms based on Burmese instructions in a controlled environment.
- Academic Research: Serving as a baseline or case study for localized, non-English programming assistants.
- Local Prototyping: Optimized for edge deployment and local inference testing via Ollama / GGUF on consumer hardware (macOS/Windows/Linux).
Out-of-Scope & Limitations
- Not for Production or Commercial Use: The model is an experimental research prototype. Its outputs must not be relied upon for production environments or commercial software systems.
- Domain Restriction: The model's primary focus strictly remains on programming and software engineering. General-purpose conversations outside technical domains may not be robust or highly coherent.
๐ ๏ธ Training Details
Training Paradigm
- Supervised Fine-Tuning (SFT): Initial instruction fine-tuning to teach the model structured technical problem-solving and accurate Burmese translation.
- Preference Alignment (DPO): Phase 4 ultra-hardening using Direct Preference Optimization (Beta=0.5). This phase utilized custom-generated hallucination datasets to heavily penalize language drift and reinforce strict Burmese linguistic consistency.
Dataset
- MBPP Enriched: 974-sample Mostly Basic Python Problems, augmented with extremely detailed, step-by-step Burmese explanations.
- Hallucination Rejection DPO: A curated dataset constructed to identify and reject mixed-language outputs.
๐ฌ Example Output
Here is a sample interaction showcasing the model's ability to seamlessly blend technical programming logic with professional Burmese explanations.
User Prompt:
"Python แแพแฌ Function แแ แบแแฏ Error แแแบแแฝแฌแธแแแบ แแแบแแพแแบแแฌแธแแฒแท แกแแผแญแแบแกแแฑแกแแฝแแบแกแแญแฏแแบแธ แแผแแบแแผแญแฏแธแ แฌแธแแฑแธแแแทแบ (Retry) Decorator แแ แบแแฏแแญแฏ delay แกแแปแญแแบแแฒแทแแแฝ แแฑแธแแผแแซแ"
Burmese Coder Response: (The model generates both the executable code and the step-by-step explanation)
import time
from functools import wraps
def retry_on_failure(max_retries=3, delay=2):
"""
Error แแแบแแฒแทแแซแ แแแบแแพแแบแแฌแธแแฑแฌ แกแแผแญแแบแกแแฑแกแแฝแแบแกแแญแฏแแบแธ แ
แฑแฌแแทแบแแญแฏแแบแธแ แแผแแบแแผแญแฏแธแ
แฌแธแแแทแบ Decorator
"""
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
for attempt in range(1, max_retries + 1):
try:
return func(*args, **kwargs)
except Exception as e:
print(f"[Error] Attempt {attempt} failed: {e}")
if attempt == max_retries:
raise e # แแฑแฌแแบแแฏแถแธแกแแผแญแแบแแฝแแบ Error แแญแฏ แแผแแบแแฝแพแแทแบแแแบ
time.sleep(delay)
return wrapper
return decorator
@retry_on_failure(max_retries=3, delay=2)
def unstable_api_call():
# แแปแแแบแธ Error แแฝแแบแ
แฑแแแทแบ API Call แกแแฏ
raise ConnectionError("Server Timeout!")
แแพแแบแธแแแบแธแแปแแบ (Explanation):
แแฎ code แ แกแแแบแกแแฝแฑแธแแผแแทแบแแฒแท Custom Decorator แแ
แบแแฏแแญแฏ `functools` แแฒแ `wraps` แแฒแท
แแฝแฒแแแบแแแบแแฑแฌแแบแแฌแธแแฌ แแผแ
แบแแซแแแบแ `retry_on_failure` แแญแฏแแฒแท แกแแผแแบแแฏแถแธ function แ
`max_retries` แแฒแท `delay` parameter แแฝแฑแแญแฏ แแแบแแถแแผแฎแธ แกแแฝแแบแธแแญแฏแแบแธ logic แแญแฏ แแญแแบแธแแปแฏแแบแแฑแธแแซแแแบแ
`wrapper` แกแแฒแแพแฌแแฑแฌแท `try-except block` แแญแฏ แกแแฏแถแธแแผแฏแแผแฎแธ Error แแแบ/แแแแบ แ
แ
แบแแฑแธแแซแแแบแ
Error แแแบแแฒแทแแแบ `time.sleep(delay)` แแฒแท แแแบแแพแแบแแฌแธแแฒแท แกแแปแญแแบแ
แฑแฌแแทแบแแผแฎแธ แแฑแฌแแบแแ
แบแแผแญแแบ
แแผแแบแแผแญแฏแธแ
แฌแธแแซแแแบแ แกแแแบแแญแฏแท แแฑแฌแแบแแฏแถแธแกแแผแญแแบแกแแญ Error แแแบแแแบแแฑแแฑแธแแแบแแฑแฌแท แแฐแ Error
แแญแฏแแฒ `raise e` แแญแฏแแผแฎแธ แแผแแบแแฝแพแแทแบแแฑแธแแญแฏแแบแแซแแแบแ
๐ How to Use (Local Inference)
This model is exported to GGUF format and is highly recommended to be run locally using Ollama for optimal memory efficiency and speed.
Via Ollama
- Create the Modelfile:
FROM ./burmese_coder_v4.gguf
# Add specific system prompts or parameters here if needed
- Initialize and Run:
ollama create burmese_coder -f Modelfile
ollama run burmese_coder
Via llama.cpp or text-generation-webui
Simply download the .gguf file and load it using the standard llama.cpp pipeline. Choose the quantization level (e.g., Q4_K_M or Q8_0) that best fits your VRAM requirements.
โ๏ธ License
This model is released under the Gemma License due to its base model heritage. Please adhere to the usage guidelines outlined by Google for Gemma derivatives.
๐ค Acknowledgments
- Creator: Engineered and trained by Dr. Wai Yan Nyein Naing.
- Initiative: Part of the Burmese Coding Assistant project.
- Mission: Empowering the technology and developer community in Myanmar with localized, open-source AI tools.