# Can I pretrain LLaMA from scratch?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-pretrain-llama-from-scratch%2F37821%3E%5C
**Category:** Beginners\
**Created:** [April 26, 2023, 3:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-pretrain-llama-from-scratch%2F37821 "2023-04-26T15:39:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![npvinHnivqn](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@npvinHnivqn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FnpvinHnivqn)%5C
**Post date:** [July 15, 2023, 5:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-pretrain-llama-from-scratch%2F37821%2F6 "2023-07-15T17:29:39Z")

</div>

I have a small ‘Llama’ model (~1M parameters) by changing the config and trying to train it with my data. However, the model performs terribly on a small dataset(cannot overfit), and I don’t know why. Here is the link to my problem: [Failed to train Llama model](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffailed-to-train-llama-model%2F46215)  
If possible, can I have a small demo code on how to train it?

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-pretrain-llama-from-scratch%2F37821)._
