DiJiang: 컴팩트 커널화를 통한 효율적인 대규모 언어 모델
DiJiang: Efficient Large Language Models through Compact Kernelization
March 29, 2024
저자: Hanting Chen, Zhicheng Liu, Xutao Wang, Yuchuan Tian, Yunhe Wang
cs.AI
초록
트랜스포머의 계산 부하를 줄이기 위한 노력의 일환으로, 선형 어텐션에 대한 연구가 상당한 속도로 진행되고 있습니다. 그러나 어텐션 메커니즘의 개선 전략은 일반적으로 광범위한 재훈련을 필요로 하며, 이는 방대한 매개변수를 가진 대규모 언어 모델에는 실용적이지 않습니다. 본 논문에서는 사전 훈련된 일반 트랜스포머를 적은 훈련 비용으로 선형 복잡도 모델로 변환할 수 있는 새로운 주파수 영역 커널화 접근법인 DiJiang을 제안합니다. 가중치가 적용된 준-몬테카를로 방법을 샘플링에 사용함으로써, 제안된 접근법은 이론적으로 우수한 근사 효율성을 제공합니다. 훈련 계산 복잡도를 더욱 줄이기 위해, 우리의 커널화는 이산 코사인 변환(DCT) 연산을 기반으로 합니다. 광범위한 실험을 통해 제안된 방법이 원래의 트랜스포머와 비슷한 성능을 달성하면서도 훈련 비용을 크게 줄이고 추론 속도를 훨씬 빠르게 할 수 있음을 입증했습니다. 우리의 DiJiang-7B는 다양한 벤치마크에서 LLaMA2-7B와 비슷한 성능을 보이면서도 약 1/50의 훈련 비용만을 요구합니다. 코드는 https://github.com/YuchuanTian/DiJiang에서 확인할 수 있습니다.
English
In an effort to reduce the computational load of Transformers, research on
linear attention has gained significant momentum. However, the improvement
strategies for attention mechanisms typically necessitate extensive retraining,
which is impractical for large language models with a vast array of parameters.
In this paper, we present DiJiang, a novel Frequency Domain Kernelization
approach that enables the transformation of a pre-trained vanilla Transformer
into a linear complexity model with little training costs. By employing a
weighted Quasi-Monte Carlo method for sampling, the proposed approach
theoretically offers superior approximation efficiency. To further reduce the
training computational complexity, our kernelization is based on Discrete
Cosine Transform (DCT) operations. Extensive experiments demonstrate that the
proposed method achieves comparable performance to the original Transformer,
but with significantly reduced training costs and much faster inference speeds.
Our DiJiang-7B achieves comparable performance with LLaMA2-7B on various
benchmark while requires only about 1/50 training cost. Code is available at
https://github.com/YuchuanTian/DiJiang.Summary
AI-Generated Summary