How it was made
The base model already produces fluent Nepali when given the system prompt
"You are a helpful AI assistant that answers in Nepali.", and English without it. This adapter distills that system prompt into the
weights, so the behaviour is unconditional. The point is on-device efficiency: a system prompt
costs prefill tokens on every request, and training it in once removes that cost permanently.
- Prompts:
OpenAssistant/oasst1, English conversation openers (Apache-2.0, human-written)
- Targets: generated by
google/gemma-4-E2B-it itself with the system prompt above
- Training pairs: 468 (quality-gated at Devanagari >= 0.7)
Measured result
On 60 held-out English prompts, with no system prompt, mean fraction of
Devanagari characters in the response:
Table with columns: Devanagari | Devanagari |
|---|
base google/gemma-4-E2B-it | 0.000 |
| base + this adapter | 0.814 |
Training configuration
Table with columns: Setting, Value| Setting | Value |
|---|
| rank / alpha / dropout | 16 / 32 / 0.05 |
| target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (205 modules, text decoder only) |
| epochs | 3 |
| effective batch size | 16 |
| learning rate | 0.0002 |
| max sequence length | 768 |
| precision | bf16 base, fp32 LoRA |
Limitations
- Nepali quality is inherited from the base model; this adapter changes which language is
used, not how well it is spoken.
- Targets are model-generated, so any factual errors the base model makes were trained in.
- A strong unconditional language bias can compete with an explicit contrary instruction.
- Trained on single-turn conversation openers; long multi-turn behaviour is untested.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("google/gemma-4-E2B-it", dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(base, "saliltambe/gemma-4-E2B-it-nepali-lora")
tok = AutoTokenizer.from_pretrained("google/gemma-4-E2B-it")
For on-device deployment with LiteRT-LM, see the companion conversion notebook.