Skip to main content
QUICK REVIEW

[논문 리뷰] CompactifAI: Extreme Compression of Large Language Models using Quantum-Inspired Tensor Networks

Andrei Tomut, Saeed S. Jahromi|arXiv (Cornell University)|2024. 01. 25.
Topic ModelingComputer Science인용 수 8
한 줄 요약

CompactifAI는 양자에서 영감을 받은 텐서 네트워크(MPOs)를 사용하여 LLM 가중치를 텐서화하고, LlaMA-2 7B에서 짧은 재학습 후 원래 정확도의 약 90%를 유지하면서 ~30% 크기로 상당한 압축을 달성합니다. 이는 다른 압축 방법을 보완하고 분산 학습 속도를 높일 수 있습니다.

ABSTRACT

Large Language Models (LLMs) such as ChatGPT and LlaMA are advancing rapidly in generative Artificial Intelligence (AI), but their immense size poses significant challenges, such as huge training and inference costs, substantial energy demands, and limitations for on-site deployment. Traditional compression methods such as pruning, distillation, and low-rank approximation focus on reducing the effective number of neurons in the network, while quantization focuses on reducing the numerical precision of individual weights to reduce the model size while keeping the number of neurons fixed. While these compression methods have been relatively successful in practice, there is no compelling reason to believe that truncating the number of neurons is an optimal strategy. In this context, this paper introduces CompactifAI, an innovative LLM compression approach using quantum-inspired Tensor Networks that focuses on the model's correlation space instead, allowing for a more controlled, refined and interpretable model compression. Our method is versatile and can be implemented with - or on top of - other compression techniques. As a benchmark, we demonstrate that a combination of CompactifAI with quantization allows to reduce a 93% the memory size of LlaMA 7B, reducing also 70% the number of parameters, accelerating 50% the training and 25% the inference times of the model, and just with a small accuracy drop of 2% - 3%, going much beyond of what is achievable today by other compression techniques. Our methods also allow to perform a refined layer sensitivity profiling, showing that deeper layers tend to be more suitable for tensor network compression, which is compatible with recent observations on the ineffectiveness of those layers for LLM performance. Our results imply that standard LLMs are, in fact, heavily overparametrized, and do not need to be large at all.

연구 동기 및 목표

  • 브런치 없이 네트워크 뉴런 트런케이션을 통한 brute-force 방식으로 모델 크기를 줄여 더 친환경적이고 효율적인 LLM 배치를 목표로 한다.
  • 상관 관계 공간을 목표로 하는 텐서-네트워크 기반 압축을 도입하여 뉴런 수가 아닌 상관 관계를 다룬다.
  • 다른 압축 기법과의 호환성을 보여주고 분산 학습에서의 효과를 입증한다.

제안 방법

  • Bond 차원 chi를 갖는 Matrix Product Operators(MPO)로 선택된 Self-Attention 및 MLP 가중치를 텐서화한다.
  • 상관 관계를 잘라내기 위해 상위 chi 특이값을 보유하도록 연속적 SVD를 통해 MPO를 결정한다.
  • 분산 설정에서 CPu-GPU 전송 시간을 감소시키는 이점을 활용하여 텐서화된 모델을 짧게 재학습시켜 정확도를 회복한다.
  • Compression을 달성하기 위해 SA 및 MLP 계층에서 chi ≈ 100을 사용하고 float16으로 벡터화를 통해 LlaMA-2 7B에서 벤치마크한다.
  • 추가적인 크기 축소를 위해 경미한 양자화(float32에서 float16)를 결합한다.
  • XSum 및 Gigaword 데이터셋에서 Rouge 지표를 사용해 텍스트 요약 성능을 평가한다.

실험 결과

연구 질문

  • RQ1양자에서 영감을 받은 텐서 네트워크가 상관 공간을 잘라내면서 정확도에 큰 타격 없이 LLM을 효율적으로 압축할 수 있는가?
  • RQ2MPO 기반 압축과 그에 따른 재학습이 모델 크기, 학습 속도, 다운스트림 작업 성능에 미치는 영향은 무엇인가?
  • RQ3양자화와 같은 다른 압축 기법과 CompactifAI의 상호 작용은 어떻게 되는가?
  • RQ4실용적인 설정의 다GPU 분산 학습에 이 접근법이 viable한가?

주요 결과

  • LlaMA-2 7B를 원래 7B 매개변수에서 약 2B 매개변수로 압축( float16 기준 원래 크기의 30%).
  • 압축 및 소량 양자화 후 메모리 풋프린트가 3.7 GB(float16)로 감소합니다.
  • 압축된 모델의 재학습은 XSum 및 Gigaword에서 원래 Rouge 기반 요약 정확도의 약 90%를 달성합니다.
  • 압축된 모델의 학습/재학습 시간은 분산 다-GPU 설정에서 비압축 모델의 약 절반 수준입니다.
  • 경미한 양자화(float32에서 float16)를 통해 추가로 약 2배의 압축이 가능하며 최종 크기는 float32의 원래 7B 모델의 약 15%로 감소합니다.
  • 이 방법은 GPU 호환성이 있으며 8개의 NVIDIA A100 GPU를 사용하는 단일 AWS 머신에서도 시연되었습니다.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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