AI Hints
Home›Fine-Tuning LLMs Tutorial›When to Fine-Tune
Fine-Tuning LLMs · Lesson 4 of 120

Prompting, RAG or Fine-Tuning?

Choosing the right tool.

⏱ 2 min read▶ Video at 5:35🎓 Free
Watch this lesson in the Fine-Tuning LLMs courseWatch on YouTube ↗Full Fine-Tuning LLMs course

Fine-tuning is powerful. But it's not always the right tool. There are three main ways to make a model do what you want. Let's meet all three, and learn when to use each one.

  • Not always the right tool
  • Three main ways
  • When to use each one

Three ways to change a model

The first is prompting. You write better instructions, and examples, in the message you send. The second is RAG, which stands for retrieval augmented generation. You search your documents, and paste the useful parts into the prompt. The third is fine-tuning. You change the model's weights, with your own examples.

Promptingbetter instructions in the message
RAGsearch your documents, add them to the prompt
Fine-tuningchange the weights with examples

Which one, when?

Here's a simple guide. If you need new facts, like today's prices, use RAG. Facts change, and RAG always reads the latest version. If you need a style, a format, or a skill done the same way every time, fine-tuning shines. And if a good prompt already works, just use the prompt. It's the cheapest option.

You need…Best tool
A quick resultprompting
Up-to-date factsRAG
A fixed style or formatfine-tuning
A small, fast, cheap modelfine-tuning

Always try prompting first

A good rule. Always try prompting first. It's free, and it takes minutes. If the results aren't good enough, or the prompt gets very long and expensive, then consider fine-tuning. And these tools work together. A fine-tuned model can still use RAG.

keyvalue
Step 1try a good prompt
Step 2add RAG for facts
Step 3fine-tune for behaviour
Togetherthey combine well

Summary

Let's recap. Prompting changes the message. RAG adds facts from your documents. Fine-tuning changes the weights, and is best for style, format, and skills. And always try prompting first. Next, what fine-tuning can, and can't, do.

Key takeaways
  • Prompting: the message
  • RAG: facts
  • Fine-tuning: behaviour
Next up: What Fine-Tuning Can and Can't Do — set the right expectations