Mise à l'échelle sans entraînement des modèles de langage de grande envergure pour des contextes longs
Training-Free Long-Context Scaling of Large Language Models
February 27, 2024
Auteurs: Chenxin An, Fei Huang, Jun Zhang, Shansan Gong, Xipeng Qiu, Chang Zhou, Lingpeng Kong
cs.AI
Résumé
La capacité des grands modèles de langage (LLMs) à traiter et générer du texte cohérent est considérablement affaiblie lorsque le nombre de tokens d'entrée dépasse leur longueur de prétraining. Étant donné le coût élevé du fine-tuning des modèles à grande échelle avec des séquences plus longues, nous proposons l'attention double chunk (DCA), qui permet à Llama2 70B de supporter des fenêtres de contexte de plus de 100k tokens sans entraînement continu. En décomposant le calcul de l'attention pour les longues séquences en modules basés sur des chunks, DCA parvient à capturer efficacement les informations de position relative des tokens au sein d'un même chunk (Intra-Chunk) et entre des chunks distincts (Inter-Chunk), tout en s'intégrant de manière transparente avec Flash Attention. En plus de sa capacité impressionnante d'extrapolation, DCA atteint des performances sur des tâches pratiques à long contexte qui sont comparables, voire meilleures, à celles des modèles fine-tunés. Comparé aux modèles propriétaires, notre modèle 70B sans entraînement atteint 94 % des performances de gpt-3.5-16k, indiquant qu'il constitue une alternative open-source viable. Tous les codes et données utilisés dans ce travail sont disponibles à l'adresse https://github.com/HKUNLP/ChunkLlama.
English
The ability of Large Language Models (LLMs) to process and generate coherent
text is markedly weakened when the number of input tokens exceeds their
pretraining length. Given the expensive overhead of finetuning large-scale
models with longer sequences, we propose Dual Chunk Attention (DCA), which
enables Llama2 70B to support context windows of more than 100k tokens without
continual training. By decomposing the attention computation for long sequences
into chunk-based modules, DCA manages to effectively capture the relative
positional information of tokens within the same chunk (Intra-Chunk) and across
distinct chunks (Inter-Chunk), as well as integrates seamlessly with Flash
Attention. In addition to its impressive extrapolation capability, DCA achieves
performance on practical long-context tasks that is comparable to or even
better than that of finetuned models. When compared with proprietary models,
our training-free 70B model attains 94% of the performance of gpt-3.5-16k,
indicating it is a viable open-source alternative. All code and data used in
this work are released at https://github.com/HKUNLP/ChunkLlama.Summary
AI-Generated Summary