Preference Packing: Efficient Preference Optimization for Large Language Models
Organizations: AWS GenAI Innovation Center
Abstract
Resource-efficient training optimization techniques are becoming increasingly important as the size of large language models (LLMs) continues to grow. In particular, batch packing is commonly used in pre-training and supervised fine-tuning to achieve resource-efficient training. We propose preference packing, a method to enhance resource efficiency in training techniques that use data with different responses for the same input prompt, such as reward models or Direct Preference Optimization (DPO). Preference packing improves resource efficiency by reducing the attention operations for duplicate input prompts and decreasing KV cache memory usage. We conducted experiments on text-only datasets and image-included datasets and achieved at least 37% reduction in training time. Notably, this method can be applied alongside existing optimization techniques such as batch sorting, resulting in a 3.22x speedup.
Figures & tables
| Dataset | Orca | Capybara | RLAIF-V |
|---|---|---|---|
| input len. | 228.2 | 720.6 | 599.8 |
| max resp. len. | 251.0 | 468.8 | 109.6 |
| min resp. len. | 129.6 | 330.7 | 89.7 |
| peak memory | 0.671 | 0.802 | 0.635 |
| time | 0.801 | 0.780 | 0.798 |
| effective time | 0.537 | 0.626 | 0.507 |
| samples/sec | |
|---|---|
| vanilla DPO | 1 |
| w/ preference packing | 1.53 |
| w/ batch sorting | 2.62 |
| w/ both | 3.22 |
Efficient Language Model Training
Efficient language model training studies how to reduce the data, compute, memory, time, energy, and cost needed to build capable language models.
See all 161 papers