Skip to content
PHP2Shell: The PHP Bug
Akshay Thakare

RAG vs Fine-Tuning vs Prompting: Which One?

A decision guide: when better prompts are enough, when to add retrieval, and when fine-tuning is actually worth the cost.

LLMsIntermediate2 min readUpdated 11 Oct 2026

They solve different problems

NeedBest first tool
Clearer instructions, better formatPrompting (instructions, examples)
Answers from private or changing knowledgeRAG (retrieve documents at query time)
Consistent style, format or narrow skill at scaleFine-tuning
Lower cost or latency on a narrow taskFine-tune a smaller model

Prompting first

It is cheap, fast to iterate and needs no training data. Many problems blamed on the model are fixed with clear instructions, a few examples and a defined output format.

RAG for knowledge

Fine-tuning is a poor way to teach facts: knowledge becomes stale, cannot be cited and is hard to remove. RAG keeps knowledge in documents you can update, filter by permission and cite.

Fine-tuning for behaviour

Fine-tune when you have many good examples (often hundreds to thousands) of the exact input → output behaviour, and prompting cannot reach the quality or cost you need. Techniques such as LoRA make it cheaper.

Often combined

A fine-tuned model that follows your format reliably, plus RAG that supplies current facts, plus a prompt with the task rules.

Finished this note?

Share