# Fine-tuning vs prompting vs RAG

> Fine-tuning versus prompting versus RAG is the choice among changing the prompt, retrieving source text, and training a model update.

Choosing among a prompt change, retrieval, and a trained update.

Track: Ship & Maintain
Access: free
Card: https://buildsparkai.com/fine-tuning
Plain text: https://buildsparkai.com/fine-tuning.md
Last checked: 2026-10-18

## What it is

OpenAI's guide to optimizing LLM accuracy says prompt engineering, retrieval-augmented generation, and fine-tuning are levers that solve different problems, and that you pick the lever after you see why the eval failed. It describes RAG as retrieving content to put in the prompt before the model answers, so the model can use domain-specific context. It describes fine-tuning as further training, either to perform a task more accurately or to reach the same accuracy with fewer tokens or a smaller model. Anthropic's glossary defines fine-tuning as further training on additional data so the model mimics that dataset, and defines retrieval-augmented generation as passing retrieved documents into the context window at runtime. The glossary also says the Claude API does not currently offer fine-tuning. A prompt change or a retrieval change does not need a training path. A trained update needs a path you actually have, and an eval set either way.

## Why it matters

**Cost.** OpenAI's accuracy guide gives efficiency as one reason to fine-tune: the same accuracy for fewer tokens, or a smaller model. A retrieval step puts source text in the prompt instead. This card does not add a price.

**Quality.** OpenAI's accuracy guide says many large deployments used prompt engineering and RAG, and that fine-tuning does not replace retrieval when the failure is missing context. It also says non-representative training examples are a common pitfall: the examples have to look like what production sends.

**Risk.** OpenAI's accuracy guide says non-representative training data is a common pitfall: the examples have to look like what production sends. It also says to keep a hold-out set and evaluate after training. Ship the prompt or retrieval change the eval set can already grade before you plan a trained update.

## Try today

Take five failed examples. Mark each one "the fact was missing" or "the fact was there and the format was wrong." Missing facts go to retrieval or a prompt that includes the source. Format errors stay on the prompt until a training path you can use beats that prompt on the eval set.

## Common mistake

Fine-tuning so the model learns the documents. OpenAI's accuracy guide says retrieval is how you give the model context it does not already have. Fine-tuning is for behavior you can show with examples.

## Self-check

The close time is wrong because the document was never in the prompt. Which lever comes first?

Retrieve the document, or put the source in the prompt

## Practice and deep

Coming soon. Five failures marked missing-fact or wrong-format, and the lever you would test first on each.

Coming soon. How OpenAI's accuracy guide separates context you retrieve from behavior you train, and how Anthropic's glossary defines both.

## Sources

- [OpenAI, Optimizing LLM accuracy](https://developers.openai.com/api/docs/guides/optimizing-llm-accuracy)
- [Anthropic, Glossary](https://platform.claude.com/docs/en/about-claude/glossary)

Opened 2026-10-18. Vendor, framework, or standards docs. This card does not add a rate, a usage count, or a score of its own. Numbers quoted from a source are labelled vendor-reported or as that document's own words.
