Skip to content
@Interlekt

Interlekt

Final Year Research Group
  • Sri Lanka
Interlekt logo

Hallucination Mitigation in Small Language Models for Domain Specific Sinhala Question Answering

Making small AI models answer in Sinhala only when they actually know and admit it when they don't.


Why We Built It

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:

Only what it can back up

Every answer must come from a real source document, no invented facts.

Says "I don't know"

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.


What We Did

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

How It Works

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
Loading
Interlekt system architecture

The Three Parts

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.


Our Repositories

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

Built With

Python PyTorch Transformers llama.cpp ChromaDB Streamlit Android Kotlin


The Team

Manoj Thilakarathna

Manoj
Thilakarathna


GitHub LinkedIn
Isuru Jayalath

Isuru
Jayalath


GitHub LinkedIn
Nethuni Rajapakse

Nethuni
Rajapakse


GitHub LinkedIn

සිංහලෙන් ඉගෙන ගමු. Let's learn in Sinhala.

Popular repositories Loading

  1. sinhala-slm-android sinhala-slm-android Public

    On-device Sinhala question-answering for Android, powered by llama.cpp and quantized small language models.

    Kotlin

  2. .github .github Public

Repositories

Showing 2 of 2 repositories

Top languages

Loading…

Most used topics

Loading…