ChatPaper.aiChatPaper

DiJiang:透過緊湊核化實現高效的大型語言模型

DiJiang: Efficient Large Language Models through Compact Kernelization

March 29, 2024
作者: Hanting Chen, Zhicheng Liu, Xutao Wang, Yuchuan Tian, Yunhe Wang
cs.AI

摘要

為了降低Transformer的計算負荷,線性注意力的研究已經取得了顯著的進展。然而,對於注意機制的改進策略通常需要進行大量的重新訓練,對於具有大量參數的大型語言模型來說是不切實際的。在本文中,我們提出了DiJiang,一種新穎的頻域核方法,可以將預訓練的基本Transformer轉換為具有較小訓練成本的線性複雜度模型。通過採用加權的拟蒙特卡洛方法進行採樣,所提出的方法在理論上提供了更優越的近似效率。為了進一步降低訓練計算複雜度,我們的核方法基於離散餘弦變換(DCT)操作。大量實驗表明,所提出的方法實現了與原始Transformer相當的性能,但訓練成本大幅降低,推理速度更快。我們的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

PDF121November 26, 2024