Skip to content

Fine-Tuning Versus RAG Versus Prompting

Three ways to adapt a language model to your needs, what each is good for, and how to choose.

Editorial team 2 min read

When a general-purpose model doesn't do what you need, there are three main levers. They solve different problems.

Prompting

Adjust instructions, provide examples and specify formats.

Best for: behaviour, tone, format and task definition. Pros: fast, cheap, easy to change. Cons: limited by context length; knowledge must be included each time.

Retrieval-Augmented Generation (RAG)

Retrieve relevant documents at query time and include them in the prompt.

Best for: answering from specific, changing or private knowledge, with citations. Pros: knowledge stays current by updating documents; answers can be traced to sources. Cons: quality depends on retrieval; adds infrastructure.

Fine-Tuning

Train the model further on your examples.

Best for: consistent specialised behaviour or style at scale, specific output formats, or making a smaller model perform a narrow task well. Pros: can reduce prompt length and cost; behaviour is built in. Cons: needs good training data; slower to change; not an efficient way to add frequently changing facts.

How to Choose

  1. Start with prompting and a solid evaluation set.
  2. If the model lacks knowledge, add RAG.
  3. If behaviour still isn't consistent enough, or you need a cheaper model to match a larger one, consider fine-tuning.

Combine Them

Many production systems use all three: a fine-tuned model, a carefully written prompt and retrieved context.

More in Generative AI

All Generative AI guides →
Generative AI Guide · 2 min

Prompt Engineering Fundamentals

The building blocks of a good prompt — context, task, constraints and format — with before-and-after examples.

Generative AI 2 min read 24 Jul 2026

Generative AI Guide · 2 min

Few-Shot Prompting With Examples

Showing a model a few examples of the input and output you want is often clearer than describing it. How to choose good examples.

Generative AI 2 min read 23 Jul 2026

Generative AI Guide · 2 min

Getting Structured Output From LLMs

How to get JSON and other machine-readable output reliably from a language model, and how to validate it.

Generative AI 2 min read 22 Jul 2026

Generative AI Guide · 2 min

Why Language Models Hallucinate

What hallucination is, why it happens, and practical ways to reduce and catch it.

Generative AI 2 min read 21 Jul 2026