Contact, if you are interested in this website / domain name / sponsorship / advertisement / partnership

Fine-tuning vs RAG vs prompting: which should you use?

Prompting changes the instructions, RAG changes the knowledge a model can see and fine-tuning changes its behavior. This guide gives a decision tree, a cost and risk comparison, fine-tuning methods, managed options as of October 2026 and worked examples.

BuildingIntermediate9 min readUpdated October 10, 2026

Key takeaways

  • Prompting changes instructions, RAG changes the knowledge available at answer time and fine-tuning changes the model's learned behavior.
  • Start with prompting and an evaluation set; add RAG when the gap is missing or changing facts, and fine-tune only when a consistent behavior gap remains.
  • Fine-tuning is a poor way to teach facts: it does not cite sources, goes stale and can make a model confidently wrong.
  • LoRA and QLoRA make fine-tuning open-weight models affordable, while managed fine-tuning of proprietary models has narrowed sharply in 2026.
  • Most production systems combine techniques, such as a prompted or tuned model answering from retrieved documents.

When a language model falls short, there are three main levers: change the prompt, give the model better information at answer time or train the model itself. This guide explains what each technique actually changes, offers a decision tree and comparison table, covers fine-tuning methods and managed options as of October 2026 and works through three common scenarios.

What each technique changes

The fastest way to choose is to ask what kind of gap you have: instructions, knowledge or behavior.

  • Prompting changes the instructions. The system prompt, examples and output format tell the model what to do on this request. Nothing persists beyond the request, and changes take effect immediately.
  • Retrieval-augmented generation changes the knowledge in view. Your application searches a document store and places relevant passages in the prompt, so the model answers from current, private and citable sources.
  • Fine-tuning changes the model's behavior. Training on examples adjusts the weights, so the model responds differently by default: a house style, a strict output schema or skill at a narrow task.

An analogy: prompting is a written brief for a contractor, RAG is giving them the company handbook during the job and fine-tuning is months of on-the-job training. Training shapes habits well, but it is a poor way to make anyone memorize a handbook that changes every week.

A decision tree in plain language

Work through these questions in order. Each one assumes you have a small evaluation set, ideally 50 to 200 real inputs with expected outputs, so you can measure progress instead of guessing.

  1. Have you tried a strong prompt on a capable model? If not, start there. Write explicit instructions, add three to five few-shot examples, request structured outputs if you need JSON and test a stronger model. Many gaps close at this step.
  2. Is the remaining gap about facts? If the model lacks information, such as your product catalog, recent events or internal policies, add RAG. If your corpus is small and stable, simply placing it in the prompt with prompt caching may be enough.
  3. Is the gap about behavior that prompting cannot pin down? Examples include a format the model drifts from at volume, a specialized labeling scheme or a tone that requires pages of examples in every prompt. That is a fine-tuning candidate, provided you can assemble hundreds of good examples.
  4. Is the problem cost or latency rather than quality? If a large model meets your bar but costs too much, consider distilling it into a smaller fine-tuned model, or route easy requests to a cheaper model.
  5. Do you need several of these at once? Combine them, adding one layer at a time and keeping each only if the evaluation scores improve.

If you cannot describe what "better" looks like in a few dozen labeled examples, you are not ready to fine-tune. The same examples become your evaluation set and the seed of a training set.

Comparison table: cost, data, time and risk

FactorPromptingRAGFine-tuning
What it changesInstructions per requestKnowledge available at answer timeDefault behavior learned in the weights
Upfront costVery lowMedium: parsing, indexing, search infrastructureMedium to high: dataset building, training, evaluation
Per-request costGrows with prompt lengthAdds retrieved tokens plus search costsCan fall if a shorter prompt or smaller model suffices; custom hosting may cost more
Data neededA few examplesYour documents, cleaned and chunkedHundreds to thousands of labeled examples
Time to first resultHoursDays to weeksWeeks, including data work
FreshnessImmediate editsAs fresh as the indexFrozen at training time
MaintenancePrompt versioning and regression testsSync pipelines, index updates, permission handlingRetraining when data, requirements or base models change
CitationsNoYesNo
Main risksLong, brittle prompts; prompt injectionRetrieval misses; leaked restricted documents; injected contentOverfitting; lost general skills; weakened safety behavior; vendor retirements

