DiJiang: Efficient Large Language Models through Compact Kernelization

Hanting Chen, Liu Zhicheng, Xutao Wang, Yuchuan Tian, Yunhe Wang
Proceedings of the 41st International Conference on Machine Learning, PMLR 235:7103-7117, 2024.

Abstract

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.

Cite this Paper


BibTeX
@InProceedings{pmlr-v235-chen24ab, title = {{D}i{J}iang: Efficient Large Language Models through Compact Kernelization}, author = {Chen, Hanting and Zhicheng, Liu and Wang, Xutao and Tian, Yuchuan and Wang, Yunhe}, booktitle = {Proceedings of the 41st International Conference on Machine Learning}, pages = {7103--7117}, year = {2024}, editor = {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix}, volume = {235}, series = {Proceedings of Machine Learning Research}, month = {21--27 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v235/main/assets/chen24ab/chen24ab.pdf}, url = {https://proceedings.mlr.press/v235/chen24ab.html}, abstract = {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.} }
Endnote
%0 Conference Paper %T DiJiang: Efficient Large Language Models through Compact Kernelization %A Hanting Chen %A Liu Zhicheng %A Xutao Wang %A Yuchuan Tian %A Yunhe Wang %B Proceedings of the 41st International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2024 %E Ruslan Salakhutdinov %E Zico Kolter %E Katherine Heller %E Adrian Weller %E Nuria Oliver %E Jonathan Scarlett %E Felix Berkenkamp %F pmlr-v235-chen24ab %I PMLR %P 7103--7117 %U https://proceedings.mlr.press/v235/chen24ab.html %V 235 %X 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.
APA
Chen, H., Zhicheng, L., Wang, X., Tian, Y. & Wang, Y.. (2024). DiJiang: Efficient Large Language Models through Compact Kernelization. Proceedings of the 41st International Conference on Machine Learning, in Proceedings of Machine Learning Research 235:7103-7117 Available from https://proceedings.mlr.press/v235/chen24ab.html.

Related Material