orbi
← All postsTürkçe

How do I teach the model my own data? RAG, fine-tuning and memory

September 7, 2026 · Orbi Platform

How do I teach the model my own data? RAG, fine-tuning and memory

Every team trying to bring AI into its work asks the same question in the first few months. How do I teach the model my own data?

The question has three different answers, and they get discussed as if they were alternatives to each other. In fact they answer different questions, which is why the "which one is better" argument usually goes nowhere.

What the three do

Retrieval-augmented generation, RAG for short, finds the relevant piece inside your own documents at the moment a question is asked and puts it in front of the model. The model does not learn it. It reads it right then and bases its answer on it.

Fine-tuning changes the model's own weights. What is learned gets written into the model and does not have to be carried along on every call. In return, you repeat the process for every update.

Memory is a small number of lasting notes. Not a document but a distilled lesson. A preference like "texts for this client stay short" lives here and travels alongside the model on every run.

The three methods compared.

What the research says

This debate has a measured side. A study comparing knowledge injection found that unsupervised fine-tuning gives some improvement, but that RAG consistently does better both on knowledge seen during training and on entirely new knowledge. Models struggle to learn new facts through unsupervised fine-tuning (Ovadia et al., Fine-Tuning or Retrieval?).

That finding does not say "fine-tuning does not work". What it says is narrower. If you want to teach the model facts, fine-tuning is not a reliable tool for it.

The two most common mistakes

The first comes from the word itself. Say "teach the model" and fine-tuning comes to mind, when what people usually want is "it should know the company's documents". That is not a teaching job. It is a retrieval job.

The second is setting up RAG and throwing everything into it. When the retrieved piece is irrelevant, the model builds its answer on it anyway, and you get an answer that looks sourced and is wrong. The quality of RAG depends on the quality of the search, and that part usually gets neglected.

Why memory is a separate box

RAG pulls from a document store, memory carries lessons. The difference looks thin at first, and the consequences are different.

Put the sentence "invoices live in that folder" into the document store and it only comes up when someone asks about the invoice folder. Put it into memory and it is beside the model on every run, applied without being asked.

There is a trap in the other direction too. Pile everything into memory and the number of notes carried along grows and fills the context. Memory is for a small number of things that genuinely recur.

On our side we use two of the three and never chose fine-tuning. The information changes almost daily, and meeting every change with a new training round is not sustainable. We want to be able to show which document an answer came from. And the least discussed reason, which to us matters most, is that fine-tuning ties you to a specific model. When a better one comes out six months later you have a burden to migrate.

The cost side

RAG has a medium setup cost, a small search cost added to every query and a cheap update. Adding a new document is just indexing.

Fine-tuning has a high setup cost, a low query cost because the prompt gets shorter, and a high cost again at every update.

Memory is the cheapest to set up, and in return it takes a small, fixed amount of space on every run.

A bar chart comparing the setup, query and update costs of the three methods.

When fine-tuning really is right

If the shape of the output is very narrow and describing it in a prompt takes too long, fine-tuning pays off. What you are teaching is a pattern, not a fact.

If volume is very high and shortening the prompt saves real money, it makes sense again.

If the domain language is very specialised, for instance terminology the model has barely seen in training, the contribution of fine-tuning becomes noticeable.

Notice that in none of these three cases is the goal "loading knowledge". In all three, what gets taught is behaviour.

The order to decide in

Start with the cheapest. Improve the prompt first and put a few good examples in it, because a large share of cases gets solved right there.

If that is not enough, set up RAG and put at least as much effort into search quality as into generation quality.

When recurring preferences and rules start to accumulate, add memory, but keep the list short.

Leave fine-tuning for last. By the time you get there you will also know what you are teaching and why.

Sources

RAGfine-tuningmemoryarchitecture