Suryanand/ Bootcamp
suryanand.com ↗Let's talk
← Fine-tuningAI guideBeginner#fine-tuning#rag#prompting#architecture
Frame · ai-engineering / fine-tuning / 01-fine-tune-vs-rag-vs-prompting.mdGuide 072 / 103

Fine-tune vs RAG vs prompting, a decision guide

Every few weeks someone asks me "should we fine-tune?" and the honest answer is usually "not yet". Prompting, retrieval and fine-tuning solve different problems, and picking the wrong one wastes weeks of GPU time or leaves you with a model that confidently answers from stale knowledge. This guide gives you a decision procedure you can run in a meeting, plus the signals that tell you it is finally time to train.

Why it matters

The landscape shifted in 2026. OpenAI started winding down its self-serve fine-tuning platform in May 2026, saying its newer models follow instructions and formats well enough that most customers no longer need tuning; existing fine-tuned models stay available until their base models are deprecated. At the same time, open-weight models plus libraries like TRL and Unsloth made it cheaper than ever to tune a small model yourself, and cloud providers such as Amazon Bedrock added reinforcement fine-tuning for open-weight models.

So the question is no longer "can we fine-tune?" but "which problem are we actually solving?" The three levers map to three different gaps:

  • Prompting fixes gaps in instructions: the model can do the task but does not know what you want.
  • RAG fixes gaps in knowledge: the model needs facts it was never trained on, or facts that change.
  • Fine-tuning fixes gaps in behaviour: format, tone, a narrow skill, latency, or cost at scale.

Mixing these up is the most common mistake I see. Fine-tuning to inject a product catalogue that changes weekly is a classic example: you get a model that memorised last month's prices.

How it works

Run the problem through this ladder from the top. Each rung is cheaper and faster to iterate on than the next, so only move down when you have evidence that the rung above has plateaued.

Rendering diagram…

The "500+ examples" number is my rule of thumb, not a law; some LoRA runs work with a few hundred clean examples, and RL with verifiable rewards can start from a few hundred prompts plus a grader. The point is that fine-tuning without data is just wishful thinking.

A few signals that point clearly at fine-tuning:

  1. Your prompt has grown past a few thousand tokens of rules and few-shot examples, and you pay for them on every call.
  2. You need a strict output format (a DSL, a JSON schema with domain conventions) and structured outputs alone are not enough.
  3. You want a small model (1B to 8B parameters) to match a large model on one narrow task so you can self-host or cut latency.
  4. You have a programmatic way to check correctness (unit tests, a SQL executor, a math checker), which makes RL viable.

Reference architecture

In practice the answer is often "all three". Production systems I have built tend to look like this: a fine-tuned small model for the narrow, high-volume step, retrieval for anything factual, and a big general model behind a router for the long tail.

Rendering diagram…

The feedback loop at the bottom matters. Logged traffic, labelled by humans or graders, is the cheapest source of fine-tuning data you will ever have. If you design for it from day one, the decision to fine-tune later becomes a data question instead of a research project.

Code

Before you fine-tune, prove the prompt baseline is the ceiling. This small harness scores a prompt against a labelled set; run it with your best prompt and a few-shot variant, and only consider training if both plateau below your target.

import json
from openai import OpenAI

client = OpenAI()

def score_prompt(system_prompt: str, examples: list[dict], model: str) -> float:
    correct = 0
    for ex in examples:
        resp = client.responses.create(
            model=model,
            instructions=system_prompt,
            input=ex["input"],
        )
        if resp.output_text.strip() == ex["expected"].strip():
            correct += 1
    return correct / len(examples)

with open("eval_set.jsonl") as f:
    eval_set = [json.loads(line) for line in f]

baseline = score_prompt(open("prompt_v1.txt").read(), eval_set, model="gpt-5.5")
few_shot = score_prompt(open("prompt_v2_fewshot.txt").read(), eval_set, model="gpt-5.5")
print(f"zero-shot {baseline:.2%}  few-shot {few_shot:.2%}")

Exact match is crude; swap in a task-specific checker. The important part is that the same eval set later becomes the yardstick for your fine-tuned model (see evaluating a fine-tuned model).

Trade-offs and pitfalls

  • Fine-tuning does not reliably add knowledge. Models learn facts from SFT slowly and unevenly, and they can become more confident about things they half-learned. Use retrieval for facts.
  • You inherit a maintenance burden. Every new base model release means re-running your pipeline and evals. With hosted platforms, your tuned model can disappear when the base model is deprecated, which is exactly the situation OpenAI customers are now planning around.
  • Prompting is cheap to change; weights are not. A prompt fix ships in minutes. A training fix needs data, a run, evals and a rollout.
  • RAG has its own failure modes. Bad chunking or retrieval can look like a "model problem". Check retrieval recall before blaming the model.
  • Small fine-tuned models can be brittle outside their lane. Route anything off-distribution to a general model.
  • Cost math changes with volume. At low volume a big model with a long prompt is cheaper than owning a training pipeline. At millions of calls per day, a tuned 8B model on your own GPUs can win decisively.

Checklist

  • Write down which gap you are solving: instructions, knowledge, behaviour, or cost/latency.
  • Build a labelled eval set of at least 100 to 200 real examples before anything else.
  • Measure zero-shot and few-shot baselines on a strong model.
  • If the gap is knowledge, try retrieval first and measure retrieval recall separately.
  • Only fine-tune when you have enough clean examples or a reliable grader.
  • Plan for base model deprecation and retraining from the start.
  • Log production traffic so it can become future training data.

Further reading

Why this exists README

I learn best by explaining things, so I record the explanations. Everything here is free, with no sign-up. If a lesson helps you ship something, I'd love to hear about it.