Mehak

AI Research · 2026

SLM + RAG

A compact language model combined with retrieval to produce grounded responses without relying entirely on a large general-purpose model.

Problem

Bigger models aren’t automatically better systems.

A general-purpose language model can contain enormous amounts of knowledge, but that doesn’t mean it has the specific knowledge an application needs — or that it should be responsible for storing all of it.

The question was simple

Can a smaller model become significantly more useful when it’s given the right context at the right time?

Approach

Instead of trying to make the model memorize everything, I separated reasoning from knowledge.

The SLM handles language generation and reasoning, while a retrieval layer finds relevant information from an external knowledge base and supplies it as context.

The result is a system where the model doesn’t need to know everything. It needs to know how to use what it is given.

Reasoning Knowledge

Model
Reasoning
Retrieval
Knowledge

The system

Question → grounded answer
01

Query

The user asks a question in natural language.

02

Retrieve

The system searches the knowledge base for relevant context.

03

Augment

The retrieved information is assembled into the model's context.

04

Generate

The SLM produces a response using the supplied context.

05

Ground

The response is constrained by the retrieved information rather than relying solely on model memory.

Why an SLM?

A trade-off, not a verdict

The goal wasn’t to use the biggest model available.

Smaller language models can offer advantages where latency, compute, cost or deployment constraints matter.

But reducing model size also makes the question of knowledge more important. Retrieval provides another path: instead of making the model larger, give the model better context.

Large model

  1. More parameters
  2. More capability
  3. More compute

SLM + retrieval

  1. Smaller model
  2. External knowledge
  3. Focused context

Neither column is the winner. They buy different things, and which one is correct depends on the constraints the system has to live inside.

The interesting part

Knowledge doesn’t have to live inside the model.

RAG changes where the system gets its information. The model provides the reasoning layer. Retrieval provides the knowledge layer.

Separating the two makes the system easier to update and gives the model access to information that doesn’t need to be permanently encoded into its parameters.

Model
Reasoning
Retrieval
Knowledge

Architecture

Two flows, one join
Request pathPer question
  1. User
  2. Query
  3. Retrieval
  4. Relevant context
  5. SLM
  6. Grounded output
Knowledge pipelineAhead of time
  1. Source data
  2. Chunking
  3. Embeddings
  4. Vector store
  5. Retrieval

The join

Both flows meet at retrieval. The knowledge pipeline runs ahead of time and ends at the vector store; the request path reads from it. Everything the model sees at generation time arrived through that one point, which is what makes the output attributable.

The model

Specification
Model
Details — pending
Parameters
Details — pending
Context
Details — pending
Inference
Details — pending

Why this model

The selection criteria were the ones set out above — latency, compute, cost and deployment constraints — traded against how much reasoning the system still needed the model to do on its own. The specific checkpoint and its settings are not recorded in this repository, so they are left blank rather than reconstructed from memory.

The knowledge base

External memory

The retrieval system acts as the model’s external memory.

Source dataCleanChunkEmbedIndex
Documents
Details — pending
Chunks
Details — pending
Embedding model
Details — pending
Vector store
Details — pending

Finding the right context

Retrieval is not preprocessing

Retrieval quality becomes just as important as generation quality.

A small model with excellent context can outperform a larger model working with irrelevant context.

The retrieval layer therefore becomes a critical part of the system rather than a preprocessing step.

  1. Question
  2. Semantic search
  3. Top-k results
  4. Context
  5. SLM

Observations

No formal benchmark run

This was an experiment, and it is worth being exact about what that means: no formal evaluation was run, so there are no numbers to show here. Presenting any would be inventing them.

What the system would have to be judged on is not in question, though — and knowing which measurements matter is most of the work of designing the evaluation.

Would be measured on

Retrieval

  • Recall@k
  • Precision@k

Generation

  • Accuracy
  • Faithfulness
  • Relevance

System

  • Latency
  • Memory
  • Token usage

Results — pending

The trade-off

Smaller models introduce constraints.

They may have less general reasoning capability and a smaller context budget.

Retrieval helps compensate for the knowledge problem, but it doesn’t eliminate the model’s limitations.

The interesting engineering problem is finding the point where model size, retrieved context and system constraints work together.

What I learned

The model is only one part of the system.

Building an AI application changed how I think about model performance. A better model doesn’t automatically produce a better product.

Retrieval quality, context construction, prompting, inference constraints and evaluation all affect the final result.

The intelligence isn’t just in the model. It’s in the system around it.

Stack

Specifics pending
Model
Details — pending
RAG
Details — pending
Embeddings
Details — pending
Vector store
Details — pending
Backend
Details — pending
Inference
Details — pending

Outcome

The project explored a different approach to building useful language systems: rather than scaling the model indefinitely, combine a smaller model with a retrieval layer that supplies the knowledge it needs.

The result is an architecture where generation and knowledge are deliberately separated — making the system a study in how much capability can come from the architecture around a model, not just the model itself.