ChatPaper.aiChatPaper

SliceGPT: 행과 열 삭제를 통해 대규모 언어 모델 압축하기

SliceGPT: Compress Large Language Models by Deleting Rows and Columns

January 26, 2024
저자: Saleh Ashkboos, Maximilian L. Croci, Marcelo Gennari do Nascimento, Torsten Hoefler, James Hensman
cs.AI

초록

대형 언어 모델은 자연어 처리의 핵심 요소로 자리 잡았지만, 이러한 모델의 사용은 컴퓨팅 및 메모리 자원 측면에서 상당한 비용을 수반한다. 희소화(Sparsification)는 이러한 자원 제약을 완화하기 위한 해결책을 제공하며, 최근 연구에서는 훈련된 모델을 사후에 희소화할 수 있음이 입증되었다. 기존의 희소화 기술은 추가적인 데이터 구조가 필요하고 현재 하드웨어에서 제한된 속도 향상만을 제공한다는 점에서 어려움에 직면해 있다. 본 논문에서는 각 가중치 행렬을 더 작은 (밀집) 행렬로 대체하여 네트워크의 임베딩 차원을 줄이는 새로운 사후 훈련 희소화 기법인 SliceGPT를 제안한다. 광범위한 실험을 통해 SliceGPT가 LLAMA2-70B, OPT 66B, Phi-2 모델에서 각각 99%, 99%, 90%의 제로샷 작업 성능을 유지하면서 모델 파라미터(임베딩 포함)의 최대 25%를 제거할 수 있음을 보여준다. 우리의 슬라이스된 모델은 추가적인 코드 최적화 없이도 더 적은 GPU에서 실행되며 더 빠르게 동작한다: 24GB 소비자용 GPU에서 LLAMA2-70B 추론을 위한 총 컴퓨팅 비용을 밀집 모델 대비 64%로 줄였고, 40GB A100 GPU에서는 66%로 감소시켰다. 우리는 SliceGPT를 가능하게 하는 트랜스포머 네트워크의 계산적 불변성(computational invariance)에 대한 새로운 통찰을 제시하며, 이를 통해 사전 훈련된 모델의 메모리 및 계산 요구 사항을 줄이기 위한 미래의 연구 방향에 영감을 주고 가능성을 열어주기를 기대한다. 코드는 https://github.com/microsoft/TransformerCompression에서 확인할 수 있다.
English
Large language models have become the cornerstone of natural language processing, but their use comes with substantial costs in terms of compute and memory resources. Sparsification provides a solution to alleviate these resource constraints, and recent works have shown that trained models can be sparsified post-hoc. Existing sparsification techniques face challenges as they need additional data structures and offer constrained speedup with current hardware. In this paper we present SliceGPT, a new post-training sparsification scheme which replaces each weight matrix with a smaller (dense) matrix, reducing the embedding dimension of the network. Through extensive experimentation, we show that SliceGPT can remove up to 25% of the model parameters (including embeddings) for LLAMA2-70B, OPT 66B and Phi-2 models while maintaining 99%, 99% and 90% zero-shot task performance of the dense model respectively. Our sliced models run on fewer GPUs and run faster without any additional code optimization: on 24GB consumer GPUs we reduce the total compute for inference on LLAMA2-70B to 64% of that of the dense model; on 40GB A100 GPUs we reduce it to 66%. We offer a new insight, computational invariance in transformer networks, which enables SliceGPT and we hope it will inspire and enable future avenues to reduce memory and computation demands for pre-trained models. Code is available at: https://github.com/microsoft/TransformerCompression
PDF746December 15, 2024