A Study of Optimizations for Fine-tuning Large Language Models

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Singh, Arjun, Pandey, Nikhil, Shirgaonkar, Anup, Manoj, Pavan, Aski, Vijay
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910474402004992
author Singh, Arjun
Pandey, Nikhil
Shirgaonkar, Anup
Manoj, Pavan
Aski, Vijay
author_facet Singh, Arjun
Pandey, Nikhil
Shirgaonkar, Anup
Manoj, Pavan
Aski, Vijay
contents Fine-tuning large language models is a popular choice among users trying to adapt them for specific applications. However, fine-tuning these models is a demanding task because the user has to examine several factors, such as resource budget, runtime, model size and context length among others. A specific challenge is that fine-tuning is memory intensive, imposing constraints on the required hardware memory and context length of training data that can be handled. In this work, we share a detailed study on a variety of fine-tuning optimizations across different fine-tuning scenarios. In particular, we assess Gradient Checkpointing, Low-Rank Adaptation, DeepSpeed's Zero Redundancy Optimizer and FlashAttention. With a focus on memory and runtime, we examine the impact of different optimization combinations on GPU memory usage and execution runtime during fine-tuning phase. We provide our recommendation on the best default optimization for balancing memory and runtime across diverse model sizes. We share effective strategies for fine-tuning very large models with tens or hundreds of billions of parameters and enabling large context lengths during fine-tuning. Furthermore, we propose the appropriate optimization mixtures for fine-tuning under GPU resource limitations.
format Preprint
id arxiv_https___arxiv_org_abs_2406_02290
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle A Study of Optimizations for Fine-tuning Large Language Models
Singh, Arjun
Pandey, Nikhil
Shirgaonkar, Anup
Manoj, Pavan
Aski, Vijay
Machine Learning
Fine-tuning large language models is a popular choice among users trying to adapt them for specific applications. However, fine-tuning these models is a demanding task because the user has to examine several factors, such as resource budget, runtime, model size and context length among others. A specific challenge is that fine-tuning is memory intensive, imposing constraints on the required hardware memory and context length of training data that can be handled. In this work, we share a detailed study on a variety of fine-tuning optimizations across different fine-tuning scenarios. In particular, we assess Gradient Checkpointing, Low-Rank Adaptation, DeepSpeed's Zero Redundancy Optimizer and FlashAttention. With a focus on memory and runtime, we examine the impact of different optimization combinations on GPU memory usage and execution runtime during fine-tuning phase. We provide our recommendation on the best default optimization for balancing memory and runtime across diverse model sizes. We share effective strategies for fine-tuning very large models with tens or hundreds of billions of parameters and enabling large context lengths during fine-tuning. Furthermore, we propose the appropriate optimization mixtures for fine-tuning under GPU resource limitations.
title A Study of Optimizations for Fine-tuning Large Language Models
topic Machine Learning
url https://arxiv.org/abs/2406.02290