ChatPaper.aiChatPaper

DiJiang: Efficiënte Grote Taalmodellen via Compacte Kernelisatie

DiJiang: Efficient Large Language Models through Compact Kernelization

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

Samenvatting

In een poging om de rekenlast van Transformers te verminderen, heeft onderzoek naar lineaire aandacht aanzienlijke momentum gekregen. De verbeteringsstrategieën voor aandachtmechanismen vereisen echter doorgaans uitgebreide hertraining, wat onpraktisch is voor grote taalmodelen met een enorm aantal parameters. In dit artikel presenteren we DiJiang, een nieuwe Frequency Domain Kernelization-benadering die het mogelijk maakt om een vooraf getrainde standaard Transformer om te zetten in een model met lineaire complexiteit tegen lage trainingskosten. Door een gewogen Quasi-Monte Carlo-methode voor steekproefname te gebruiken, biedt de voorgestelde benadering theoretisch superieure benaderings efficiëntie. Om de rekencomplexiteit van de training verder te verminderen, is onze kernelisatie gebaseerd op Discrete Cosine Transform (DCT)-bewerkingen. Uitgebreide experimenten tonen aan dat de voorgestelde methode vergelijkbare prestaties bereikt als de originele Transformer, maar met aanzienlijk lagere trainingskosten en veel snellere inferentiesnelheden. Onze DiJiang-7B behaalt vergelijkbare prestaties met LLaMA2-7B op verschillende benchmarks, terwijl slechts ongeveer 1/50 van de trainingskosten nodig is. Code is beschikbaar op 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.
PDF121November 26, 2024