RAG = Retrieval-Augmented Generation — an open-book exam instead of asking the model to answer purely from memory
Think of an LLM as a brilliant person who read almost the entire internet — but stopped reading on a fixed cutoff date, and has never seen your company's documents, your database, or anything private or recent. That gap causes three concrete, well-documented problems, and RAG (introduced by Lewis et al. in the 2020 paper "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks") exists to fix all three at once, without retraining the model.
Instead of relying purely on what the LLM "remembers" from training, RAG fetches relevant, real information from your trusted sources at question time and hands it to the LLM as reference material before it answers. It's the difference between an open-book exam and a closed-book one — the model still has to reason, but it's reasoning over real material in front of it instead of guessing from memory. Crucially, RAG changes nothing about the model's weights — it's an inference-time technique, which is exactly why it's cheap to update (edit a document, not retrain a model) and why it works with any LLM, including ones you don't control.
An LLM's knowledge has a hard cutoff date baked in at training time — everything it knows comes from a dataset that was frozen months before release. Ask it about something that happened after that date, or about your internal company wiki, and it simply doesn't know, no matter how the question is phrased. Two important nuances:
An LLM is trained with next-token prediction: given the tokens so far, predict a probability distribution over the next token and sample from it. Nothing in that objective rewards saying "I don't know" — a plausible-sounding wrong answer and a plausible-sounding right answer both score well under next-token prediction, because the training signal never distinguishes "confidently correct" from "confidently wrong." This is why hallucination isn't a bug that better prompting fully solves — it's a structural consequence of how these models are trained. A hallucinated citation (a paper that doesn't exist, cited with a plausible-looking title and author list) is the classic example: it fails silently, because it reads exactly like a real one.
Even when the LLM happens to answer correctly, there's no way to verify where that answer came from — the weights don't carry provenance. You can't audit it, a dealbreaker for regulated industries like finance, insurance, and healthcare, where every answer may legally need to be traced back to a source document (e.g., "which clause of the policy says that?").
All three approaches try to get new information into an LLM's answers, but they solve different problems and are frequently confused with each other:
Instead of asking the model to answer purely from memory, RAG retrieves the relevant text at the moment the question is asked and hands that text to the model as context. The model then answers from what's in front of it rather than from what it memorized — and because the source text came from a known document, the answer can also be traced back to exactly where it came from, solving the explainability problem along the way. This doesn't make hallucination impossible (see Generation Failure Modes — a model can still ignore the provided context), but it gives the system something concrete to ground, measure, and audit against, which a closed-book answer never has.
RAG is not free, and it's not always the right answer: