FDEInterviews logo
🧠 Foundations of LLMs & GenAI
Foundational

Fine-tuning vs RAG vs Prompting

Prompting, RAG, and fine-tuning are the three ways to adapt a model to your problem, and choosing among them is the decision FDE interviewers probe most. The framework: prompt first, add RAG when the model needs facts it lacks or must cite, and fine-tune to change behavior or format rather than knowledge. They compose; they are not rivals.

TL;DR: Prompting changes what you ask, RAG changes what the model can see, and fine-tuning changes how the model behaves. Try them in that order because that is also cheapest to most expensive. The cleanest test: if the gap is missing or changing facts, reach for RAG; if it is consistent behavior, tone, or output format, reach for fine-tuning; most often you use prompting plus one of the other two together.

The three levers

  • Prompting. You shape behavior with instructions, examples, and format constraints in the request itself. Zero build cost, instant iteration, no infrastructure. It is always the first thing to try and often the only thing you need.
  • RAG. You retrieve relevant documents at query time and put them in the prompt, so the model answers from real sources. This is how you give a model knowledge it never had or that changes, and how you make answers citable and auditable.
  • Fine-tuning. You continue training the model on your own examples so its default behavior shifts. This is for teaching a style, a format, a domain dialect, or a task pattern that examples in the prompt cannot pin down reliably. It bakes behavior into the weights; it does not give the model live facts.

The axes that decide it

Run the problem through these and the choice usually falls out:

  • Facts vs behavior. Need the model to know something specific or current? That is RAG (or prompting, if you can paste it). Need it to consistently act or format a certain way? That points to fine-tuning. This axis alone resolves most cases.
  • Data freshness. Knowledge that changes (prices, inventory, policies, this quarter's docs) cannot live in frozen weights. RAG, because you update the index, not the model.
  • Auditability and citations. If a regulator or a user needs to see the source for an answer, RAG gives you that; fine-tuning hides knowledge inside weights you cannot point at.
  • Data volume. A handful of examples fits in a prompt. Thousands of consistent examples that define a behavior justify fine-tuning.
  • Cost and latency. Prompting is free to change but spends tokens every call. RAG adds a retrieval step and more prompt tokens. Fine-tuning has up-front training cost and re-training when behavior needs to change, but can cut per-call tokens by moving instructions into the weights.

Side by side:

AxisPromptingRAGFine-tuning
Facts vs behaviorBehavior, if pasteableFactsBehavior and format
FreshnessManual pasteUpdate the indexFrozen in weights
AuditabilityNoneCites sourcesHidden in weights
Data volumeA few examplesIndexed documentsThousands of examples
Cost and latencyFree to change, tokens per callRetrieval step, more tokensUp-front training, fewer per-call tokens

A decision sketch

Climb the ladder, measuring at every rung every rung 1 Adapt the model to this customer's problem 2 Write a clear prompt the cheapest lever 3 Measure on real inputs not on the three you tried 4 Gap is facts? add RAG, retrieve and cite 5 Measure again did retrieval move it 6 Gap is behavior? then fine-tune, not before 7 Measure again same set, same bar 8 Ship the stack they compose, they do not compete Zero build cost, instant iteration, no infrastructure. It is always the first thing to try and often the only thing you need. Facts versus behavior resolves most cases on its own. Knowledge that changes cannot live in frozen weights, and weights cannot be cited to a regulator. Justified by behavior, format, scale or latency, never by prestige. Thousands of consistent examples justify it; a handful of them fits in a prompt instead. Fine-tuning handles how it answers, RAG handles what it answers about, the prompt orchestrates the request. Treating them as a three-way fight is the rookie error.

The spine below is the same order as a ladder you climb one rung at a time, with the measurement step the decision sketch leaves out.

rendering diagram…

They compose

The framing as a three-way fight is the rookie error. In practice they stack. A mature deployment often fine-tunes a model to reliably output the right JSON structure and house tone, uses RAG to feed it current, citable facts, and wraps both in a carefully engineered prompt that sets the rules and the refusal behavior. Fine-tuning handles how it answers, RAG handles what it answers about, prompting orchestrates the request. Asking "RAG or fine-tuning?" as if you must pick one usually means the question has not been split into facts versus behavior yet.

Why interviewers probe this

This is the single most common applied-AI design question because it is the decision you will make on day one of a deployment. They are screening for whether you reach for the cheap lever first and whether you can articulate the facts-versus-behavior split. The failing answer is "we'll fine-tune the model on the customer's documents" to add knowledge, which is slow, expensive, hard to update, and impossible to cite, exactly the job RAG does better. The follow-up they hold back: "the customer's data changes daily, does fine-tuning still make sense?" Strong answer: no, frozen weights cannot track daily changes, so facts go through RAG and you reserve fine-tuning, if anything, for stable behavior and format.

Common misconceptions

  • "Fine-tuning teaches the model new facts." It mostly shapes behavior and format and bakes in static patterns; it is a poor and stale way to inject knowledge that changes. Use RAG for facts.
  • "RAG and fine-tuning are alternatives." They solve different problems (what the model sees vs how it behaves) and are routinely used together.
  • "Fine-tuning is the serious, grown-up option." It is the most expensive to build and maintain. Prompting and RAG solve most problems; fine-tuning is justified by behavior, format, scale, or latency needs, not prestige.
  • "More fine-tuning data is always better." Quality and consistency of examples matter more than volume, and a small clean set can beat a large noisy one.

Key takeaways

  • Prompting changes the request, RAG changes what the model can see, fine-tuning changes how it behaves; try them in that order, cheapest first.
  • Split the problem on facts versus behavior: missing or changing facts go to RAG, consistent behavior or format goes to fine-tuning.
  • Use RAG, not fine-tuning, for knowledge that changes or must be cited; frozen weights cannot stay fresh or be audited.
  • They compose. Real systems combine a tuned model, retrieved context, and a structured prompt rather than choosing one.
RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS