AI comparison
Prompt engineering vs fine-tuning
Start with prompt engineering, which is fast and cheap to change; move to fine-tuning only when a measured gap remains that better prompts and examples cannot close.
| Aspect | Prompt engineering | Fine-tuning |
|---|---|---|
| Time to try | Minutes | Days, with data to gather |
| Cost to change | Edit text | Train again |
| Data needed | A few examples | Hundreds or thousands of examples |
| Per-call cost | Longer prompts cost more tokens | Shorter prompts once trained |
Choose Prompt engineering when
- You are still finding out what good looks like
- The task changes often
- You have few examples
Choose Fine-tuning when
- Evals show a gap prompts cannot close
- The task is stable and repeated at volume
- You have a clean training set and a separate test set
Learn it hands-on
These free lessons teach it with commands to run in a lab and checked tasks. Read them whole with no account.
Related terms
- Prompt
- A prompt is the text you send a language model to tell it what to do: the instruction, any examples, and the material it should work on.
- Few-shot prompting
- Few-shot prompting puts a handful of worked examples in the prompt so the model copies their pattern, format and judgement on a new input.
- Fine-tuning
- Fine-tuning is training an existing model further on your own examples so it learns a task, style or format it did not do well before.