Fine-Tuning vs RAG vs Prompting: A Decision Framework

A decision framework for choosing between prompting, retrieval-augmented generation and fine-tuning, with a comparison table and worked cost examples.

DIDatainter TeamOCT 15, 20269 MIN READTECHNOLOGY

When a language model does not behave the way a product needs, there are three main levers to pull. You can improve the prompt. You can give the model access to your data at query time through retrieval. Or you can change the model itself through fine-tuning. Teams often jump to the most complex option, usually fine-tuning, because it sounds like the serious solution, and then spend months on a problem that a better prompt or a search index would have solved in a week.

The three approaches fix different problems. Prompting shapes behavior. Retrieval supplies knowledge. Fine-tuning changes habits and style. Once you see that distinction, the choice is mostly a matter of diagnosing what is actually wrong.

Diagnose the failure before choosing the fix

Collect twenty to fifty examples of bad outputs and classify each one.

  • The model does not know a fact. It lacks your product details, policies, or recent events. This is a knowledge problem.
  • The model knows but behaves inconsistently. It ignores the format, uses the wrong tone, or fails to follow a multi-step procedure. This is a behavior problem.
  • The model is correct but too slow or too expensive. A large model does a job a small one could do if specialized. This is an efficiency problem.
  • The model reasons poorly on the task. It makes logical errors, or the task needs skills it lacks. This is a capability problem, and no amount of prompting, retrieval or light fine-tuning fully solves it; a stronger model might.

Knowledge problems point to retrieval. Behavior problems point to prompting first and fine-tuning if prompting plateaus. Efficiency problems point to fine-tuning or distillation. Capability problems point to a different model.

Prompting tells the model what to do, retrieval tells it what to know, and fine-tuning changes how it tends to behave. Diagnose which of the three is missing.

Prompting

Prompting means changing the instructions, examples and structure of the input without touching model weights. It includes system prompts, few-shot examples, step-by-step instructions and output schemas.

Strengths

  • Fastest iteration: change text, run the evaluation set, see results in minutes.
  • No training infrastructure, data pipeline or special model hosting.
  • Easy to version, review and roll back.
  • Works across model upgrades with modest re-tuning.

Limits

  • Every instruction costs tokens on every call. A 2,000-token prompt is paid for each request.
  • Context windows are finite, so you cannot teach large bodies of knowledge or hundreds of examples.
  • Behavior can be inconsistent on edge cases, and long prompts become brittle.
  • Cannot reliably teach very specialized styles or formats that differ greatly from the model’s defaults.

Prompting should always be your first attempt and your baseline. If you have not tried clear instructions, a few diverse examples and a structured output schema, you do not yet know whether you need anything more.

Technology · Fine-Tuning vs RAG vs Prompting: A Decision Framework

Retrieval-augmented generation

RAG fetches relevant documents at query time and places them in the prompt, so the model answers from current, specific material.

Strengths

  • Knowledge stays outside the model: update a document and the system knows it immediately, with no retraining.
  • Citations are possible, so users and auditors can verify answers.
  • Access control can be enforced at retrieval, so each user sees only permitted content.
  • Reduces hallucination on factual questions when it works well.
  • Handles large and changing corpora.

Limits

  • Quality depends on retrieval: chunking, embeddings, hybrid search and reranking all need engineering and evaluation.
  • Adds latency and infrastructure: an index, an ingestion pipeline, a retrieval service.
  • Costs extra input tokens for each retrieved passage.
  • Does not change style or reasoning habits, and struggles with questions that need aggregation across many documents.

RAG is the right default whenever the answer depends on data the base model could not have seen or that changes: product catalogs, policies, contracts, support articles, internal wikis.

Fine-tuning

Fine-tuning continues training a model on your examples so that desired behavior becomes its default. Common forms include supervised fine-tuning on input-output pairs, preference-based tuning, and parameter-efficient methods such as LoRA that train small adapters rather than all weights. Hosted providers offer managed fine-tuning for selected models; open-weight models can be tuned on your own infrastructure.

Strengths

  • Consistent style, tone and format without long prompts, which shortens inputs and reduces per-call cost.
  • Can teach narrow specialized tasks, such as classifying into a company-specific taxonomy or extracting fields from unusual documents, with high accuracy.
  • Lets a small model match a large one on a narrow task, lowering latency and cost at scale (distillation).
  • Reduces reliance on lengthy few-shot examples.

Limits

  • Needs good data: typically hundreds to a few thousand high-quality examples, which must be collected, cleaned and labeled. Poor data produces confidently wrong models.
  • Poor at injecting facts. Fine-tuned models learn patterns, not a reliable database, and can still hallucinate details. Updating knowledge means retraining.
  • Ongoing maintenance: when the base model is deprecated or you want a newer one, you retrain and re-evaluate.
  • Risk of regressions in general capabilities and of memorizing sensitive data present in the training set.
  • Slower iteration cycles, often hours or days per experiment instead of minutes.

Side-by-side comparison

Dimension Prompting RAG Fine-tuning
Best at Shaping behavior and format Supplying current, specific knowledge Consistent style, narrow tasks, cost reduction at scale
Fixes Instruction following, tone Missing or changing facts Habitual behavior, specialization
Does not fix Missing knowledge Style, poor reasoning Factual updates, weak base capability
Time to first result Hours Days to weeks Weeks
Data needed A handful of examples A document corpus Hundreds to thousands of labeled examples
Updating Edit text Re-index documents Retrain
Per-call cost Higher with long prompts Higher with retrieved context Lower prompts, possibly cheaper model
Upfront cost Very low Moderate (pipeline, index) Moderate to high (data, training, evaluation)
Explainability Visible instructions Citations to sources Opaque
Main risk Brittleness Retrieval misses Data quality, drift, maintenance

