Skip to main content
QUICK REVIEW

[논문 리뷰] FinGPT-HPC: Efficient Pretraining and Finetuning Large Language Models for Financial Applications with High-Performance Computing

Xiaoyang Liu, Jie Zhang|arXiv (Cornell University)|2024. 02. 21.
Mathematics, Computing, and Information ProcessingComputer Science인용 수 3
한 줄 요약

이 논문은 금융 응용 분야에서 대규모 언어 모델(Large Language Models, LLMs)의 사전 훈련 및 미세조정을 위한 메모리와 훈련 시간을 극적으로 줄이는 고성능 계산 프레임워크인 FinGPT-HPC를 제안한다. 표준 선형 레이어를 좁은 저랭크 행렬로 대체하고 4비트 또는 8비트 정밀도로 양자화함으로써, 사전 훈련 시 최대 2.64배의 모델 압축과 1.3배의 속도 향상을 달성하였으며, 금융 분야의 미세조정 작업에서는 6.3배의 메모리 감소와 동시에 정확도가 24% 향상되었다.

ABSTRACT

Large language models (LLMs) are computationally intensive. The computation workload and the memory footprint grow quadratically with the dimension (layer width). Most of LLMs' parameters come from the linear layers of the transformer structure and are highly redundant. These linear layers contribute more than 80% of the computation workload and 99% of the model size. To pretrain and finetune LLMs efficiently, there are three major challenges to address: 1) reducing redundancy of the linear layers; 2) reducing GPU memory footprint; 3) improving GPU utilization when using distributed training. Prior methods, such as LoRA and QLoRA, utilized low-rank matrices and quantization to reduce the number of trainable parameters and model size, respectively. However, the resulting model still consumes a large amount of GPU memory. In this paper, we present high-performance GPU-based methods that exploit low-rank structures to pretrain and finetune LLMs for financial applications. We replace one conventional linear layer of the transformer structure with two narrower linear layers, which allows us to reduce the number of parameters by several orders of magnitude. By quantizing the parameters into low precision (8-bit and 4-bit), the memory consumption of the resulting model is further reduced. Compared with existing LLMs, our methods achieve a speedup of 1.3X and a model compression ratio of 2.64X for pretaining without accuracy drop. For finetuning, our methods achieve an average accuracy increase of 6.3% and 24.0% in general tasks and financial tasks, respectively, and GPU memory consumption ratio of 6.3X. The sizes of our models are smaller than 0.59 GB, allowing inference on a smartphone.

연구 동기 및 목표

  • 금융 응용 분야에서 대규모 언어 모델(Large Language Models, LLMs)의 사전 훈련 및 미세조정에 따른 높은 계산 비용과 메모리 소비 문제를 해결하기 위해.
  • 계산의 80% 이상과 모델 크기의 99% 이상을 차지하는 트랜스포머의 선형 레이어에서의 중복을 줄이기 위해.
  • 분산 훈련 중 GPU 메모리 사용량을 최소화하고 GPU 활용도를 향상시키기 위해.
  • 정확도 저하 최소화와 함께 메모리 소비 감소를 통해 재무 데이터셋에 대한 LLM의 효율적인 미세조정을 가능하게 하기 위해.
  • 모델 크기를 0.59 GB 이하로 압축하여 엣지 디바이스에 배포 가능한 대규모 재무 LLM을 구현하기 위해.

제안 방법

  • 트랜스포머 아키텍처의 표준 선형 레이어를 두 개의 좁은 저랭크 선형 레이어(A 및 B)로 대체하여 파rameter 수를 수개의 순위로 줄인다.
  • 사전 훈련된 가중치에 저랭크 분해를 적용하여 효율적인 사전 훈련을 위한 압축된 저랭크 LLM을 초기화한다.
  • 혼합 정밀도 양자화(4비트 및 8비트)를 적용하여 추가로 모델 크기를 압축하고 GPU 메모리 사용량을 줄인다.
  • 훈련 중 중간 활성화 메모리의 피크 사용량을 줄이기 위해 재계산 기법을 활용한다.
  • 파이프라인 모델 병렬 훈련을 구현하여 다수의 GPU에서의 GPU 활용도를 향상시킨다.
  • 미세조정을 위해 사전 훈련된 가중치를 동결하고 병렬 경로에 저랭크 어댑터를 추가하여, 오직 저랭크 파라미터만 훈련한다.

실험 결과

연구 질문

  • RQ1선형 레이어의 저랭크 분해가 성능을 저하시키지 않으면서 LLM의 학습 가능한 파라미터 수를 크게 줄일 수 있는가?
  • RQ24비트 및 8비트 양자화가 금융 LLM의 사전 훈련 및 미세조정 과정에서 GPU 메모리 사용량을 얼마나 줄일 수 있는가?
  • RQ3제안된 방법이 금융 및 일반 NLP 작업에서 정확도를 유지하거나 향상시키면서도 훈련 및 추론 속도를 향상시킬 수 있는가?
  • RQ4저랭크 적응과 양자화의 조합이 대규모 LLM의 미세조정을 메모리 소비를 줄이며 얼마나 효과적으로 가능하게 하는가?
  • RQ5결과적으로 생성된 모델들이 모바일 또는 엣지 디바이스에 배포 가능한 크기로 압축될 수 있는가?

주요 결과

  • GPT2-1.5B의 사전 훈련에서, 이 방법은 정확도 저하 없이 1.3배의 속도 향상과 2.64배의 모델 압축 비율을 달성하였다.
  • Llama2-13B의 미세조정에서, 금융 작업의 평균 정확도가 24.0% 향상되었고 GPU 메모리 사용량이 6.3배 감소하였다.
  • 이 방법으로 모델 크기를 0.59 GB 이하로 줄여 스마트폰에서의 현장 추론을 가능하게 하였다.
  • 일반 NLP 작업에서, 저랭크 적응을 적용한 미세조정된 Llama2-13B 모델은 8비트 양자화 시 평균 정확도가 15.5% 향상되었다.
  • 4비트 양자화된 Llama2-13B-r8 모델은 메모리 사용량을 26.2 GB에서 9.8 GB로 줄여 11.8배의 압축 비율을 달성하였다.
  • GPT2-1.5B의 경우 모델 크기 감소와 효율적인 계산 덕분에 추론 속도가 1.9배 향상되었고, GPT2-127M의 경우 1.2배 향상되었다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.