Prompt vs RAG vs Fine-Tuning

You have three pathways to get useful work from an LLM. The big mental model:

Pick the lever that matches the bug.

Intuition

Method What changes Best when Main trade-off
Prompting Only the input instruction Fast experiments, low cost, simple tasks Can be inconsistent; wording-sensitive
RAG Model gets retrieved external knowledge at answer time Facts change often, or answers must come from private/current docs Quality depends on retrieval and chunking
Fine-tuning Model weights update on task data You want a stable style, format, or domain habit Training cost, data quality, forgetting risk

How it works

A practical decision checklist

  1. Does the knowledge change often? → Prefer RAG first.
  2. Do you need a stable, reusable behavior (tone, schema, domain phrasing)? → Fine-tuning becomes attractive.
  3. How much labeled data do you have? Small data usually favors prompting, RAG, or light PEFT before full fine-tuning.
  4. Is this one task or many related tasks? Related tasks can share one multi-task fine-tune later.
  5. Is the base model already almost right? If yes, train less (freeze more / lighter methods).
flowchart TB START[The model is not doing what I want] --> Q1{Is the problem
missing facts?} Q1 -->|Yes| RAG[Use RAG
retrieve the documents] Q1 -->|No| Q2{Is the problem
unclear instructions?} Q2 -->|Yes| PROMPT[Fix the prompt first] Q2 -->|No| Q3{Is the behaviour
needed every time?} Q3 -->|No| PROMPT Q3 -->|Yes| FT[Fine-tune]

Three ways the same bug looks

Suppose a banking assistant gives a bad answer. The cause decides the cure:

What actually went wrong Symptom Right fix
It did not know the new overdraft fee Confidently quotes last year's fee RAG — the fee lives in a document, not in the weights
It answered in a paragraph when you needed JSON Correct facts, unusable format Prompting — say the format explicitly
It writes JSON correctly 9 times out of 10 Occasional format break at scale Fine-tuning — make the format a habit

Notice that only the third row needs training. The first two are cheaper and faster to fix, which is why they come first.

Cost and speed, roughly

Method Setup time Cost per change How fast you can undo it
Prompting Minutes Nearly zero Instantly
RAG Days Low Update the documents
Fine-tuning Days to weeks High (GPU time + data work) Retrain or roll back the model

This is the honest reason prompting and RAG are tried first: when you are wrong, you find out cheaply.

Split workflows are normal

One product can use both:

You do not have to force one tool for every workflow.

A support assistant might combine all three in a single reply: a prompt sets the tone and the answer format, RAG pulls today's refund policy, and a fine-tuned model makes sure the reply always ends with a structured summary block for the ticketing system.

Where knowledge should live

A useful framing is “fine-tuning or retrieval?”:

What goes wrong

One-line summary

Prompt for control, RAG for fresh/private facts, fine-tune for stable reusable behavior — choose by what must change.

Key terms