# Issues with fine-tuning GPT NeoX using LoRA

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425%3E%5C
**Category:** Models\
**Created:** [April 13, 2023, 7:32am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425 "2023-04-13T07:32:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cekal](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/cekal/32/16380_2.png) [@cekal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcekal)%5C
**Post date:** [April 13, 2023, 7:32am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425%2F1 "2023-04-13T07:32:21Z")

</div>

Hi, I’m trying to fine-tune GPT NeoX 20B using LoRA and peft - the process goes great, takes about 12 hours on my dataset, training loss is acceptable… But when it is finished, the adapter\_model.bin file is very small for some reason (443 bytes) when it should have at least a few MB. When I load the adapter, the model gives unexpected outputs, which shouldn’t happen. Here is the script: [alpaca-lora\_gpt\_neox\_20b/finetune.py at main · satani99/alpaca-lora\_gpt\_neox\_20b · GitHub](https://github.com/satani99/alpaca-lora_gpt_neox_20b/blob/main/finetune.py) (base\_model is not specified, but I specified it before I began the fine-tuning process).

I might be wrong, but I think the problem is in the lora\_target\_modules, where the module is incorrectly specified. I tried printing them after loading the model, and there are like 120 target modules, so which one should I target, all of them?

If anyone knows what the problem is, please let me know.

---

<div class="post-metadata">

**Author:** ![gregkowalski](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/gregkowalski/32/15463_2.png) [@gregkowalski](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgregkowalski)%5C
**Post date:** [April 18, 2023, 6:47am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425%2F2 "2023-04-18T06:47:22Z")

</div>

I’m getting the same result of a 443 bytes `adapter_model.bin` file. I was running [alpaca-lora/finetune.py at main · tloen/alpaca-lora · GitHub](https://github.com/tloen/alpaca-lora/blob/main/finetune.py).

---

<div class="post-metadata">

**Author:** ![gregkowalski](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/gregkowalski/32/15463_2.png) [@gregkowalski](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgregkowalski)%5C
**Post date:** [April 18, 2023, 7:18am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425%2F3 "2023-04-18T07:18:05Z")

</div>

This fixed it for me: [adapter\_model.bin not being updated and only 443 bytes after finetuning · Issue #293 · tloen/alpaca-lora · GitHub](https://github.com/tloen/alpaca-lora/issues/293#issuecomment-1500751776)

---

<div class="post-metadata">

**Author:** ![cekal](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/cekal/32/16380_2.png) [@cekal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcekal)%5C
**Post date:** [April 25, 2023, 8:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425%2F4 "2023-04-25T08:40:22Z")

</div>

Hello, I did that, but nothing happened to the file after I did the re-install. Do I have to run some sort of script to overwrite the old file? Or what exactly have you done, other than the re-install of peft? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![cekal](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/cekal/32/16380_2.png) [@cekal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcekal)%5C
**Post date:** [April 25, 2023, 2:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-fine-tuning-gpt-neox-using-lora%2F36425%2F5 "2023-04-25T14:32:02Z")

</div>

Update: got it fixed by resuming from the latest checkpoint, all good now
