# Question about using packing when fine-tuning

**URL:** https://community.openai.com/t/question-about-using-packing-when-fine-tuning/8713
**Category:** API
**Created:** [August 29, 2021, 12:54pm UTC](https://community.openai.com/t/question-about-using-packing-when-fine-tuning/8713 "2021-08-29T12:54:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![robgon](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/robgon/32/232_2.png) [@robgon](https://community.openai.com/u/robgon)
#### Post date: [August 29, 2021, 12:54pm UTC](https://community.openai.com/t/question-about-using-packing-when-fine-tuning/8713/1 "2021-08-29T12:54:49Z")

</div>

Greetings,

I am working on a text generation project that has short prompts and longish completions and I am a little confused about whether I should use packing or not for training.

The documentation for fine-tuning states:

> Note that if you’re fine-tuning a model for a classification task, you should also set the parameter `--no_packing`

That seems clear enough. My use case is not a classification task. But when I run the fine\_tunes.prepare\_data command, it succeeds and gives me this advice in the response:

> `You can use your file for fine-tuning:`  
> `openai api fine_tunes.create -t "/content/songs.jsonl" --no_packing`

Note that my dataset has 400 prompt-completion pairs.

Should I train with --use\_packing or --no\_packing for my use case? Or does it not matter much?

---

<div class="post-metadata">

### Author: ![carla](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/carla/32/4210_2.png) [@carla](https://community.openai.com/u/carla)
#### Post date: [August 30, 2021, 1:57pm UTC](https://community.openai.com/t/question-about-using-packing-when-fine-tuning/8713/2 "2021-08-30T13:57:59Z")

</div>

One of the benefits of packing is to speed up the fine tuning, but if you’re in no particular hurry, use packing=false, it will probably not have much of a difference either way.

I do not know much about what goes on behind the scenes when training, but in the playground, I do know completions are “better” if there’s a clear separation between examples. In this case, \n###\n works very well. Perhaps a packed training file with a stop sequence of \n###\n will have the same effect, but in my mind, packing=false will help separate examples from one another, which is why it’s good for classification tasks.

I’m also no exert on the data preparation tool, but perhaps --no\_packing was just a default output and not meant as advice for your specific training set.

In short, my humble opinion is to train with packing set to false (or --no\_packing) as it won’t do harm, may cause the training to take slightly longer and may give a slightly better result as when using packing = true.

---

<div class="post-metadata">

### Author: ![robgon](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/robgon/32/232_2.png) [@robgon](https://community.openai.com/u/robgon)
#### Post date: [August 30, 2021, 7:59pm UTC](https://community.openai.com/t/question-about-using-packing-when-fine-tuning/8713/3 "2021-08-30T19:59:25Z")

</div>

Hi Carla, OK, great, thanks!