Fine-tuning methods

Fine-tuning covers several techniques with very different costs. Memory figures below are rough, for illustration.

Full fine-tuning

Every weight is updated. This gives the most capacity to change the model but needs the most compute: with a standard optimizer, training takes roughly 16 bytes per parameter before activations, about 130 GB for an 8B model, which means several data-center GPUs. You also store a full copy of the model for every variant, and aggressive training can erase general skills, a problem known as catastrophic forgetting.

LoRA and QLoRA

LoRA (low-rank adaptation) freezes the base model and trains small adapter matrices alongside selected layers. The 2021 paper reported up to 10,000 times fewer trainable parameters than full fine-tuning on GPT-3 175B. Adapters are usually tens to hundreds of megabytes, so one base model can serve many of them.

QLoRA, introduced in 2023, loads the frozen base model in 4-bit precision and trains LoRA adapters on top, bringing an 8B model's weights to roughly 5 GB and putting fine-tuning within reach of a single consumer GPU. Popular tools include Hugging Face TRL and PEFT, Unsloth, Axolotl and, on Macs, MLX LM.

Preference tuning

Supervised fine-tuning teaches by imitation: here is the input, here is the ideal output. Preference tuning teaches by comparison: here are two responses, and this one is better. RLHF trains a reward model and optimizes against it, while direct preference optimization (DPO) learns directly from preference pairs and is much simpler to run.

Preference methods help with qualities that are easier to judge than to write, such as helpfulness, concision or tone. Reinforcement fine-tuning, offered on some platforms, instead scores outputs with a grader you define, which suits tasks with checkable answers.

Distillation

Distillation uses a large teacher model to generate high-quality outputs, often thousands of them, then fine-tunes a smaller student model on that synthetic data. The aim is to get near-teacher quality on one narrow task at a fraction of the cost and latency. Check the teacher's terms of service first, because some providers restrict using outputs to train competing models.

Watch: RAG vs Fine-Tuning vs Prompt Engineering: Optimizing AI Models (IBM Technology). Compares three ways to adapt a model to your needs: write better instructions, retrieve outside knowledge at runtime, or train the model further on your data. It works as a practical decision aid for teams choosing where to invest first.

Managed fine-tuning options in 2026

Managed fine-tuning of proprietary models has contracted sharply. Status as of October 2026:

  • OpenAI is winding down self-serve fine-tuning. Since May 7, 2026, organizations that never fine-tuned cannot create jobs; organizations without recent fine-tuned inference lost job creation on July 2, 2026; and all customers lose it on January 6, 2027. Existing fine-tuned models keep serving until their base models are deprecated.
  • Google no longer offers tuning in the Gemini API or AI Studio. Supervised, preference and reinforcement tuning for Gemini, plus tuning of open models, remain available on Google Cloud, where Vertex AI's tuning documentation now sits under the Gemini Enterprise Agent Platform.
  • Microsoft Foundry lists managed fine-tuning for several OpenAI models (supervised, DPO and reinforcement fine-tuning) and open-weight models including gpt-oss, Qwen3.6, Qwen3.8 and Llama 3.3. Availability varies by region, and some options are in preview.
  • Amazon Bedrock offers supervised fine-tuning, reinforcement fine-tuning and distillation for selected foundation models; check the console for the current model list in your region.
  • Mistral AI marks its fine-tuning feature as deprecated in its documentation.
  • Open-weight specialists, including several GPU clouds and inference providers, run LoRA and full fine-tuning jobs on popular open models and host the results.

