arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.19928cs.CLcs.LG
收藏

DiJiang:通过紧凑核化实现高效大语言模型

DiJiang: Efficient Large Language Models through Compact Kernelization

Huawei Noah’s Ark Lab(华为诺亚方舟实验室);Peking University(北京大学)

Hanting Chen, Zhicheng Liu, Xutao Wang, Yuchuan Tian, Yunhe Wang

AI总结:

本文提出频域核化方法DiJiang,利用加权拟蒙特卡洛采样和离散余弦变换,以约1/50的训练成本将预训练Transformer转换为线性复杂度模型,并在多个基准上取得与LLaMA2-7B相当的性能。

摘要:

为了降低Transformer的计算负担,线性注意力研究已获得显著发展势头。然而,注意力机制的改进策略通常需要大量重新训练,这对于具有海量参数的大语言模型而言并不现实。本文提出了DiJiang,一种新颖的频域核化方法,能够以极低的训练成本将预训练的标准Transformer转换为线性复杂度模型。通过采用加权拟蒙特卡洛方法进行采样,所提方法在理论上具有更优的近似效率。为进一步降低训练计算复杂度,我们的核化基于离散余弦变换(DCT)运算。大量实验表明,所提方法在性能上与原始Transformer相当,但训练成本显著降低,推理速度大幅提升。我们的DiJiang-7B在多个基准测试上取得了与LLaMA2-7B相当的性能,而所需训练成本仅约为后者的1/50。代码见https://github.com/YuchuanTian/DiJiang。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