Cost examples

The numbers below are illustrative, with simple assumptions, to show how the economics shift with volume. Substitute your actual prices.

Scenario A: customer support assistant, 50,000 questions per month.

Approach: RAG with a mid-tier model. Each question uses 3,000 input tokens (instructions plus retrieved passages) and 300 output tokens. At US$3 per million input and US$15 per million output tokens, the cost per question is about US$0.009 + US$0.0045 = US$0.0135, so roughly US$675 per month in model fees. Add vector storage and a reranker, perhaps US$100 to US$300 monthly, plus a one-time build of a few weeks of engineering. Prompting alone would be cheaper per call but could not answer questions about changing policies. Fine-tuning would not help here: the problem is knowledge.

Scenario B: classifying 2 million short messages per month into 40 categories.

Option 1: a large model with a 1,200-token prompt of instructions and examples, 100 tokens of message and 10 output tokens. At the prices above, that is about 1,300 x 3 / 1,000,000 + 10 x 15 / 1,000,000 = US$0.0039 + US$0.00015 = roughly US$0.004 per message, or US$8,100 per month.

Option 2: fine-tune a small model on 3,000 labeled examples. The prompt shrinks to about 150 tokens because behavior is baked in, and the small model costs, say, one-twentieth as much per token. The per-message cost falls to a fraction of a cent: well under US$0.0005, or under US$1,000 per month. Training and data labeling might cost US$3,000 to US$10,000 once, plus periodic retraining. The break-even is within two to three months. At 20,000 messages a month instead, the savings would not justify the effort, and a prompt on a small model would be the better choice.

Scenario C: brand-voice marketing copy, 5,000 drafts per month.

A detailed style guide plus three examples in the prompt adds around 1,500 tokens per call. At 5,000 calls that is trivial in cost, so prompting wins. Fine-tuning would only make sense if the style was very distinctive, the prompt could not capture it, and volume grew by an order of magnitude.

The pattern: fine-tuning pays off when volume is high, the task is narrow and stable, and you have good labeled data. RAG pays off when knowledge matters. Prompting wins everywhere else, and always wins on speed to learn.

A decision framework

Work through these questions in order.

  1. Have you written a strong prompt and measured it? If not, do that first, with a proper evaluation set. Many projects end here.
  2. Does the task depend on information the model lacks, or that changes? If yes, add retrieval. Measure retrieval quality and answer faithfulness separately.
  3. Does the model still behave inconsistently after prompting, in ways examples cannot fix? Consider fine-tuning, but only if you can assemble a few hundred clean examples and the task is stable.
  4. Is cost or latency the problem at high volume? Estimate break-even for fine-tuning a smaller model, including data and retraining costs, against simply using a cheaper off-the-shelf model with a good prompt.
  5. Is the issue raw reasoning ability? Test a stronger model before investing in any customization.

Remember that the approaches combine well. A common production design uses RAG for knowledge, a carefully structured prompt for behavior, and a fine-tuned small model for a high-volume sub-step such as routing or extraction. Fine-tuning a model to use retrieved context better, to cite sources or to resist irrelevant passages, is another valid combination, but it should come after the simpler pieces work.

Pitfalls to avoid

  • Fine-tuning to add knowledge. It is unreliable and expensive to update. Use retrieval.
  • Skipping the evaluation set. Without it you cannot tell whether any of the three improved anything.
  • Training on messy data. A thousand good examples beat ten thousand noisy ones.
  • Forgetting maintenance. Tuned models are assets with upkeep: retraining on base model changes, drift monitoring and re-evaluation.
  • Ignoring data rights. Make sure you may use the data for training, and avoid including personal data you cannot justify.
  • Overbuilding RAG. A small corpus that fits in a long context window may not need an index at all; test stuffing the documents into the prompt, with caching, as a baseline.

Datainter usually recommends a staged approach to clients: prompt baseline in week one, retrieval if the diagnosis calls for it, and fine-tuning only when production logs have produced enough labeled data to justify it.

Key takeaways

  • Diagnose the failure first: missing knowledge, inconsistent behavior, cost or latency, or weak reasoning each point to a different fix.
  • Prompting is the baseline and the fastest iteration loop; always exhaust it and measure before adding complexity.
  • Use RAG for knowledge that is large, private or changing, and evaluate retrieval separately from generation.
  • Use fine-tuning for stable, narrow, high-volume tasks with good labeled data, mainly to lock in style or to move work to a cheaper model.
  • Fine-tuning is poor at adding facts, and it carries ongoing maintenance and data-rights obligations.
  • Combine approaches deliberately, and let a measured evaluation set, not intuition, decide when to add the next layer.
#fine-tuning#rag#prompting#decision framework
DI
Datainter TeamEngineers, designers and operators building software and fintech products from Medellín, Tigard and Luxembourg.

Building something in this space?

Talk to the team that ships and operates it. We reply within one business day.

Start a project
Chat with us on WhatsAppUSUALLY REPLIES WITHIN MINUTES