# What dataset to use for the fine tuning of a pretrained llm?

**URL:** <https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823>\
**Category:** NLP with Attention Models\
**Tags:** how-to-forum\
**Created:** [June 13, 2024, 7:07pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823 "2024-06-13T19:07:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [June 13, 2024, 7:07pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/1 "2024-06-13T19:07:02Z")

</div>

I’ve passed your course and still not have clear answer on a question. We have a lot of pretrained llms like Llama or Mistral. And yes, they can give not correct answers on my tasks via prompt.

So, the question is — how can I finetune this models? As I understand they were trained on their own datasets. If I want to add more info to it and train model on this info, will the model be trained from zero? Will it forget all the data on that it was initially trained?

Or if I want to save initial state of answers too, should I find a dataset on which model was trained and try just to add my new dataset to it?

---

<div class="post-metadata">

**Author:** ![carlosrl](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@carlosrl](https://community.deeplearning.ai/u/carlosrl)\
**Post date:** [June 14, 2024, 1:37am UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/2 "2024-06-14T01:37:41Z")

</div>

You can check the short course that explains how to fine-tune LLMs.

---

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [June 16, 2024, 12:18pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/3 "2024-06-16T12:18:41Z")

</div>

Oh, nice! So, as I understnand, if I use .train() on pretrained model, in most part of libraries, it doesn’t overwrite previous knowldege (weights), but just have influence on them and add additional knowledge. It is interesting how much of data should I input to greatly change initial behaviour of pretrained model? 🤔

And, so, as I understand, 1 llm is all I need for all tasks, if I want to use llm anyway for one of tasks? (no need to create smaller models for separate NLP tasks). The problem is just in its additional training for each of the tasks? So, it is something like T5, that you mention in the course? Universal one model for all tasks?

---

<div class="post-metadata">

**Author:** ![Alireza\_Saei](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/alireza_saei/32/85175_2.png) [@Alireza\_Saei](https://community.deeplearning.ai/u/Alireza_Saei)\
**Post date:** [June 17, 2024, 7:59am UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/4 "2024-06-17T07:59:48Z")

</div>

Yes, using `.train()` on a pre-trained model in most libraries doesn’t overwrite the existing weights but rather fine-tunes them with the new data (`NOTE`: You can freeze some weights in some places e.g. feature extractor, etc. to keep their performance foe general-purpose tasks).

The amount of data needed to change the model’s behavior depends on the task and the size of the dataset, but generally, a set of diverse data is required.

LLMs like T5 can handle various NLP tasks with a single model so, you don’t need to create separate models for each task. However, fine-tuning is often necessary!

Hope this helps!

---

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [June 19, 2024, 6:17pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/5 "2024-06-19T18:17:46Z")

</div>

I’ve just started to watch [https://www.coursera.org/learn/generative-ai-with-llms](https://www.coursera.org/learn/generative-ai-with-llms). I think this is most usefull NLP course in deeplearning.ai. I’am sure that it should be included to NLP Specialization.

---

<div class="post-metadata">

**Author:** ![Alireza\_Saei](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/alireza_saei/32/85175_2.png) [@Alireza\_Saei](https://community.deeplearning.ai/u/Alireza_Saei)\
**Post date:** [June 19, 2024, 10:06pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/6 "2024-06-19T22:06:37Z")

</div>

Hey there,

Good to hear that you liked the course and found it practical!

---

<div class="post-metadata">

**Author:** ![fabricio](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/fabricio/32/13892_2.png) [@fabricio](https://community.deeplearning.ai/u/fabricio)\
**Post date:** [June 19, 2024, 11:11pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/7 "2024-06-19T23:11:06Z")

</div>

@Alireza_Saei and @someone555777, I am looking to start my next course, and I was wondering about the NLP Specialization. Then, I read your comments on the Generative AI with LLMs course, which seems good.  
What would you say if you had to choose which one to do first?

---

<div class="post-metadata">

**Author:** ![Alireza\_Saei](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/alireza_saei/32/85175_2.png) [@Alireza\_Saei](https://community.deeplearning.ai/u/Alireza_Saei)\
**Post date:** [June 20, 2024, 3:15am UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/8 "2024-06-20T03:15:46Z")

</div>

Hey there @fabricio

The NLP Specialization starts from the basics of NLP, covering n-grams, POS tagging, RNNs, attention models, transformers, etc. It’s excellent if you have no prior knowledge and want a solid foundation. However, if you’re eager to dive into LLMs field and start projects quickly, the Generative AI with LLMs course might be the better choice.

If you’re not in a rush, starting with the NLP Specialization and then switching to the Generative AI with LLMs course can be a great path.

Hope this helps! If you need further assistance feel free to ask. And good luck with your learning journey! 🙌

---

<div class="post-metadata">

**Author:** ![fabricio](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/fabricio/32/13892_2.png) [@fabricio](https://community.deeplearning.ai/u/fabricio)\
**Post date:** [June 20, 2024, 8:59am UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/9 "2024-06-20T08:59:28Z")

</div>

Alireza,

Your comment is very helpful. Thanks.  
I am not in a rush. I like to learn all the fundamentals first and then build more advanced knowledge on a solid foundation.

I think I’ll follow your suggested learning path, sir.  
Once again, thank you!

---

<div class="post-metadata">

**Author:** ![Alireza\_Saei](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/alireza_saei/32/85175_2.png) [@Alireza\_Saei](https://community.deeplearning.ai/u/Alireza_Saei)\
**Post date:** [June 20, 2024, 9:47am UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/10 "2024-06-20T09:47:26Z")

</div>

You’re welcome! I’m glad you found my comment useful. I wish you the best of luck on your learning journey! 🙌

---

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [June 21, 2024, 11:51am UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/11 "2024-06-21T11:51:43Z")

</div>

But you should know also, that 80% of NLP Specialization is not connected with LLM at all. It is something about how to do specific tasks by simple ways. That are more hardware efficient and has quicker response. But if you will need to use LLM, all this approaches are often a bit non-sense

---

<div class="post-metadata">

**Author:** ![fabricio](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/fabricio/32/13892_2.png) [@fabricio](https://community.deeplearning.ai/u/fabricio)\
**Post date:** [June 21, 2024, 12:31pm UTC](https://community.deeplearning.ai/t/what-dataset-to-use-for-the-fine-tuning-of-a-pretrained-llm/646823/12 "2024-06-21T12:31:26Z")

</div>

Thanks. Yes, I understand that LLMs are just a tiny fraction of what NLP entails. I am interested in learning everything.  
LLMs are great, but I want to go beyond.