A model fine-tuned on a proprietary base cannot be exported, and it disappears when the provider retires the base model. Fine-tuning an open-weight model gives you a portable artifact you can host anywhere. See open-source vs closed LLMs for the wider trade-off.

Worked examples

Support replies in a consistent brand tone

Situation: a support team wants replies that match its voice: warm, brief, no jargon and always ending with a next step. A detailed prompt gets most of the way, but the tone drifts on unusual tickets.

Approach: first build a 30-item style rubric and score 100 replies with a human or an LLM judge. Then try a stronger system prompt with five exemplary replies. If that block grows to 6,000 tokens, it costs about $1,200 a month across 100,000 requests at an example rate of $2 per million input tokens, or roughly $60 with cached reads at $0.10 per million.

Fine-tune only if tone scores still fall short: collect 500 to 1,000 of your best human-written replies, train a LoRA adapter on an open model or use a managed service and compare rubric scores against the prompted baseline. Product facts should still come from RAG, not the fine-tune.

Extracting fields from domain documents

Situation: a logistics firm extracts 25 fields from 50,000 freight invoices a month, about 3,000 input and 400 output tokens each.

Approach: start with a capable model, a JSON schema and a few examples, measuring field-level accuracy on 200 labeled invoices. At example frontier prices of $10 input and $50 output per million tokens, the workload costs $1,500 + $1,000 = $2,500 a month. If a frontier model scores well but a small model at $0.10 and $0.50 per million (about $25 a month) misses edge cases, fine-tune or distill the small model using the frontier model's verified outputs as training data. Keep a regression set of tricky invoices and spot-check production output.

Internal knowledge Q&A

Situation: employees ask questions about HR policies, engineering runbooks and product documentation that change weekly, and answers must cite sources and respect access rights.

Approach: this is a RAG problem. Fine-tuning on the documents would go stale within weeks, could not cite sources and would blur access boundaries. Build retrieval with permission filters, hybrid search and reranking, then prompt the model to answer only from sources.

Fine-tuning becomes worth considering later for narrow behaviors, such as consistent citation formatting or reranking. The RAG guide covers the full pipeline.

Combining techniques

The techniques stack. Common production patterns include:

  • Prompted model plus RAG: the default for knowledge assistants.
  • Fine-tuned model plus RAG: the model learns your format, tone and refusal rules, and retrieval supplies current facts.
  • Distilled specialist plus a frontier fallback: a small tuned model handles routine requests, and low-confidence cases escalate to a larger model.
  • Tuned components: a small fine-tuned model classifies intent, rewrites queries or reranks passages, while a general model writes the answer.

Add one layer at a time, and keep it only if your evaluation set shows a gain worth its maintenance cost.

Evaluation before and after

Every technique needs the same discipline: measure, change one thing, measure again.

  1. Freeze a test set first. Use real inputs, including edge cases, with expected outputs or scoring rubrics. Never train on it.
  2. Record a baseline. Score the best prompted model on the test set, including cost and latency per request.
  3. Use task-appropriate metrics. Exact match or field accuracy for extraction, retrieval recall and faithfulness for RAG, rubric scores for tone and pass rates for code.
  4. Check for regressions. After fine-tuning, run general-capability and safety checks to catch lost skills or weakened refusals.
  5. Compare total cost. Include training, hosting, retraining cadence and engineering time, not just per-token price.
  6. Keep monitoring. Sample production outputs, add new failures to the test set and rerun it whenever a model, prompt or index changes.

Common mistakes

  • Fine-tuning to teach facts. Use retrieval for knowledge; fine-tune for behavior.
  • Skipping the prompt baseline. Teams sometimes spend weeks on training data for a gap a better prompt or model would have closed in an afternoon.
  • Training on messy data. Inconsistent examples teach inconsistent behavior. Fifty clean examples beat five hundred noisy ones.
  • No held-out test set. Without it, you cannot tell improvement from memorization.
  • Ignoring platform risk. Proprietary fine-tunes can vanish with their base model, as OpenAI's 2026 wind-down shows.
  • Building RAG for a tiny, static corpus. If everything fits comfortably in the prompt, cache it and skip the pipeline.
  • I can state the gap as instructions, knowledge or behavior.
  • I have a frozen evaluation set with a scored baseline.
  • I tried a stronger prompt and a stronger model before training anything.
  • Knowledge gaps go to RAG; behavior gaps go to fine-tuning.
  • I know who maintains the system and how often it must be retrained or re-indexed.

