AI models are great, until they confidently make something up. That's called a hallucination, and it gets worse the smaller the model is.
Small models are the only ones that fit on an ordinary phone with no internet. But they're also the ones most likely to invent an answer. And Sinhala makes it harder still: there's very little Sinhala training data, so the model has less to be right about.
Our research question: can a small Sinhala model be made trustworthy enough to rely on?
So we built a system with two rules:
|
Every answer must come from a real source document, no invented facts. |
If the sources can't answer the question, it says so instead of guessing. |
To prove it works, we tested the system on a domain where a wrong answer really matters: Sri Lankan O/L History, taught and answered entirely in Sinhala.
| Adaptation | Took a small language model and taught it Sinhala, small enough to run on a phone |
| Grounding | Every answer is drawn from real source documents, so it can't invent facts |
| Boundary | A check that asks "do the sources actually cover this?" before answering, and abstains if they don't |
| Deployment | The whole system runs fully offline on a low-end Android phone. No internet, no server, no data leaving the device |
| Evaluation | Measured how much the hallucinations actually went down |
flowchart LR
Q["Question<br/>in Sinhala"] --> H["Search the<br/>source documents"]
H --> G{"Do the sources<br/>cover this?"}
G -->|"Yes"| L["Answer using<br/>only those sources"]
G -->|"No"| A["'I don't have<br/>this information'"]
L --> R["Answer you<br/>can trust"]
style Q fill:#6C5CE7,color:#fff,stroke:none
style H fill:#0984E3,color:#fff,stroke:none
style G fill:#FF6B35,color:#fff,stroke:none
style A fill:#8B0000,color:#fff,stroke:none
style L fill:#0984E3,color:#fff,stroke:none
style R fill:#2ECC71,color:#fff,stroke:none
| Grounding and knowing the limits | Teaching the model Sinhala | Making it run on a phone |
|---|---|---|
|
Finding the right source passage for a question and detecting when a question falls outside what the sources cover. Sinhala breaks most standard text tools, so we rebuilt the parts that were wrong. |
Taking a general-purpose small model, teaching it Sinhala, then teaching it to answer only from the passage it was given and to stay quiet otherwise. |
Shrinking the whole system to fit a cheap Android phone and checking that the answers stay just as reliable after shrinking. |
| Repository | What's inside |
|---|---|
s3hm |
The core engine, source search and the "should I answer this?" check |
user-chat-app |
The chat app and how we measured answer quality |
module1-module2-combine |
Search and the Sinhala model working together |
test-projects |
Experiments and prototypes |
group-details |
Reports, poster, presentations and research |
සිංහලෙන් ඉගෙන ගමු. Let's learn in Sinhala.

