Before I get started, this is my first blog on this platform, I hope it goes well.
MAIN FOCUS
It’s become a very easy thing to mistake prompt engineering for finetuning, especially the scenario of “when should I use which”, this blog posts explains everything.
Difference between Prompt Engineering and finetuning
Straight to the point!
Prompt engineering essentially changes/tailors the output of the model, FROM the input itself
An example might be
“Give me a dummy list of students and their cgpa in JSON format, the advantage of this is that the result you’re getting is something you expect, not just random or unstructured.
key focus : in prompt engineering, you change the input, NOT the model itself.
While on the other hand…
Finetuning is much broader, in this case, you retrain the model on your own data, directly modifying the model behavior, this can be done in different environments although expensive, eg: google collab (free), hugging face (models and data), or even server/ locally (very expensive). Finetuning is more expensive because it requires very large compute to be performed, depending on the data and model.
When should you use which ?
Use prompt engineering in most cases when you need structured output.
Use finetuning only in extreme cases that you need to modify the model itself
In between these two concepts there’s something called rag (RETRIEVAL AUGMENTED GENERATION)
in this paradigm, you provide search context for the model to respond with, this involves embedding, vectorization and so on.
Mental model: user -> model -> search -> model -> user
This is good for large context based operations
I hope this helps :)
Top comments (0)