Next steps

Draft and test a stronger baseline with the prompt builder before you train anything. Compare prompt-heavy, retrieval and smaller-model options with the LLM cost calculator, and if you plan to host a fine-tuned open model, run the numbers in the self-host vs API calculator. For help designing a training dataset or evaluation plan, you can work with an LLM expert.

Sources

  1. LoRA: Low-Rank Adaptation of Large Language Models (Hu et al., 2021)
  2. QLoRA: Efficient Finetuning of Quantized LLMs (Dettmers et al., 2023)
  3. Direct Preference Optimization (Rafailov et al., 2023)
  4. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al., 2020)
  5. OpenAI API deprecations: self-serve fine-tuning update
  6. Microsoft Foundry fine-tuning overview: supported models
  7. Gemini API: model tuning availability
  8. Amazon Bedrock: customize your model
  9. Mistral AI documentation: fine-tuning
  10. MLX LM: LoRA and full fine-tuning on Apple Silicon

Written by the LLModel editorial team and checked against the sources above on October 10, 2026. Found an error? Send a correction.

Frequently asked questions

Is RAG better than fine-tuning?

Neither is better in general; they fix different problems. RAG supplies knowledge at answer time, so it suits facts that change, large document sets and answers that need citations. Fine-tuning changes how a model behaves, so it suits consistent formats, tone or specialized classification. If the model gives wrong facts, try RAG first. If it knows the facts but responds in the wrong way, consider fine-tuning.

Can fine-tuning teach a model new knowledge?

Only weakly and unreliably. Fine-tuning on documents may help a model echo some facts, but recall is inconsistent, it cannot cite a source and every update requires retraining. It can also raise confident errors on topics near the training data. For knowledge that must be accurate and current, retrieval is the dependable tool, with fine-tuning reserved for behavior and format.

How much data do I need to fine-tune an LLM?

For supervised fine-tuning of style or format, a few hundred high-quality examples often show clear gains, and one to several thousand is a typical production range. Quality and consistency matter more than volume, because the model copies whatever patterns your examples contain. Preference tuning needs pairs of better and worse responses, and distillation can generate data from a stronger teacher model.

Is fine-tuning expensive?

The training run is often the cheap part. A LoRA run on an open 8B model with a few thousand examples can finish in hours on a single rented GPU. The larger costs are building a clean dataset, evaluating results, hosting a custom model and retraining whenever the base model or your requirements change. Budget for that ongoing maintenance, not just the first run.

Can I combine fine-tuning and RAG?

Yes, and many strong systems do. A common pattern fine-tunes a model to follow your citation format, tone and refusal rules, then feeds it retrieved passages at query time. Another uses a small fine-tuned model to rewrite queries or rerank documents. Add each layer only when your evaluation set shows a gap the simpler setup cannot close.

More videos on this topic

A Survey of Techniques for Maximizing LLM Performance

OpenAIIntermediateWatch on YouTube

OpenAI engineers lay out a framework for improving an LLM application: start with prompting and evaluation, then add retrieval for missing knowledge or fine-tuning for consistent behavior. It is aimed at developers with a working prototype who need a disciplined path to better accuracy.

Need hands-on help building it?

RAG, agents, fine-tuning or a production chatbot: describe the project and we'll suggest an approach and, if you want, partners who build it.

  • Free and vendor-neutral: no model provider pays for placement.
  • Your details go only to partners you agree to.

Takes about 2 minutes. No sales calls unless you ask for one.